linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/5] net: rfkill: add rfkill_find_type function
Date: Thu, 13 Aug 2015 15:37:48 +0300	[thread overview]
Message-ID: <20150813123748.GB29796@kuha.fi.intel.com> (raw)
In-Reply-To: <1439458066.2114.13.camel@sipsolutions.net>

Hi,

On Thu, Aug 13, 2015 at 11:27:46AM +0200, Johannes Berg wrote:
> On Wed, 2015-08-05 at 16:39 +0300, Heikki Krogerus wrote:
> > 
> > +static const char *rfkill_types[NUM_RFKILL_TYPES] = {
> > +	[RFKILL_TYPE_WLAN]	= "wlan",
> > +	[RFKILL_TYPE_BLUETOOTH]	= "bluetooth",
> > +	[RFKILL_TYPE_UWB]	= "ultrawideband",
> > +	[RFKILL_TYPE_WIMAX]	= "wimax",
> > +	[RFKILL_TYPE_WWAN]	= "wwan",
> > +	[RFKILL_TYPE_GPS]	= "gps",
> > +	[RFKILL_TYPE_FM]	= "fm",
> > +	[RFKILL_TYPE_NFC]	= "nfc",
> > +};
> > +
> > +enum rfkill_type rfkill_find_type(const char *name)
> > +{
> > +	int i;
> > +
> > +	BUILD_BUG_ON(NUM_RFKILL_TYPES != RFKILL_TYPE_NFC + 1);
> > 
> That BUILD_BUG_ON() is now less useful - previously it pointed to the
> code that needed to change, now you're left wondering if you don't look
> up since it isn't quite that obvious from the code what this does.
> 
> Something like
> 
> 	BUILD_BUG_ON(rfkill_types[NUM_RFKILL_TYPES - 1] == NULL);
> 
> would be better. As we only add here, that would be safe enough - I've
> done something similar in the past that a bit more complicated.

OK, I'll change it.

> With that and the static inline fixed (which maybe you could even
> remove) I'm fine with all these rfkill patches, but I'm not sure how to
> merge them since they affect all kinds of other trees. If desired, I
> can apply them, but an ACK from the tegra maintainer would be good :)

Andy and Mika are preparing some changes to the device property
handling. I'll wait for their proposal and prepare next version these
after that.


Thanks,

-- 
heikki

  reply	other threads:[~2015-08-13 12:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 13:39 [PATCH 0/5] net: rfkill: gpio: replace platform data with build-in property Heikki Krogerus
2015-08-05 13:39 ` [PATCH 1/5] device property: helper macros for property entry creation Heikki Krogerus
2015-08-05 14:02   ` Andy Shevchenko
2015-08-05 14:12     ` Shevchenko, Andriy
2015-08-06  7:48     ` Heikki Krogerus
2015-08-07 22:08       ` Rafael J. Wysocki
2015-08-05 13:39 ` [PATCH 2/5] net: rfkill: add rfkill_find_type function Heikki Krogerus
2015-08-05 14:07   ` Andy Shevchenko
2015-08-06  8:30     ` Heikki Krogerus
2015-08-06  9:26       ` Andy Shevchenko
2015-08-06 11:31   ` Sergei Shtylyov
2015-08-13  9:27   ` Johannes Berg
2015-08-13 12:37     ` Heikki Krogerus [this message]
2015-08-05 13:39 ` [PATCH 3/5] net: rfkill: gpio: get the name and type from device property Heikki Krogerus
2015-08-05 13:39 ` [PATCH 4/5] ARM: tegra: use build-in device properties with rfkill_gpio Heikki Krogerus
2015-08-05 13:39 ` [PATCH 5/5] net: rfkill: gpio: remove rfkill_gpio_platform_data Heikki Krogerus
2015-08-05 14:15   ` Andy Shevchenko
2015-08-06  7:22     ` Heikki Krogerus

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=20150813123748.GB29796@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).