2022-06-06 04:37:30

by Vincent MAILHOL

[permalink] [raw]
Subject: Re: [PATCH v4 2/7] can: Kconfig: turn menu "CAN Device Drivers" into a menuconfig using CAN_DEV

On Sat. 4 juin 2022 at 20:27, Marc Kleine-Budde <[email protected]> wrote:
> On 03.06.2022 19:28:43, Vincent Mailhol wrote:
> > In the next patches, the software/virtual drivers (slcan, v(x)can)
> > will depend on drivers/net/can/dev/skb.o.
> >
> > This patch changes the scope of the can-dev module to include the
> > above mentioned drivers.
> >
> > To do so, we reuse the menu "CAN Device Drivers" and turn it into a
> > configmenu using the config symbol CAN_DEV (which we released in
> > previous patch). Also, add a description to this new CAN_DEV
> > menuconfig.
> >
> > The symbol CAN_DEV now only triggers the build of skb.o. For this
> > reasons, all the macros from linux/module.h are deported from
> > drivers/net/can/dev/dev.c to drivers/net/can/dev/skb.c.
> >
> > Finally, drivers/net/can/dev/Makefile is adjusted accordingly.
> >
> > Suggested-by: Oliver Hartkopp <[email protected]>
> > Signed-off-by: Vincent Mailhol <[email protected]>
> > ---
> > drivers/net/can/Kconfig | 29 ++++++++++++++++++++++++++---
> > drivers/net/can/dev/Makefile | 16 +++++++++-------
> > drivers/net/can/dev/dev.c | 9 +--------
> > drivers/net/can/dev/skb.c | 7 +++++++
> > 4 files changed, 43 insertions(+), 18 deletions(-)
> >
>
> > diff --git a/drivers/net/can/dev/Makefile b/drivers/net/can/dev/Makefile
> > index 5b4c813c6222..919f87e36eed 100644
> > --- a/drivers/net/can/dev/Makefile
> > +++ b/drivers/net/can/dev/Makefile
> > @@ -1,9 +1,11 @@
> > # SPDX-License-Identifier: GPL-2.0
> >
> > -obj-$(CONFIG_CAN_NETLINK) += can-dev.o
> > +obj-$(CONFIG_CAN_DEV) += can-dev.o
> ^^^^^^^^^^^^^^^^^^^^^
>
> Nitpick: I think you can directly use "y" here.

I see. So the idea would be that if we deselect CONFIG_CAN_DEV, then
despite of can-dev.o being always "yes", it would be empty and thus
ignored. I just didn't know this trick.

I will do as suggested.


2022-06-06 05:12:10

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH v4 2/7] can: Kconfig: turn menu "CAN Device Drivers" into a menuconfig using CAN_DEV

On 04.06.2022 21:30:57, Vincent MAILHOL wrote:
> > > diff --git a/drivers/net/can/dev/Makefile b/drivers/net/can/dev/Makefile
> > > index 5b4c813c6222..919f87e36eed 100644
> > > --- a/drivers/net/can/dev/Makefile
> > > +++ b/drivers/net/can/dev/Makefile
> > > @@ -1,9 +1,11 @@
> > > # SPDX-License-Identifier: GPL-2.0
> > >
> > > -obj-$(CONFIG_CAN_NETLINK) += can-dev.o
> > > +obj-$(CONFIG_CAN_DEV) += can-dev.o
> > ^^^^^^^^^^^^^^^^^^^^^
> >
> > Nitpick: I think you can directly use "y" here.
>
> I see. So the idea would be that if we deselect CONFIG_CAN_DEV, then
> despite of can-dev.o being always "yes", it would be empty and thus
> ignored.

ACK

Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


Attachments:
(No filename) (960.00 B)
signature.asc (499.00 B)
Download all attachments