diff mbox series

[05/17] drivers: bus: simple-pm-bus: remove MODULE_LICENSE in non-modules

Message ID 20230302211759.30135-6-nick.alcock@oracle.com (mailing list archive)
State New, archived
Headers show
Series MODULE_LICENSE removals, sixth tranche | expand

Commit Message

Nick Alcock March 2, 2023, 9:17 p.m. UTC
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>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: linux-modules@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>
---
 drivers/bus/simple-pm-bus.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Geert Uytterhoeven March 3, 2023, 7:52 a.m. UTC | #1
Hi Nick,

On Thu, Mar 2, 2023 at 11:25 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!

> --- a/drivers/bus/simple-pm-bus.c
> +++ b/drivers/bus/simple-pm-bus.c
> @@ -92,4 +92,3 @@ module_platform_driver(simple_pm_bus_driver);
>
>  MODULE_DESCRIPTION("Simple Power-Managed Bus Driver");
>  MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
> -MODULE_LICENSE("GPL v2");

Please do not remove this line as long as the file has no SPDX-License
tag.

Gr{oetje,eeting}s,

                        Geert
Nick Alcock March 3, 2023, 6:32 p.m. UTC | #2
On 3 Mar 2023, Geert Uytterhoeven told this:

> On Thu, Mar 2, 2023 at 11:25 PM Nick Alcock <nick.alcock@oracle.com> wrote:
>> --- a/drivers/bus/simple-pm-bus.c
>> +++ b/drivers/bus/simple-pm-bus.c
>> @@ -92,4 +92,3 @@ module_platform_driver(simple_pm_bus_driver);
>>
>>  MODULE_DESCRIPTION("Simple Power-Managed Bus Driver");
>>  MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
>> -MODULE_LICENSE("GPL v2");
>
> Please do not remove this line as long as the file has no SPDX-License
> tag.

I'll augment this patch with an SPDX addition, if you think that's OK,
which it sounds like you do. (MODULE_LICENSE has side effects these days
which a SPDX header does not, and those side effects are wrong for
things that cannot be modules.)
Geert Uytterhoeven March 3, 2023, 6:43 p.m. UTC | #3
Hi Nick,

On Fri, Mar 3, 2023 at 7:32 PM Nick Alcock <nick.alcock@oracle.com> wrote:
> On 3 Mar 2023, Geert Uytterhoeven told this:
> > On Thu, Mar 2, 2023 at 11:25 PM Nick Alcock <nick.alcock@oracle.com> wrote:
> >> --- a/drivers/bus/simple-pm-bus.c
> >> +++ b/drivers/bus/simple-pm-bus.c
> >> @@ -92,4 +92,3 @@ module_platform_driver(simple_pm_bus_driver);
> >>
> >>  MODULE_DESCRIPTION("Simple Power-Managed Bus Driver");
> >>  MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
> >> -MODULE_LICENSE("GPL v2");
> >
> > Please do not remove this line as long as the file has no SPDX-License
> > tag.
>
> I'll augment this patch with an SPDX addition, if you think that's OK,
> which it sounds like you do. (MODULE_LICENSE has side effects these days
> which a SPDX header does not, and those side effects are wrong for
> things that cannot be modules.)

Yeah, simple-pm-bus should not be a module.

Gr{oetje,eeting}s,

                        Geert
Nick Alcock March 20, 2023, 10:58 a.m. UTC | #4
On 3 Mar 2023, Geert Uytterhoeven told this:

>> --- a/drivers/bus/simple-pm-bus.c
>> +++ b/drivers/bus/simple-pm-bus.c
>> @@ -92,4 +92,3 @@ module_platform_driver(simple_pm_bus_driver);
>>
>>  MODULE_DESCRIPTION("Simple Power-Managed Bus Driver");
>>  MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
>> -MODULE_LICENSE("GPL v2");
>
> Please do not remove this line as long as the file has no SPDX-License
> tag.

OK, in the next (final?) round this patch will have what I think is the
right SPDX:

diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
index 7afe1947e1c08..4da77ca7b75aa 100644
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Simple Power-Managed Bus Driver
  *
@@ -138,4 +139,3 @@ module_platform_driver(simple_pm_bus_driver);
 
 MODULE_DESCRIPTION("Simple Power-Managed Bus Driver");
 MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
-MODULE_LICENSE("GPL v2");
diff mbox series

Patch

diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
index 6b8d6257ed8a4..32e6e960f1676 100644
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -92,4 +92,3 @@  module_platform_driver(simple_pm_bus_driver);
 
 MODULE_DESCRIPTION("Simple Power-Managed Bus Driver");
 MODULE_AUTHOR("Geert Uytterhoeven <geert+renesas@glider.be>");
-MODULE_LICENSE("GPL v2");