diff options
author | Julia Lawall <julia@diku.dk> | 2009-09-21 11:08:55 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-09-30 15:46:59 -0400 |
commit | b265158399ad825411f3d471cacc46b00d0e4841 (patch) | |
tree | c2ce0ecf69824c5f18f631ca24a61ff7c2fd56ea | |
parent | 742db5d1085df97354ce65daf9b6b657696d5268 (diff) |
MIPS: SMTC: Remove duplicate structure field initialization
The definition of the irq_ipi structure has two initializations of the
flags field. This combines them.
[Ralf: The issue was originally introduced by commit
be4894196d79455f420dd7bb78be7dc73bec115c (linux-mips.org) rsp.
033890b084adfa367c544864451d7730552ce8bf (kernel.org). The original
intention of the code was to initialize .flags with both flags ored together.
The broken C code as actually implemented will be compiled by an equally
broken gcc to use only the last initialization, that is IRQF_PERCPU
which means this turned into an SMTC bug for 2.6.23 and newer.]
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier I, s, fld;
position p0,p;
expression E;
@@
struct I s =@p0 { ... .fld@p = E, ...};
@s@
identifier I, s, r.fld;
position r.p0,p;
expression E;
@@
struct I s =@p0 { ... .fld@p = E, ...};
@script:python@
p0 << r.p0;
fld << r.fld;
ps << s.p;
pr << r.p;
@@
if int(ps[0].line)!=int(pr[0].line) or int(ps[0].column)!=int(pr[0].column):
cocci.print_main(fld,p0)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/smtc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 67153a0dc267..4d181df44a40 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -1098,9 +1098,8 @@ static void ipi_irq_dispatch(void) | |||
1098 | 1098 | ||
1099 | static struct irqaction irq_ipi = { | 1099 | static struct irqaction irq_ipi = { |
1100 | .handler = ipi_interrupt, | 1100 | .handler = ipi_interrupt, |
1101 | .flags = IRQF_DISABLED, | 1101 | .flags = IRQF_DISABLED | IRQF_PERCPU, |
1102 | .name = "SMTC_IPI", | 1102 | .name = "SMTC_IPI" |
1103 | .flags = IRQF_PERCPU | ||
1104 | }; | 1103 | }; |
1105 | 1104 | ||
1106 | static void setup_cross_vpe_interrupts(unsigned int nvpe) | 1105 | static void setup_cross_vpe_interrupts(unsigned int nvpe) |