W dniu 6 lipca 2011 17:58 użytkownik Michael Büsch <m@xxxxxxx> napisał: > On Wed, 6 Jul 2011 17:52:40 +0200 > Rafał Miłecki <zajec5@xxxxxxxxx> wrote: >> >> +/* BCMA */ >> >> +#ifdef CONFIG_B43_BCMA >> >> +static inline int b43_bus_bcma_bus_may_powerdown(struct b43_bus_dev *dev) >> >> +{ >> >> + return 0; /* bcma_bus_may_powerdown(dev->bdev->bus); */ >> >> +} >> > >> > Why is this inline? >> > You can't inline and take a pointer of the function at the same time. >> > (The compiler will workaround this by generating multiple versions of >> > the function, of which at least one is not inline). >> > So remove it, please. Same below... >> >> I didn't know about any such a limitation. > > This is not a limitation. It's just the way it is. You can't take > a reference to an object, that doesn't exist as an independent object. > > So in this case, if there are no static callers of your function, the > compiler will simply ignore the inline. However, if there were other static > callers (in addition to the indirect callers through pointer), the compiler > would generate (most likely) an inline version for the static callers > and additionally a non-inline version for the indirect callers. > >> Just for sure: did you really mean "pointer of the function"? Cause my >> function is taking pointer of the struct, not pointer of function. > > You are taking the pointer to the function (C adds the & for you, so you only > need the function name) and put it into the bus struct. Ohh, I though you mean getting function pointer as argument of b43_bus_bcma_bus_may_powerdown function. Of course you meant taking pointer in this place: dev->bus_may_powerdown = b43_bus_bcma_bus_may_powerdown; Now I see the problem, thanks. -- Rafał -- 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