RE: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-10 Thread David Laight
From: Matthias Kaehlcke > Sent: 06 April 2017 19:57 > Clang raises a warning about the expression 'strlen(CONFIG_XXX)' being > used in a logical operation. Clangs' builtin strlen function resolves the > expression to a constant at compile time, which causes clang to generate > a 'constant-logical-o

Re: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Matthias Kaehlcke
El Fri, Apr 07, 2017 at 12:51:57AM +0200 Johannes Berg ha dit: > On Thu, 2017-04-06 at 15:42 -0700, Matthias Kaehlcke wrote: > > > > Thanks, it would also require to move the initialization of > > ieee80211_default_rc_algo into an ifdef. If you can live with such a > > solution I'm happy to chang

Re: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Johannes Berg
On Thu, 2017-04-06 at 15:42 -0700, Matthias Kaehlcke wrote: > > Thanks, it would also require to move the initialization of > ieee80211_default_rc_algo into an ifdef. If you can live with such a > solution I'm happy to change it. I think that'd be something I can live with, yeah. > > git gre

Re: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Matthias Kaehlcke
El Thu, Apr 06, 2017 at 11:12:25PM +0200 Johannes Berg ha dit: > On Thu, 2017-04-06 at 12:24 -0700, Matthias Kaehlcke wrote: > > > I agree that the code looks worse :( I hoped to find a fix using a > > preprocessor condition but wasn't successful. > > It's actually easy - just remove the 'defaul

Re: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Johannes Berg
On Thu, 2017-04-06 at 12:24 -0700, Matthias Kaehlcke wrote: > I agree that the code looks worse :( I hoped to find a fix using a > preprocessor condition but wasn't successful. It's actually easy - just remove the 'default ""' from Kconfig, and then the symbol won't be defined at all if it doesn'

Re: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Matthias Kaehlcke
Hi Johannes, thanks for your comments El Thu, Apr 06, 2017 at 09:11:18PM +0200 Johannes Berg ha dit: > On Thu, 2017-04-06 at 11:56 -0700, Matthias Kaehlcke wrote: > > Clang raises a warning about the expression 'strlen(CONFIG_XXX)' > > being > > used in a logical operation. Clangs' builtin strle

Re: [PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Johannes Berg
On Thu, 2017-04-06 at 11:56 -0700, Matthias Kaehlcke wrote: > Clang raises a warning about the expression 'strlen(CONFIG_XXX)' > being > used in a logical operation. Clangs' builtin strlen function resolves > the > expression to a constant at compile time, which causes clang to > generate > a 'cons

[PATCH] mac80211: Fix clang warning about constant operand in logical operation

2017-04-06 Thread Matthias Kaehlcke
Clang raises a warning about the expression 'strlen(CONFIG_XXX)' being used in a logical operation. Clangs' builtin strlen function resolves the expression to a constant at compile time, which causes clang to generate a 'constant-logical-operand' warning. Split the if statement in two to avoid usi