]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
vdso/datastore: Reduce scope of some variables in vvar_fault()
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Wed, 4 Mar 2026 07:48:58 +0000 (08:48 +0100)
committerThomas Gleixner <tglx@kernel.org>
Wed, 11 Mar 2026 09:18:30 +0000 (10:18 +0100)
These variables are only used inside a single branch.

Move their declarations there.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Link: https://patch.msgid.link/20260304-vdso-sparc64-generic-2-v6-1-d8eb3b0e1410@linutronix.de
lib/vdso/datastore.c

index a565c30c71a04ff4116c14f43f4450210eba99c5..2cca4e84e5b5e7686d6a2b42b41af4f399cc5261 100644 (file)
@@ -41,8 +41,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
                             struct vm_area_struct *vma, struct vm_fault *vmf)
 {
        struct page *timens_page = find_timens_vvar_page(vma);
-       unsigned long addr, pfn;
-       vm_fault_t err;
+       unsigned long pfn;
 
        switch (vmf->pgoff) {
        case VDSO_TIME_PAGE_OFFSET:
@@ -54,6 +53,9 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
                         * Fault in VVAR page too, since it will be accessed
                         * to get clock data anyway.
                         */
+                       unsigned long addr;
+                       vm_fault_t err;
+
                        addr = vmf->address + VDSO_TIMENS_PAGE_OFFSET * PAGE_SIZE;
                        err = vmf_insert_pfn(vma, addr, pfn);
                        if (unlikely(err & VM_FAULT_ERROR))