lkml.org 
[lkml]   [2010]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] staging/wlags49_hs: Fix build error when CONFIG_SYSFS is not set
From
Date
On Fri, 2010-06-11 at 08:46 -0400, Javier Martinez Canillas wrote:
> >> extern void register_wlags_sysfs(struct net_device *);
> >> extern void unregister_wlags_sysfs(struct net_device *);
> >> #else
> >> -static void register_wlags_sysfs(struct net_device *) { return; };
> >> -static void unregister_wlags_sysfs(struct net_device *) { return; };
> >> +#define register_wlags_sysfs(net_device) { }
> >> +#define unregister_wlags_sysfs(net_device) { }
> >> #endif
> > Yes, that works, but a better fix would be to remove the
> > semicolons after the function close braces.
> > ---
> Why would it be better? With a macro you avoid the overhead of a
> function call that does nothing.

Check the generated code.
$ make drivers/staging/wlags49_h2/wl_sysfs.lst

> I personally think a macro fit better in this case.

Check the general kernel use of macros vs functions.
Functions verify proper arguments, macros do not.




\
 
 \ /
  Last update: 2010-06-11 18:55    [W:0.055 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site