Re: [PATCH] media: siano: Use the correct style for SPDX License Identifier

From: Mauro Carvalho Chehab
Date: Wed Sep 04 2019 - 15:00:20 EST


Em Wed, 4 Sep 2019 20:36:08 +0200
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> escreveu:

> On Wed, Sep 04, 2019 at 03:34:32PM -0300, Mauro Carvalho Chehab wrote:
> > Em Sat, 31 Aug 2019 20:41:51 +0530
> > Nishad Kamdar <nishadkamdar@xxxxxxxxx> escreveu:
> >
> > > This patch corrects the SPDX License Identifier style
> > > in header file related to Siano Mobile Silicon Digital TV.
> > > For C header files Documentation/process/license-rules.rst
> > > mandates C-like comments (opposed to C source files where
> > > C++ style should be used)
> > >
> > > Changes made by using a script provided by Joe Perches here:
> > > https://lkml.org/lkml/2019/2/7/46
> > >
> > > Suggested-by: Joe Perches <joe@xxxxxxxxxxx>
> > > Signed-off-by: Nishad Kamdar <nishadkamdar@xxxxxxxxx>
> > > ---
> > > drivers/media/common/siano/smsir.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/media/common/siano/smsir.h b/drivers/media/common/siano/smsir.h
> > > index b2c54c256e86..ada41d5c4e83 100644
> > > --- a/drivers/media/common/siano/smsir.h
> > > +++ b/drivers/media/common/siano/smsir.h
> > > @@ -1,5 +1,5 @@
> > > +/* SPDX-License-Identifier: GPL-2.0+ */
> > > /*
> > > - * SPDX-License-Identifier: GPL-2.0+
> > > *
> > > * Siano Mobile Silicon, Inc.
> > > * MDTV receiver kernel modules.
> >
> > What's wrong with that? The above is a perfectly fine SPDX header.
>
> It is not the first line of the file :(
>

A requirement for having it at the first line is not realistic.
I'd say more: some script that would check for SPDX only at the
first line won't work.

The reason is simple: we have some scripts at the Kernel tree.

Since ever, Unix shells use the first line to interpret what
program will handle it, e. g.:

#! /usr/bin/perl

So, all perl/python scripts should reserve the first line for such
usage.

With Python, you can't even use the second line, as it is reserved
for charset encoding.

So, realistically, the SPDX header could be up to the third line of
a given file.

Besides that, I vaguely remember some discussions we had, back on the
days SPDX was introduced, envolving Thomas, Linus and others. My
understanding for such discussions is that something like this:

/*
* SPDX-License-Identifier: GPL-2.0+
*
* some other notes about the file
*/

Would be acceptable, as the first line of the comment (with is at
the beginning of the file) is the SPDX tag.

Thanks,
Mauro