mbox series

[00/20] MODULE_LICENSE removals, fifth tranche

Message ID 20230228130215.289081-1-nick.alcock@oracle.com (mailing list archive)
Headers show
Series MODULE_LICENSE removals, fifth tranche | expand

Message

Nick Alcock Feb. 28, 2023, 1:01 p.m. UTC
This series, based on current modules-next, is part of a treewide cleanup
suggested by Luis Chamberlain, to remove the LICENSE_MODULE usage from
files/objects that are not tristate.  Due to recent changes to kbuild, these
uses are now problematic.  See the commit logs for more details.

(The commit log prefixes and Cc lists are automatically determined.  I've
eyeballed them, and they seem reasonable: my apologies if they are not.)

I'll be sending a sixth and final tranche in a few days. (In total, there are 121
patches in this series.)


The series at a whole can be found here:
  https://github.com/nickalcock/linux module-license

(This is a respin with kbuild: prefixes dropped.  The previous series,
used in the mailouts of tranche 3 and earlier, is in the
module-license-kbuild-prefix branch.)

Cc: linux-clk@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-gpio@vger.kernel.org 
Cc: linux-kernel@vger.kernel.org
Cc: linux-modules@vger.kernel.org
Cc: linux-perf-users@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-remoteproc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-serial@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Cc: linux-trace-kernel@vger.kernel.org

Nick Alcock (20):
  perf/hw_breakpoint: remove MODULE_LICENSE in non-modules
  pinctrl: amd: remove MODULE_LICENSE in non-modules
  pinctrl: mediatek: remove MODULE_LICENSE in non-modules
  pinctrl: renesas: remove MODULE_LICENSE in non-modules
  lib: remove MODULE_LICENSE in non-modules
  powercap: remove MODULE_LICENSE in non-modules
  power: supply: remove MODULE_LICENSE in non-modules
  remoteproc: remove MODULE_LICENSE in non-modules
  clk: renesas: remove MODULE_LICENSE in non-modules
  reset: mchp: sparx5: remove MODULE_LICENSE in non-modules
  reset: lantiq: remove MODULE_LICENSE in non-modules
  clk: microchip: mpfs: remove MODULE_LICENSE in non-modules
  reset: remove MODULE_LICENSE in non-modules
  rv/reactor: remove MODULE_LICENSE in non-modules
  tty: serial: imx: remove MODULE_LICENSE in non-modules
  irqchip/irq-sl28cpld: remove MODULE_LICENSE in non-modules
  ARC: reset: remove MODULE_LICENSE in non-modules
  ARC: reset: remove MODULE_LICENSE in non-modules
  power: reset: remove MODULE_LICENSE in non-modules
  soc/tegra: cbb: remove MODULE_LICENSE in non-modules

 drivers/clk/microchip/clk-mpfs.c          | 1 -
 drivers/clk/renesas/rcar-usb2-clock-sel.c | 1 -
 drivers/clk/renesas/renesas-cpg-mssr.c    | 1 -
 drivers/clk/renesas/rzg2l-cpg.c           | 1 -
 drivers/irqchip/irq-sl28cpld.c            | 1 -
 drivers/pinctrl/mediatek/pinctrl-mt8188.c | 1 -
 drivers/pinctrl/mediatek/pinctrl-mt8192.c | 1 -
 drivers/pinctrl/mediatek/pinctrl-mt8365.c | 1 -
 drivers/pinctrl/pinctrl-amd.c             | 1 -
 drivers/pinctrl/renesas/pinctrl-rza1.c    | 1 -
 drivers/pinctrl/renesas/pinctrl-rza2.c    | 1 -
 drivers/pinctrl/renesas/pinctrl-rzg2l.c   | 1 -
 drivers/pinctrl/renesas/pinctrl-rzn1.c    | 1 -
 drivers/pinctrl/renesas/pinctrl-rzv2m.c   | 1 -
 drivers/power/reset/as3722-poweroff.c     | 1 -
 drivers/power/reset/gpio-poweroff.c       | 1 -
 drivers/power/reset/gpio-restart.c        | 1 -
 drivers/power/reset/ltc2952-poweroff.c    | 1 -
 drivers/power/reset/regulator-poweroff.c  | 1 -
 drivers/power/reset/restart-poweroff.c    | 1 -
 drivers/power/reset/tps65086-restart.c    | 1 -
 drivers/power/supply/power_supply_core.c  | 1 -
 drivers/power/supply/wm97xx_battery.c     | 1 -
 drivers/powercap/powercap_sys.c           | 1 -
 drivers/remoteproc/remoteproc_core.c      | 1 -
 drivers/reset/reset-axs10x.c              | 1 -
 drivers/reset/reset-hsdk.c                | 1 -
 drivers/reset/reset-lantiq.c              | 1 -
 drivers/reset/reset-microchip-sparx5.c    | 1 -
 drivers/reset/reset-mpfs.c                | 1 -
 drivers/soc/tegra/cbb/tegra194-cbb.c      | 1 -
 drivers/soc/tegra/cbb/tegra234-cbb.c      | 1 -
 drivers/tty/serial/imx_earlycon.c         | 1 -
 kernel/events/hw_breakpoint_test.c        | 1 -
 kernel/trace/rv/reactor_panic.c           | 1 -
 kernel/trace/rv/reactor_printk.c          | 1 -
 lib/pldmfw/pldmfw.c                       | 1 -
 37 files changed, 37 deletions(-)

Comments

Daniel Bristot de Oliveira Feb. 28, 2023, 1:19 p.m. UTC | #1
On 2/28/23 10:02, Nick Alcock wrote:
> Since commit 8b41fc4454e ("kbuild: create modules.builtin without
> Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations
> are used to identify modules. As a consequence, uses of the macro
> in non-modules will cause modprobe to misidentify their containing
> object file as a module when it is not (false positives), and modprobe
> might succeed rather than failing with a suitable error message.
> 
> So remove it in the files in this commit, none of which can be built as
> modules.
> 
> Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
> Suggested-by: Luis Chamberlain <mcgrof@kernel.org>

Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>

-- Daniel
Geert Uytterhoeven Feb. 28, 2023, 1:45 p.m. UTC | #2
Hi Nick,

On Tue, Feb 28, 2023 at 2:03 PM Nick Alcock <nick.alcock@oracle.com> wrote:
> Since commit 8b41fc4454e ("kbuild: create modules.builtin without
> Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations
> are used to identify modules. As a consequence, uses of the macro
> in non-modules will cause modprobe to misidentify their containing
> object file as a module when it is not (false positives), and modprobe
> might succeed rather than failing with a suitable error message.
>
> So remove it in the files in this commit, none of which can be built as
> modules.
>
> Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
> Suggested-by: Luis Chamberlain <mcgrof@kernel.org>

Thanks for your patch!

>  drivers/clk/renesas/rcar-usb2-clock-sel.c | 1 -

I think it would make sense to make CLK_RCAR_USB2_CLOCK_SEL
tristate. Shimoda-san?
The Beacon Renesom seems to be the only board where this
is wired up, Adam?

>  drivers/clk/renesas/renesas-cpg-mssr.c    | 1 -
>  drivers/clk/renesas/rzg2l-cpg.c           | 1 -
>  3 files changed, 3 deletions(-)
>
> diff --git a/drivers/clk/renesas/rcar-usb2-clock-sel.c b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> index 684d8937965e0..ba6b5bd67786f 100644
> --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c
> +++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> @@ -220,4 +220,3 @@ static struct platform_driver rcar_usb2_clock_sel_driver = {
>  builtin_platform_driver(rcar_usb2_clock_sel_driver);
>
>  MODULE_DESCRIPTION("Renesas R-Car USB2 clock selector Driver");
> -MODULE_LICENSE("GPL v2");
> diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
> index 1a0cdf001b2f2..bfe5dc9a2e36b 100644
> --- a/drivers/clk/renesas/renesas-cpg-mssr.c
> +++ b/drivers/clk/renesas/renesas-cpg-mssr.c
> @@ -1154,4 +1154,3 @@ void __init mssr_mod_reparent(struct mssr_mod_clk *mod_clks,
>  }
>
>  MODULE_DESCRIPTION("Renesas CPG/MSSR Driver");
> -MODULE_LICENSE("GPL v2");
> diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
> index 4bf40f6ccd1d1..93b02cdc98c25 100644
> --- a/drivers/clk/renesas/rzg2l-cpg.c
> +++ b/drivers/clk/renesas/rzg2l-cpg.c
> @@ -1440,4 +1440,3 @@ static int __init rzg2l_cpg_init(void)
>  subsys_initcall(rzg2l_cpg_init);
>
>  MODULE_DESCRIPTION("Renesas RZ/G2L CPG Driver");
> -MODULE_LICENSE("GPL v2");
> --
> 2.39.1.268.g9de2f9a303

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Feb. 28, 2023, 1:47 p.m. UTC | #3
Hi Nick,

On Tue, Feb 28, 2023 at 2:05 PM Nick Alcock <nick.alcock@oracle.com> wrote:
> This series, based on current modules-next, is part of a treewide cleanup
> suggested by Luis Chamberlain, to remove the LICENSE_MODULE usage from
> files/objects that are not tristate.  Due to recent changes to kbuild, these
> uses are now problematic.  See the commit logs for more details.

Does this mean you expect us to queue them for v6.3?
Thanks!

Gr{oetje,eeting}s,

                        Geert
Adam Ford Feb. 28, 2023, 2:07 p.m. UTC | #4
On Tue, Feb 28, 2023 at 7:46 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Nick,
>
> On Tue, Feb 28, 2023 at 2:03 PM Nick Alcock <nick.alcock@oracle.com> wrote:
> > Since commit 8b41fc4454e ("kbuild: create modules.builtin without
> > Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations
> > are used to identify modules. As a consequence, uses of the macro
> > in non-modules will cause modprobe to misidentify their containing
> > object file as a module when it is not (false positives), and modprobe
> > might succeed rather than failing with a suitable error message.
> >
> > So remove it in the files in this commit, none of which can be built as
> > modules.
> >
> > Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
> > Suggested-by: Luis Chamberlain <mcgrof@kernel.org>
>
> Thanks for your patch!
>
> >  drivers/clk/renesas/rcar-usb2-clock-sel.c | 1 -
>
> I think it would make sense to make CLK_RCAR_USB2_CLOCK_SEL
> tristate. Shimoda-san?
> The Beacon Renesom seems to be the only board where this
> is wired up, Adam?

The CLK_RCAR_USB2_CLOCK_SEL is basically glue that lets the user
select between an external oscillator or a crystal oscillator.  The
Beacon board uses an external clock instead of a crystal, so this
driver is plumbed in to make sure the external clock is enabled on
demand and the SoC isn't trying to excite the crystal.

The CLK_RCAR_USB2_CLOCK_SEL is currently set to 'y' in the defconfig,
but it looks like the USB_RENESAS_USB3 and USB_RENESAS_USBHS drivers
are all modules.  I am not an expert in this area, but it seems to me
like the CLK_RCAR_USB2_CLOCK_SEL could likely be tri-state as well.  I
am not sure how the dependency and/or loading order would be
established.

adam

>
> >  drivers/clk/renesas/renesas-cpg-mssr.c    | 1 -
> >  drivers/clk/renesas/rzg2l-cpg.c           | 1 -
> >  3 files changed, 3 deletions(-)
> >
> > diff --git a/drivers/clk/renesas/rcar-usb2-clock-sel.c b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> > index 684d8937965e0..ba6b5bd67786f 100644
> > --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c
> > +++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c
> > @@ -220,4 +220,3 @@ static struct platform_driver rcar_usb2_clock_sel_driver = {
> >  builtin_platform_driver(rcar_usb2_clock_sel_driver);
> >
> >  MODULE_DESCRIPTION("Renesas R-Car USB2 clock selector Driver");
> > -MODULE_LICENSE("GPL v2");
> > diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
> > index 1a0cdf001b2f2..bfe5dc9a2e36b 100644
> > --- a/drivers/clk/renesas/renesas-cpg-mssr.c
> > +++ b/drivers/clk/renesas/renesas-cpg-mssr.c
> > @@ -1154,4 +1154,3 @@ void __init mssr_mod_reparent(struct mssr_mod_clk *mod_clks,
> >  }
> >
> >  MODULE_DESCRIPTION("Renesas CPG/MSSR Driver");
> > -MODULE_LICENSE("GPL v2");
> > diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
> > index 4bf40f6ccd1d1..93b02cdc98c25 100644
> > --- a/drivers/clk/renesas/rzg2l-cpg.c
> > +++ b/drivers/clk/renesas/rzg2l-cpg.c
> > @@ -1440,4 +1440,3 @@ static int __init rzg2l_cpg_init(void)
> >  subsys_initcall(rzg2l_cpg_init);
> >
> >  MODULE_DESCRIPTION("Renesas RZ/G2L CPG Driver");
> > -MODULE_LICENSE("GPL v2");
> > --
> > 2.39.1.268.g9de2f9a303
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
Greg KH March 9, 2023, 4:14 p.m. UTC | #5
On Tue, Feb 28, 2023 at 01:01:55PM +0000, Nick Alcock wrote:
> This series, based on current modules-next, is part of a treewide cleanup
> suggested by Luis Chamberlain, to remove the LICENSE_MODULE usage from
> files/objects that are not tristate.  Due to recent changes to kbuild, these
> uses are now problematic.  See the commit logs for more details.

Why isn't kbuild fixed instead?  These files can have MODULE_AUTHOR()
and other macros when built into the kernel, what is so special about
MODULE_LICENSE() that prevents this from working properly?

There should not be a need to remove these markings in my opinion, why
treat one MODULE_* macro more special than others?

thanks,

greg k-h
Nick Alcock March 20, 2023, 11:06 a.m. UTC | #6
On 28 Feb 2023, Geert Uytterhoeven outgrape:

> On Tue, Feb 28, 2023 at 2:05 PM Nick Alcock <nick.alcock@oracle.com> wrote:
>> This series, based on current modules-next, is part of a treewide cleanup
>> suggested by Luis Chamberlain, to remove the LICENSE_MODULE usage from
>> files/objects that are not tristate.  Due to recent changes to kbuild, these
>> uses are now problematic.  See the commit logs for more details.
>
> Does this mean you expect us to queue them for v6.3?
> Thanks!

I believe Luis is planning to pull them in around -rc3, hence my
freshening the series up now, getting everyone's tags in, etc.
Nick Alcock March 20, 2023, 11:08 a.m. UTC | #7
On 28 Feb 2023, Geert Uytterhoeven outgrape:

> Hi Nick,
>
> On Tue, Feb 28, 2023 at 2:03 PM Nick Alcock <nick.alcock@oracle.com> wrote:
>> Since commit 8b41fc4454e ("kbuild: create modules.builtin without
>> Makefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarations
>> are used to identify modules. As a consequence, uses of the macro
>> in non-modules will cause modprobe to misidentify their containing
>> object file as a module when it is not (false positives), and modprobe
>> might succeed rather than failing with a suitable error message.
>>
>> So remove it in the files in this commit, none of which can be built as
>> modules.
>>
>> Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
>> Suggested-by: Luis Chamberlain <mcgrof@kernel.org>
>
> Thanks for your patch!
>
>>  drivers/clk/renesas/rcar-usb2-clock-sel.c | 1 -
>
> I think it would make sense to make CLK_RCAR_USB2_CLOCK_SEL
> tristate. Shimoda-san?

This patch touches three files, so I hope that means the MODULE_LICENSE
removal from drivers/clk/renesas/renesas-cpg-mssr.c and
drivers/clk/renesas/rzg2l-cpg.c is OK :)