All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Arnd Bergmann <arnd@arndb.de>, Jimmy Assarsson <extja@kvaser.com>,
	linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: can: fix build dependency
Date: Fri, 5 Dec 2025 00:30:14 +0100	[thread overview]
Message-ID: <5de9b33e-6129-4765-95a7-e3e12de1f8cd@kernel.org> (raw)
In-Reply-To: <20251204100015.1033688-1-arnd@kernel.org>

Hi Arnd,

Thanks for the fix!

On 04/12/2025 at 11:00, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> A recent bugfix introduced a new problem with Kconfig dependencies:
> 
> WARNING: unmet direct dependencies detected for CAN_DEV
>   Depends on [n]: NETDEVICES [=n] && CAN [=m]
>   Selected by [m]:
>   - CAN [=m] && NET [=y]
> 
> Since the CAN core code now links into the CAN device code, that
> particular function needs to be available, though the rest of it
> does not.
> 
> Revert the incomplete fix and instead use Makefile logic to avoid
> the link failure.
> 
> Fixes: cb2dc6d2869a ("can: Kconfig: select CAN driver infrastructure by default")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/net/can/Kconfig      | 4 ++--
>  drivers/net/can/Makefile     | 2 +-
>  drivers/net/can/dev/Makefile | 5 ++---
>  net/can/Kconfig              | 1 -
>  4 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
> index e15e320db476..bc074218d0ee 100644
> --- a/drivers/net/can/Kconfig
> +++ b/drivers/net/can/Kconfig
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  
>  menuconfig CAN_DEV
> -	tristate "CAN Device Drivers"
> +	bool "CAN Device Drivers"
>  	default y
>  	depends on CAN
>  	help
> @@ -20,7 +20,7 @@ menuconfig CAN_DEV
>  	  To compile as a module, choose M here: the module will be called
                                  ^^^^^^^^
After this change, it is not possible to "choose M" for CAN_DEV anymore. I would
suggest to modify (or remove) the above sentence.

>  	  can-dev.> -if CAN_DEV
> +if CAN_DEV && CAN
              ^^^^^^
Is this needed? CAN_DEV depends on CAN, so the condition

  CAN_DEV && !CAN

should not be reachable.

>  config CAN_VCAN
>  	tristate "Virtual Local CAN Interface (vcan)"
> diff --git a/drivers/net/can/Makefile b/drivers/net/can/Makefile
> index d7bc10a6b8ea..37e2f1a2faec 100644
> --- a/drivers/net/can/Makefile
> +++ b/drivers/net/can/Makefile
> @@ -7,7 +7,7 @@ obj-$(CONFIG_CAN_VCAN)		+= vcan.o
>  obj-$(CONFIG_CAN_VXCAN)		+= vxcan.o
>  obj-$(CONFIG_CAN_SLCAN)		+= slcan/
>  
> -obj-y				+= dev/
> +obj-$(CONFIG_CAN_DEV)		+= dev/
>  obj-y				+= esd/
>  obj-y				+= rcar/
>  obj-y				+= rockchip/
> diff --git a/drivers/net/can/dev/Makefile b/drivers/net/can/dev/Makefile
> index 633687d6b6c0..64226acf0f3d 100644
> --- a/drivers/net/can/dev/Makefile
> +++ b/drivers/net/can/dev/Makefile
> @@ -1,9 +1,8 @@
>  # SPDX-License-Identifier: GPL-2.0
>  
> -obj-$(CONFIG_CAN_DEV) += can-dev.o
> -
> -can-dev-y += skb.o
> +obj-$(CONFIG_CAN) += can-dev.o
>  
> +can-dev-$(CONFIG_CAN_DEV) += skb.o
>  can-dev-$(CONFIG_CAN_CALC_BITTIMING) += calc_bittiming.o
>  can-dev-$(CONFIG_CAN_NETLINK) += bittiming.o
>  can-dev-$(CONFIG_CAN_NETLINK) += dev.o
> diff --git a/net/can/Kconfig b/net/can/Kconfig
> index e4ccf731a24c..af64a6f76458 100644
> --- a/net/can/Kconfig
> +++ b/net/can/Kconfig
> @@ -5,7 +5,6 @@
>  
>  menuconfig CAN
>  	tristate "CAN bus subsystem support"
> -	select CAN_DEV
>  	help
>  	  Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial
>  	  communications protocol. Development of the CAN bus started in


Yours sincerely,
Vincent Mailhol


  parent reply	other threads:[~2025-12-04 23:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-04 10:00 [PATCH] net: can: fix build dependency Arnd Bergmann
2025-12-04 18:03 ` Oliver Hartkopp
2025-12-04 23:30 ` Vincent Mailhol [this message]
2025-12-10  8:16   ` Marc Kleine-Budde
2025-12-10  9:10     ` Arnd Bergmann
2025-12-10  9:38       ` Marc Kleine-Budde
2025-12-10 13:58         ` 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=5de9b33e-6129-4765-95a7-e3e12de1f8cd@kernel.org \
    --to=mailhol@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=extja@kvaser.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    /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.