All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: Rfkill rewrite
Date: Sat, 18 Jul 2009 16:46:11 +0100	[thread overview]
Message-ID: <4A61EE43.4060003@tuffmail.co.uk> (raw)

On 4/18/09, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Sat, 2009-04-18 at 14:29 +0100, Alan Jenkins wrote:
>
>> API nit:
>> 
>>  * This function tells the rfkill core that the device is capable of
>>  * remembering soft blocks (which it is notified of via the set_block
>>  * method) -- this means that the driver may ignore the return value
>>  * from rfkill_set_hw_state().
>> 
>> Doesn't this conflict with the declaration of rfkill_set_hw_state() as
>> __must_check?
>
> Yeah, in a way it does, but I figure it's rare enough that those who
> really can ignore it can write
> 	(void) rfkill_set_hw_state(...)
>
> Don't really have a strong opinion, it just seemed the mistake in the
> other direction would be more common.

It seems my GCC has a stronger definition of "must" than you do :-).  I can't get rid of the warning by casting it to void.  So I'm not sure __must_check is really appropriate here.

drivers/platform/x86/hp-wmi.c: In function ‘hp_wmi_bios_setup’:
drivers/platform/x86/hp-wmi.c:467: warning: ignoring return value of ‘rfkill_set_hw_state’, declared with attribute warn_unused_result

$ grep -n rfkill_set_hw_state drivers/platform/x86/hp-wmi.c
467:            (void) rfkill_set_hw_state(wifi_rfkill,

$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)


Thanks
Alan

             reply	other threads:[~2009-07-18 15:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-18 15:46 Alan Jenkins [this message]
2009-07-18 17:40 ` Rfkill rewrite Johannes Berg
2009-07-18 18:20   ` [PATCH] rfkill: remove too-strict __must_check Alan Jenkins
2009-07-18 18:22     ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2009-05-01  9:42 rfkill rewrite Alan Jenkins
2009-05-05  8:15 ` Johannes Berg
2009-05-05 14:04   ` Alan Jenkins
2009-05-05 14:11     ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A61EE43.4060003@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.