Search Linux Wireless

Re: [PATCH 3/3] iwlwifi: add __printf argument checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-05-16 at 23:03 +0200, Johannes Berg wrote:
> On Wed, 2012-05-16 at 13:58 -0700, Joe Perches wrote:
> 
> > > Change-Id: I7a2ffcd3f625ff29c65519b0c3d474bace884f9d
> > > Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> > > Reviewed-on: http://git-mwg.jer.intel.com/gerrit/2022
> > > Tested-by: Jenkins
> > > Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@xxxxxxxxx>
> > 
> > Trivial comments:
> > 
> > Odd Reviewed-on: and Tested-by: lines.
> > The intel.com link does not resolve here too.
> 
> Meh, second time I've messed this up... It's not supposed to, so I guess
> that's good. I'll send a new version of this.
> 
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
> > []
> > > @@ -38,10 +38,10 @@ static inline bool iwl_have_debug_level(u32 level)
> > >  }
> > >  
> > >  void __iwl_err(struct device *dev, bool rfkill_prefix, bool only_trace,
> > > -		const char *fmt, ...);
> > > -void __iwl_warn(struct device *dev, const char *fmt, ...);
> > > -void __iwl_info(struct device *dev, const char *fmt, ...);
> > > -void __iwl_crit(struct device *dev, const char *fmt, ...);
> > > +		const char *fmt, ...) __printf(4, 5);
> > > +void __iwl_warn(struct device *dev, const char *fmt, ...) __printf(2, 3);
> > > +void __iwl_info(struct device *dev, const char *fmt, ...) __printf(2, 3);
> > > +void __iwl_crit(struct device *dev, const char *fmt, ...) __printf(2, 3);
> > 
> > As far as I know, there are very few in-kernel uses of
> > __printf after the function prototype (6 out of 183).
> > 
> > $ git grep -E "\b__printf\s*\(\s*\w+\s*,\s*\w+\s*\)\s*;" | wc -l
> > 6
> > $ git grep -E "\b__printf\s*\(\s*\w+\s*,\s*\w+\s*\)" | wc -l
> > 183
> > 
> > I'd prefer to keep the __printf before the return type.
> 
> Well, maybe now it's 3 more? :-)

Hope not.

You noticed you _have_ to put it before the function
on the static inlines so why not keep it there in all
cases?


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux