linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Remove compile warnings
@ 2012-04-25 12:45 Andrei Emeltchenko
  2012-05-03 19:00 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-04-25 12:45 UTC (permalink / raw)
  To: linux-wireless

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Use default key to handle similar iface types. This removes compile warnings:

net/wireless/util.c: In function ‘cfg80211_change_iface’:
net/wireless/util.c:846:3: warning: enumeration value ‘NL80211_IFTYPE_MAX’
	not handled in switch [-Wswitch]

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 net/wireless/util.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 1b7a08d..468dc8b 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -862,8 +862,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
 		case NL80211_IFTYPE_MONITOR:
 			/* monitor can't bridge anyway */
 			break;
-		case NL80211_IFTYPE_UNSPECIFIED:
-		case NUM_NL80211_IFTYPES:
+		default:
 			/* not happening */
 			break;
 		}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] cfg80211: Remove compile warnings
  2012-04-25 12:45 [PATCH] cfg80211: Remove compile warnings Andrei Emeltchenko
@ 2012-05-03 19:00 ` Johannes Berg
  2012-05-04  8:44   ` Andrei Emeltchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2012-05-03 19:00 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-wireless

On Wed, 2012-04-25 at 15:45 +0300, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> Use default key to handle similar iface types. This removes compile warnings:
> 
> net/wireless/util.c: In function ‘cfg80211_change_iface’:
> net/wireless/util.c:846:3: warning: enumeration value ‘NL80211_IFTYPE_MAX’
> 	not handled in switch [-Wswitch]
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/wireless/util.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 1b7a08d..468dc8b 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -862,8 +862,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
>  		case NL80211_IFTYPE_MONITOR:
>  			/* monitor can't bridge anyway */
>  			break;
> -		case NL80211_IFTYPE_UNSPECIFIED:
> -		case NUM_NL80211_IFTYPES:
> +		default:

When did this warning start occurring? I was pretty sure it didn't use
to? I think we should explicitly list the cases here though because we
want the compiler to warn here when we add something to the interface
type list so we catch this place that may have to be modified.

johannes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] cfg80211: Remove compile warnings
  2012-05-03 19:00 ` Johannes Berg
@ 2012-05-04  8:44   ` Andrei Emeltchenko
  2012-05-07  9:30     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-05-04  8:44 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Hi Johannes,

On Thu, May 3, 2012 at 10:00 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Wed, 2012-04-25 at 15:45 +0300, Andrei Emeltchenko wrote:
>> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>>
>> Use default key to handle similar iface types. This removes compile warnings:
>>
>> net/wireless/util.c: In function ‘cfg80211_change_iface’:
>> net/wireless/util.c:846:3: warning: enumeration value ‘NL80211_IFTYPE_MAX’
>>       not handled in switch [-Wswitch]
>>
>> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>> ---
>>  net/wireless/util.c |    3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/net/wireless/util.c b/net/wireless/util.c
>> index 1b7a08d..468dc8b 100644
>> --- a/net/wireless/util.c
>> +++ b/net/wireless/util.c
>> @@ -862,8 +862,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
>>               case NL80211_IFTYPE_MONITOR:
>>                       /* monitor can't bridge anyway */
>>                       break;
>> -             case NL80211_IFTYPE_UNSPECIFIED:
>> -             case NUM_NL80211_IFTYPES:
>> +             default:
>
> When did this warning start occurring? I was pretty sure it didn't use
> to? I think we should explicitly list the cases here though because we
> want the compiler to warn here when we add something to the interface
> type list so we catch this place that may have to be modified.

I think warning occurs when I added new interface type since it is
also not handled.

Regards,
Andrei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] cfg80211: Remove compile warnings
  2012-05-04  8:44   ` Andrei Emeltchenko
@ 2012-05-07  9:30     ` Johannes Berg
  2012-05-09  1:48       ` John W. Linville
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2012-05-07  9:30 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-wireless, John Linville

On Fri, 2012-05-04 at 11:44 +0300, Andrei Emeltchenko wrote:

> >> -             case NL80211_IFTYPE_UNSPECIFIED:
> >> -             case NUM_NL80211_IFTYPES:
> >> +             default:
> >
> > When did this warning start occurring? I was pretty sure it didn't use
> > to? I think we should explicitly list the cases here though because we
> > want the compiler to warn here when we add something to the interface
> > type list so we catch this place that may have to be modified.
> 
> I think warning occurs when I added new interface type since it is
> also not handled.

Well, but in that case the warning is supposed to happen to tell you
that you need to think about that code for your new interface type.

John, please revert this patch.

johannes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] cfg80211: Remove compile warnings
  2012-05-07  9:30     ` Johannes Berg
@ 2012-05-09  1:48       ` John W. Linville
  0 siblings, 0 replies; 5+ messages in thread
From: John W. Linville @ 2012-05-09  1:48 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Andrei Emeltchenko, linux-wireless

On Mon, May 07, 2012 at 11:30:24AM +0200, Johannes Berg wrote:
> On Fri, 2012-05-04 at 11:44 +0300, Andrei Emeltchenko wrote:
> 
> > >> -             case NL80211_IFTYPE_UNSPECIFIED:
> > >> -             case NUM_NL80211_IFTYPES:
> > >> +             default:
> > >
> > > When did this warning start occurring? I was pretty sure it didn't use
> > > to? I think we should explicitly list the cases here though because we
> > > want the compiler to warn here when we add something to the interface
> > > type list so we catch this place that may have to be modified.
> > 
> > I think warning occurs when I added new interface type since it is
> > also not handled.
> 
> Well, but in that case the warning is supposed to happen to tell you
> that you need to think about that code for your new interface type.
> 
> John, please revert this patch.

I'm having to do some rebasing to handle the bluetooth kerfuffle.
I'll simply drop this patch.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-09  2:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-25 12:45 [PATCH] cfg80211: Remove compile warnings Andrei Emeltchenko
2012-05-03 19:00 ` Johannes Berg
2012-05-04  8:44   ` Andrei Emeltchenko
2012-05-07  9:30     ` Johannes Berg
2012-05-09  1:48       ` John W. Linville

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).