From: "Michael Büsch" <m@bues.ch>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
b43-dev@lists.infradead.org
Subject: Re: [PATCH 2/2] b43: implement BCMA bus ops
Date: Wed, 6 Jul 2011 17:58:10 +0200 [thread overview]
Message-ID: <20110706175810.76749948@maggie> (raw)
In-Reply-To: <CACna6ryHRNLNPrPam2dAWLysqtFLtE8bcu4A26A4xFj2ui2eNg@mail.gmail.com>
On Wed, 6 Jul 2011 17:52:40 +0200
Rafał Miłecki <zajec5@gmail.com> 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.
next prev parent reply other threads:[~2011-07-06 15:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 21:54 [PATCH 1/2] b43: make b43_wireless_init bus generic Rafał Miłecki
2011-07-05 21:54 ` [PATCH 2/2] b43: implement BCMA bus ops Rafał Miłecki
2011-07-06 15:40 ` Michael Büsch
2011-07-06 15:52 ` Rafał Miłecki
2011-07-06 15:58 ` Michael Büsch [this message]
2011-07-06 16:02 ` Rafał Miłecki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110706175810.76749948@maggie \
--to=m@bues.ch \
--cc=b43-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).