diff for duplicates of <20160209120032.GB19840@leverpostej> diff --git a/a/1.txt b/N1/1.txt index 5826a40..b0102c9 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -35,50 +35,3 @@ It builds fine for arm, arm64, mips, and tilegx in local testing. Thanks, Mark. ---->8---- -From d30ae6ebbae2c969ee36ef548711493b64c2be41 Mon Sep 17 00:00:00 2001 -From: Mark Rutland <mark.rutland@arm.com> -Date: Tue, 9 Feb 2016 11:43:55 +0000 -Subject: [PATCH] asm-generic: Avoid variable in __set_fixmap_offset - -Currently __set_fixmap_offset is a macro function which has a local -variable called 'addr'. If a caller passes a 'phys' parameter which is -derived from a variable also called 'addr', the local variable will -shadow this, and the compiler will complain about the use of an -uninitialized variable. - -It is likely that fixmap users may use the name 'addr' for variables -that may be directly passed to __set_fixmap_offset, or that may be -indirectly generated via other macros. Rather than placing the burden on -callers to avoid the name 'addr', this patch removes the temporary -'addr' variable in __set_fixmap_offset, directly returning the result of -the address calculation. - -Signed-off-by: Mark Rutland <mark.rutland@arm.com> -Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> -Cc: Arnd Bergmann <arnd@arndb.de> -Cc: Catalin Marinas <catalin.marinas@arm.com> -Cc: Jeremy Linton <jeremy.linton@arm.com> -Cc: Laura Abbott <labbott@fedoraproject.org> -Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com> ---- - include/asm-generic/fixmap.h | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h -index 1cbb833..ae2cc43 100644 ---- a/include/asm-generic/fixmap.h -+++ b/include/asm-generic/fixmap.h -@@ -72,10 +72,8 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr) - /* Return a pointer with offset calculated */ - #define __set_fixmap_offset(idx, phys, flags) \ - ({ \ -- unsigned long addr; \ - __set_fixmap(idx, phys, flags); \ -- addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ -- addr; \ -+ fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \ - }) - - #define set_fixmap_offset(idx, phys) \ --- -1.9.1 diff --git a/a/content_digest b/N1/content_digest index 7df0371..e45d038 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -51,53 +51,6 @@ "\n" "Thanks,\n" "Mark.\n" - "---->8----\n" - "From d30ae6ebbae2c969ee36ef548711493b64c2be41 Mon Sep 17 00:00:00 2001\n" - "From: Mark Rutland <mark.rutland@arm.com>\n" - "Date: Tue, 9 Feb 2016 11:43:55 +0000\n" - "Subject: [PATCH] asm-generic: Avoid variable in __set_fixmap_offset\n" - "\n" - "Currently __set_fixmap_offset is a macro function which has a local\n" - "variable called 'addr'. If a caller passes a 'phys' parameter which is\n" - "derived from a variable also called 'addr', the local variable will\n" - "shadow this, and the compiler will complain about the use of an\n" - "uninitialized variable.\n" - "\n" - "It is likely that fixmap users may use the name 'addr' for variables\n" - "that may be directly passed to __set_fixmap_offset, or that may be\n" - "indirectly generated via other macros. Rather than placing the burden on\n" - "callers to avoid the name 'addr', this patch removes the temporary\n" - "'addr' variable in __set_fixmap_offset, directly returning the result of\n" - "the address calculation.\n" - "\n" - "Signed-off-by: Mark Rutland <mark.rutland@arm.com>\n" - "Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>\n" - "Cc: Arnd Bergmann <arnd@arndb.de>\n" - "Cc: Catalin Marinas <catalin.marinas@arm.com>\n" - "Cc: Jeremy Linton <jeremy.linton@arm.com>\n" - "Cc: Laura Abbott <labbott@fedoraproject.org>\n" - "Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>\n" - "---\n" - " include/asm-generic/fixmap.h | 4 +---\n" - " 1 file changed, 1 insertion(+), 3 deletions(-)\n" - "\n" - "diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h\n" - "index 1cbb833..ae2cc43 100644\n" - "--- a/include/asm-generic/fixmap.h\n" - "+++ b/include/asm-generic/fixmap.h\n" - "@@ -72,10 +72,8 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr)\n" - " /* Return a pointer with offset calculated */\n" - " #define __set_fixmap_offset(idx, phys, flags)\t\t \\\n" - " ({\t\t\t\t\t\t\t \\\n" - "-\tunsigned long addr;\t\t\t\t \\\n" - " \t__set_fixmap(idx, phys, flags);\t\t\t \\\n" - "-\taddr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \\\n" - "-\taddr;\t\t\t\t\t\t \\\n" - "+\tfix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1));\t \\\n" - " })\n" - " \n" - " #define set_fixmap_offset(idx, phys) \\\n" - "-- \n" - 1.9.1 + ---->8---- -62df2ee0884c382cf1446f832826f281d13ef1d389d25a7ba41ece0d341a7a6f +259c59fad23f5b9cc39d1d00c23ec6c294449cbc564c3b1b0711143b505f3dd8
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox