From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from out3.smtp.messagingengine.com ([66.111.4.27]:46420 "EHLO out3.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbYGWRlf (ORCPT ); Wed, 23 Jul 2008 13:41:35 -0400 Date: Wed, 23 Jul 2008 14:41:29 -0300 From: Henrique de Moraes Holschuh To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Ivo van Doorn Subject: Re: [PATCH] rfkill: detect bogus double-registering Message-ID: <20080723174129.GB11009@khazad-dum.debian.net> References: <1216775046-9506-1-git-send-email-hmh@hmh.eng.br> <1216775046-9506-2-git-send-email-hmh@hmh.eng.br> <1216784519.13587.4.camel@johannes.berg> <20080723152759.GC4684@khazad-dum.debian.net> <1216830607.13587.20.camel@johannes.berg> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1216830607.13587.20.camel@johannes.berg> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Wed, 23 Jul 2008, Johannes Berg wrote: > On Wed, 2008-07-23 at 12:27 -0300, Henrique de Moraes Holschuh wrote: > > On Wed, 23 Jul 2008, Johannes Berg wrote: > > > > + list_for_each_entry(p, &rfkill_list, node) { > > > > + if (p == rfkill) > > > > + return -EEXIST; > > > > + set_bit(p->type, &seen); > > > > > > You should WARN_ON so it can get fixed. > > > > I'd rather make rfkill_register __must_check, actually. With or without > > WARN_ON. > > > > In fact, lots of stuff in rfkill should be __must_check. Ivo, what do you > > think? Add __must_check? Add WARN_ON? Add both? > > Do both then. __must_check annotations get ignored regularly, or > "handled" like this: > > if (...) > // nothing we can do. Ah, that gives you heavy spiked LART rights to the head of whomever does it if he is wrong about it. You should fail to load the module or something like that if you are going to run half-broken without rfkill support. I will add the WARN_ON. __must_check will wait for Ivo's reply, as you said, it is often ignored. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh