aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorPhil Carmody <ext-phil.2.carmody@nokia.com>2011-07-14 08:07:13 -0400
committerJiri Kosina <jkosina@suse.cz>2011-07-21 08:10:00 -0400
commit497888cf69bf607ac1fe061a6437e0a670b0022f (patch)
treeac0897eff214f09c89d5f4fbc3c03ef9d010a83c /arch/powerpc/include
parent06b72d06d6b182bdaaaec686dbd8b602949521ee (diff)
treewide: fix potentially dangerous trailing ';' in #defined values/expressions
All these are instances of #define NAME value; or #define NAME(params_opt) value; These of course fail to build when used in contexts like if(foo $OP NAME) while(bar $OP NAME) and may silently generate the wrong code in contexts such as foo = NAME + 1; /* foo = value; + 1; */ bar = NAME - 1; /* bar = value; - 1; */ baz = NAME & quux; /* baz = value; & quux; */ Reported on comp.lang.c, Message-ID: <ab0d55fe-25e5-482b-811e-c475aa6065c3@c29g2000yqd.googlegroups.com> Initial analysis of the dangers provided by Keith Thompson in that thread. There are many more instances of more complicated macros having unnecessary trailing semicolons, but this pile seems to be all of the cases of simple values suffering from the problem. (Thus things that are likely to be found in one of the contexts above, more complicated ones aren't.) Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/elf.h4
-rw-r--r--arch/powerpc/include/asm/smu.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index 2b917c69ed15..3bf9cca35147 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -267,7 +267,7 @@ extern int ucache_bsize;
267struct linux_binprm; 267struct linux_binprm;
268extern int arch_setup_additional_pages(struct linux_binprm *bprm, 268extern int arch_setup_additional_pages(struct linux_binprm *bprm,
269 int uses_interp); 269 int uses_interp);
270#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b); 270#define VDSO_AUX_ENT(a,b) NEW_AUX_ENT(a,b)
271 271
272/* 1GB for 64bit, 8MB for 32bit */ 272/* 1GB for 64bit, 8MB for 32bit */
273#define STACK_RND_MASK (is_32bit_task() ? \ 273#define STACK_RND_MASK (is_32bit_task() ? \
@@ -298,7 +298,7 @@ do { \
298 NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \ 298 NEW_AUX_ENT(AT_DCACHEBSIZE, dcache_bsize); \
299 NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \ 299 NEW_AUX_ENT(AT_ICACHEBSIZE, icache_bsize); \
300 NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \ 300 NEW_AUX_ENT(AT_UCACHEBSIZE, ucache_bsize); \
301 VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base) \ 301 VDSO_AUX_ENT(AT_SYSINFO_EHDR, current->mm->context.vdso_base); \
302} while (0) 302} while (0)
303 303
304/* PowerPC64 relocations defined by the ABIs */ 304/* PowerPC64 relocations defined by the ABIs */
diff --git a/arch/powerpc/include/asm/smu.h b/arch/powerpc/include/asm/smu.h
index e3bdada8c542..ae20ce1af4c7 100644
--- a/arch/powerpc/include/asm/smu.h
+++ b/arch/powerpc/include/asm/smu.h
@@ -547,7 +547,7 @@ struct smu_sdbp_header {
547 * (currently, afaik, this concerns only the FVT partition 547 * (currently, afaik, this concerns only the FVT partition
548 * (0x12) 548 * (0x12)
549 */ 549 */
550#define SMU_U16_MIX(x) le16_to_cpu(x); 550#define SMU_U16_MIX(x) le16_to_cpu(x)
551#define SMU_U32_MIX(x) ((((x) & 0xff00ff00u) >> 8)|(((x) & 0x00ff00ffu) << 8)) 551#define SMU_U32_MIX(x) ((((x) & 0xff00ff00u) >> 8)|(((x) & 0x00ff00ffu) << 8))
552 552
553 553