public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: davem@davemloft.net (David Miller)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] net: mellanox: add DEVLINK dependencies
Date: Thu, 03 Mar 2016 16:48:34 -0500 (EST)	[thread overview]
Message-ID: <20160303.164834.470402143180960189.davem@davemloft.net> (raw)
In-Reply-To: <1456911665-1424389-1-git-send-email-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Wed,  2 Mar 2016 10:40:54 +0100

> The new NET_DEVLINK infrastructure can be a loadable module, but the drivers
> using it might be built-in, which causes link errors like:
> 
> drivers/net/built-in.o: In function `mlx4_load_one':
> :(.text+0x2fbfda): undefined reference to `devlink_port_register'
> :(.text+0x2fc084): undefined reference to `devlink_port_unregister'
> drivers/net/built-in.o: In function `mlxsw_sx_port_remove':
> :(.text+0x33a03a): undefined reference to `devlink_port_type_clear'
> :(.text+0x33a04e): undefined reference to `devlink_port_unregister'
> 
> There are multiple ways to avoid this:
> 
> a) add 'depends on NET_DEVLINK || !NET_DEVLINK' dependencies
>    for each user
> b) use 'select NET_DEVLINK' from each driver that uses it
>    and hide the symbol in Kconfig.
> c) make NET_DEVLINK a 'bool' option so we don't have to
>    list it as a dependency, and rely on the APIs to be
>    stubbed out when it is disabled
> d) use IS_REACHABLE() rather than IS_ENABLED() to check for
>    NET_DEVLINK in include/net/devlink.h
> 
> This implements a variation of approach a) by adding an
> intermediate symbol that drivers can depend on, and changes
> the three drivers using it.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 09d4d087cd48 ("mlx4: Implement devlink interface")
> Fixes: c4745500e988 ("mlxsw: Implement devlink interface")

Applied, thanks Arnd.

      parent reply	other threads:[~2016-03-03 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02  9:40 [PATCH] net: mellanox: add DEVLINK dependencies Arnd Bergmann
2016-03-02 10:10 ` Jiri Pirko
2016-03-03 21:48 ` David Miller [this message]

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=20160303.164834.470402143180960189.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox