From: Lukas Wunner <lukas@wunner.de>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Marek Vasut <marex@denx.de>, Networking <netdev@vger.kernel.org>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net-next V2] net: ks8851: Fix mixed module/builtin build
Date: Sat, 16 Jan 2021 21:39:45 +0100 [thread overview]
Message-ID: <20210116203945.GA32445@wunner.de> (raw)
In-Reply-To: <CAK8P3a3qtrmxMg+uva-s18f_zj7aNXJXcJCzorr2d-XxnqV1Hw@mail.gmail.com>
On Sat, Jan 16, 2021 at 08:26:22PM +0100, Arnd Bergmann wrote:
> On Sat, Jan 16, 2021 at 6:56 PM Marek Vasut <marex@denx.de> wrote:
> > On 1/16/21 6:04 PM, Arnd Bergmann wrote:
> > > On Sat, Jan 16, 2021 at 5:48 PM Marek Vasut <marex@denx.de> wrote:
> >
> > > I don't really like this version, as it does not actually solve the problem of
> > > linking the same object file into both vmlinux and a loadable module, which
> > > can have all kinds of side-effects besides that link failure you saw.
> > >
> > > If you want to avoid exporting all those symbols, a simpler hack would
> > > be to '#include "ks8851_common.c" from each of the two files, which
> > > then always duplicates the contents (even when both are built-in), but
> > > at least builds the file the correct way.
> >
> > That's the same as V1, isn't it ?
>
> Ah, I had not actually looked at the original submission, but yes, that
> was slightly better than v2, provided you make all symbols static to
> avoid the new link error.
>
> I still think that having three modules and exporting the symbols from
> the common part as Heiner Kallweit suggested would be the best
> way to do it.
FWIW I'd prefer V1 (the #include approach) as it allows going back to
using static inlines for register access. That's what we had before
7a552c850c45.
It seems unlikely that a system uses both, the parallel *and* the SPI
variant of the ks8851. So the additional memory necessary because of
code duplication wouldn't matter in practice.
Thanks,
Lukas
next prev parent reply other threads:[~2021-01-16 20:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-16 16:48 [PATCH net-next V2] net: ks8851: Fix mixed module/builtin build Marek Vasut
2021-01-16 17:04 ` Arnd Bergmann
2021-01-16 17:54 ` Marek Vasut
2021-01-16 19:26 ` Arnd Bergmann
2021-01-16 20:39 ` Lukas Wunner [this message]
2021-01-16 21:25 ` Marek Vasut
2021-01-16 21:41 ` Heiner Kallweit
2021-01-17 10:21 ` Arnd Bergmann
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=20210116203945.GA32445@wunner.de \
--to=lukas@wunner.de \
--cc=andrew@lunn.ch \
--cc=arnd@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.