IA64: cast has a higher precedence than '?'
PATCH 1/1 IA64: cast has a higher precedence than '?'
because of the ?: this is not strictly necessary, but I think the added parentheses are nice here.
--------------------------->8-------------8<------------------------------ A cast has a higher precedence than '?'
---
arch/x86/include/asm/syscall.h +1 -1
@@ -61,7 +61,7 @@ static inline void syscall_set_return_value(struct task_struct *task,struct pt_regs *regs, int error, long val) { - regs->ax = (long) error ?: val; + regs->ax = (long) (error ?: val); }#ifdef CONFIG_X86_32
arch/x86/include/asm/syscall.h static inline void syscall_set_return_value(struct task_struct *task, · line 64
Quoted 12 lines · Roel Kluin
because of the ?: this is not strictly necessary, but I think the added parentheses are nice here.
--------------------------->8-------------8<------------------------------ A cast has a higher precedence than '?'
arch/x86/include/asm/syscall.h +1
-1@@ -61,7 +61,7 @@ static inline void syscall_set_return_value(struct task_struct *task,struct pt_regs *regs, int error, long val) { - regs->ax = (long) error ?: val; + regs->ax = (long) (error ?: val);
it doesnt matter, does it? the 32-bit entity here is 'error', so casting it to 64-bit long is just as fine as casting the end result to long. In fact this should be the best:
regs->ax = error ?: val;
as the 32-bit 'error' will be extended to 64 bits anyway.
Ingo
arch/x86/include/asm/syscall.h
Quoted 3 lines
arch/x86/include/asm/syscall.h +0
-0
btw., the subject line is wrong - this is not an ia64 patch but
an x86 patch.
Ingo