Re: [PATCH] [V2] stv090x: variable 'no_signal' set but not used
From: Peter Senna Tschudin <peter.senna@gmail.com>
Date: 2012-06-28 13:25:50
On Thu, Jun 28, 2012 at 10:17 AM, Peter Senna Tschudin [off-list ref] wrote:
Hey Ezequiel, On Thu, Jun 28, 2012 at 1:02 AM, Ezequiel Garcia [off-list ref] wrote:quoted
Hey Peter, On Wed, Jun 27, 2012 at 7:18 PM, Peter Senna Tschudin [off-list ref] wrote:quoted
- no_signal = stv090x_chk_signal(state); + (void) stv090x_chk_signal(state);Why are you casting return to void? I can't see there is a reason to it.The idea is to tell the compiler that I know that stv090x_chk_signal() return a value and I want to ignore it. It is to prevent the compiler to issue warn_unused_result. I found two ways of doing it. First is casting the return to void, second is to change the function definition adding the macro __must_check defined at <linux/compiler.c>
defined at <linux/compiler.h>
like on: http://lxr.linux.no/linux+v3.4.4/include/linux/kernel.h#L215 The (void) solution looked simpler to me, but I'll be happy to change to the __must_check solution if better. What do you think? Keep as is? Add a comment? Change to __must_check?quoted
Regards, Ezequiel.Regards, Peter -- Peter Senna Tschudin peter.senna@gmail.com gpg id: 48274C36
-- Peter Senna Tschudin peter.senna@gmail.com gpg id: 48274C36