Subject: [RFC][PATCH v2] irq_work: Drop cmpxchg result

This solves this compilation warning:

kernel/irq_work.c: In function 'irq_work_run':
kernel/irq_work.c:148: warning: value computed is not used

Signed-off-by: Sergio Aguirre <[email protected]>
Cc: Huang Ying <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Peter Zijlstra <[email protected]>
---

Changelog:
v2 - Keep ignoring the cmpxchg return value, as pointed
out by Peter Zijlstra, and update patch subject/description

v1 - Initial version
(found here: https://patchwork.kernel.org/patch/328662/)

kernel/irq_work.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index f16763f..90f8819 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -145,7 +145,9 @@ void irq_work_run(void)
* Clear the BUSY bit and return to the free state if
* no-one else claimed it meanwhile.
*/
- cmpxchg(&entry->next, next_flags(NULL, IRQ_WORK_BUSY), NULL);
+ (void)cmpxchg(&entry->next,
+ next_flags(NULL, IRQ_WORK_BUSY),
+ NULL);
}
}
EXPORT_SYMBOL_GPL(irq_work_run);
--
1.7.0.4


2010-11-16 18:17:00

by Eric Dumazet

[permalink] [raw]
Subject: Re: [RFC][PATCH v2] irq_work: Drop cmpxchg result

Le mardi 16 novembre 2010 à 12:02 -0600, Sergio Aguirre a écrit :
> This solves this compilation warning:
>
> kernel/irq_work.c: In function 'irq_work_run':
> kernel/irq_work.c:148: warning: value computed is not used

Just curious, what is your compiler version ?

Thanks

2010-11-16 18:26:00

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [RFC][PATCH v2] irq_work: Drop cmpxchg result

On Tue, 2010-11-16 at 12:02 -0600, Sergio Aguirre wrote:
> This solves this compilation warning:
>
> kernel/irq_work.c: In function 'irq_work_run':
> kernel/irq_work.c:148: warning: value computed is not used
>
Thanks!

Subject: RE: [RFC][PATCH v2] irq_work: Drop cmpxchg result



> -----Original Message-----
> From: Eric Dumazet [mailto:[email protected]]
> Sent: Tuesday, November 16, 2010 12:17 PM
> To: Aguirre, Sergio
> Cc: LKML; Huang Ying; Martin Schwidefsky; Ingo Molnar; Kyle McMartin;
> Peter Zijlstra
> Subject: Re: [RFC][PATCH v2] irq_work: Drop cmpxchg result
>
> Le mardi 16 novembre 2010 ? 12:02 -0600, Sergio Aguirre a ?crit :
> > This solves this compilation warning:
> >
> > kernel/irq_work.c: In function 'irq_work_run':
> > kernel/irq_work.c:148: warning: value computed is not used
>
> Just curious, what is your compiler version ?

I'm using a Code Sourcery ARM toolchain, and compiling for TI OMAP2+ chips (armv7-a)

# arm-none-linux-gnueabi-gcc --version
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2010q1-202) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Regards,
Sergio

>
> Thanks
>

Subject: [tip:perf/urgent] irq_work: Drop cmpxchg() result

Commit-ID: 94e8ba728640dc01375a14e337f3b892bfacbeeb
Gitweb: http://git.kernel.org/tip/94e8ba728640dc01375a14e337f3b892bfacbeeb
Author: Sergio Aguirre <[email protected]>
AuthorDate: Tue, 16 Nov 2010 12:02:47 -0600
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 18 Nov 2010 13:18:47 +0100

irq_work: Drop cmpxchg() result

The compiler warned us about:

kernel/irq_work.c: In function 'irq_work_run':
kernel/irq_work.c:148: warning: value computed is not used

Dropping the cmpxchg() result is indeed weird, but correct -
so annotate away the warning.

Signed-off-by: Sergio Aguirre <[email protected]>
Cc: Huang Ying <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Kyle McMartin <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
kernel/irq_work.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index f16763f..90f8819 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -145,7 +145,9 @@ void irq_work_run(void)
* Clear the BUSY bit and return to the free state if
* no-one else claimed it meanwhile.
*/
- cmpxchg(&entry->next, next_flags(NULL, IRQ_WORK_BUSY), NULL);
+ (void)cmpxchg(&entry->next,
+ next_flags(NULL, IRQ_WORK_BUSY),
+ NULL);
}
}
EXPORT_SYMBOL_GPL(irq_work_run);