On Mon, Feb 16, 2009 at 2:02 AM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > On Mon, 2009-02-16 at 01:55 -0800, Luis R. Rodriguez wrote: > >> >> +static inline >> >> +int wiphy_idx(struct wiphy *wiphy) >> >> +{ >> >> + struct cfg80211_registered_device *drv; >> >> + if (!wiphy) >> >> + return WIPHY_IDX_STALE; >> >> + drv = wiphy_to_dev(wiphy); >> >> + return drv->wiphy_idx; >> >> +} >> > >> > I neither like the name of this function (same as the variable name) nor >> > the function -- you're using it in exactly one place where you cannot >> > ever pass NULL afaict. >> >> Nope, I'm calling it from 2 places: >> >> * Driver hints which never have the wiphy NULL >> * __regulatory_hint: called from 11d hints, and from the workqueue >> that processes the pending requests (which can come from userspace or >> from drivers right now). > > Ok, but in the first case you can't have NULL, and in the second you > could just inline it. It's not an operation that requires an inline here > for it. Sure, its just called twice and I think it makes the code more readable to use a routine, what if I just move it to core.c or reg.c. Luis -- 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