Skip to contentSkip to conversation

staging: vt6656: Use the correct style for SPDX license Identifier

PATCH Superseded Nishad Kamdar 3 participants 7 messages Feb 5, 2019 – Feb 13, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6656: Use the correct style for SPDX license Identifier

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +2 -2
index 94e700fcd0b6..75166020f7c6 100644
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+
+ *
  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  * All rights reserved.
  *
Signature · 1 line
2.17.1
#1 lore raw
Quoted 14 lines · Nishad Kamdar

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +0 -0
index 94e700fcd0b6..75166020f7c6 100644

drivers/staging/vt6656/mac.h line 1

Quoted 3 lines
drivers/staging/vt6656/mac.h +1 -2
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+

Should really be:

/* SPDX-License-Identifier: GPL-2.0+ */

thanks,

greg k-h

#2 lore raw
Quoted 21 lines · Greg Kroah-Hartman
Quoted 14 lines · Nishad Kamdar

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +0 -0
index 94e700fcd0b6..75166020f7c6 100644

drivers/staging/vt6656/mac.h line 1

Quoted 3 lines
drivers/staging/vt6656/mac.h +1 -2
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+

Should really be:

Quoted 1 line

/* SPDX-License-Identifier: GPL-2.0+ */

There's a fair number of style inconsistencies in the kernel sources for that already.

~8% of the .h files that have an 'SPDX-License-Identifier:' don't use the recommended style.

$ git grep -h "SPDX-License" -- '*.h' | \
  perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: [^\.].*@Identifier:@' | \
  sort | uniq -c | sort -rn
   8506 /* SPDX-License-Identifier: ... */
    593 // SPDX-License-Identifier:
    154 /* SPDX-License-Identifier:
     53  * SPDX-License-Identifier:
      1  * SPDX-License-Identifier:	GPL-2.0
      1 //SPDX-License-Identifier:
      1 /*  SPDX-License-Identifier: ... */
#3 lore raw
Quoted 30 lines · Joe Perches
Quoted 21 lines · Greg Kroah-Hartman
Quoted 14 lines · Nishad Kamdar

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +0 -0
index 94e700fcd0b6..75166020f7c6 100644

drivers/staging/vt6656/mac.h line 1

Quoted 3 lines
drivers/staging/vt6656/mac.h +1 -2
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+

Should really be:

Quoted 1 line

/* SPDX-License-Identifier: GPL-2.0+ */

There's a fair number of style inconsistencies in the kernel sources for that already.

~8% of the .h files that have an 'SPDX-License-Identifier:' don't use the recommended style.

Quoted 10 lines
$ git grep -h "SPDX-License" -- '*.h' | \
  perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: [^\.].*@Identifier:@' | \
  sort | uniq -c | sort -rn
   8506 /* SPDX-License-Identifier: ... */
    593 // SPDX-License-Identifier:
    154 /* SPDX-License-Identifier:
     53  * SPDX-License-Identifier:
      1  * SPDX-License-Identifier:	GPL-2.0
      1 //SPDX-License-Identifier:
      1 /*  SPDX-License-Identifier: ... */

Then let's fix them, the documentation says what the correct format is, there's no reason we can't actually follow what is written...

#4 lore raw
Quoted 42 lines · Greg Kroah-Hartman
Quoted 30 lines · Joe Perches
Quoted 21 lines · Greg Kroah-Hartman
Quoted 14 lines · Nishad Kamdar

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +0 -0
index 94e700fcd0b6..75166020f7c6 100644

drivers/staging/vt6656/mac.h line 1

Quoted 3 lines
drivers/staging/vt6656/mac.h +1 -2
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+

Should really be:

Quoted 1 line

/* SPDX-License-Identifier: GPL-2.0+ */

There's a fair number of style inconsistencies in the kernel sources for that already.

~8% of the .h files that have an 'SPDX-License-Identifier:' don't use the recommended style.

Quoted 10 lines
$ git grep -h "SPDX-License" -- '*.h' | \
  perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: [^\.].*@Identifier:@' | \
  sort | uniq -c | sort -rn
   8506 /* SPDX-License-Identifier: ... */
    593 // SPDX-License-Identifier:
    154 /* SPDX-License-Identifier:
     53  * SPDX-License-Identifier:
      1  * SPDX-License-Identifier:	GPL-2.0
      1 //SPDX-License-Identifier:
      1 /*  SPDX-License-Identifier: ... */
Quoted 2 lines

Then let's fix them, the documentation says what the correct format is, there's no reason we can't actually follow what is written...

So here's a script that does most all of them except the 50 or so that use the SPDX-License-Identifier in the middle of a comment block.

Using:

$ git grep --name-only 'SPDX-License-Identifier:' -- '*.h' | \
  xargs grep -L '/\* SPDX-License-Identifier:.*\*/'| \
  while read file ; do perl -i update_spdx.perl $file ; done

produces

$ git diff --shortstat
 748 files changed, 902 insertions(+), 902 deletions(-)

And

$ git grep -h "SPDX-License" -- '*.h' | \
  perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: [^\.].*@Identifier:@' | \
  sort | uniq -c | sort -rn
   9254 /* SPDX-License-Identifier: ... */
     53  * SPDX-License-Identifier:
      1  * SPDX-License-Identifier:	GPL-2.0
      1 /*  SPDX-License-Identifier: ... */

and the perl script below is also attached

$ cat update_spdx.perl
local $/;
my $file = (<>);

my $spdx_regex = '/\*[ \t]*SPDX-License-Identifier:[ \t]*'; my $spdx_actual = '/* SPDX-License-Identifier: ';

# any // use converted to /* ... */
$file =~ s@^//[ \t]*SPDX-License-Identifier:[ \t]*(.*)\n@/* SPDX-License-Identifier: $1 */\n@;
# first line use with /* without trailing */ gets */ added and 2nd line updated
$file =~ m@^\s*${spdx_regex}([^\n]+)\n@;
if (defined $1 && $1 !~ m@\*/$@) {
    $file =~ s@^[ \t]*${spdx_regex}([^\n]+)\n@${spdx_actual}$1 */\n/* @;
    $file =~ s@^[ \t]*${spdx_regex}([^\n]+)\n[ \t]*/\*[ \t]+\*@${spdx_actual}$1\n/* @;
    $file =~ s@^\s*${spdx_regex}([^\n]+)\n/\* \n@${spdx_actual}$1\n/*\n@;
}

print $file;

#6 lore raw
In reply to Greg Kroah-Hartman
Quoted 21 lines · Greg Kroah-Hartman
Quoted 14 lines · Nishad Kamdar

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +0 -0
index 94e700fcd0b6..75166020f7c6 100644

drivers/staging/vt6656/mac.h line 1

Quoted 3 lines
drivers/staging/vt6656/mac.h +1 -2
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+

Should really be:

Quoted 5 lines

/* SPDX-License-Identifier: GPL-2.0+ */

thanks,

greg k-h

Ok, i'll modify it.

Thanks for the review.

Regards,
Nishad

#5 lore raw
In reply to Joe Perches
Quoted 91 lines · Joe Perches
Quoted 42 lines · Greg Kroah-Hartman
Quoted 30 lines · Joe Perches
Quoted 21 lines · Greg Kroah-Hartman
Quoted 14 lines · Nishad Kamdar

This patch corrects the style for SPDX license Identifier in mac.h by using "/* */" in place of "//" as per Linux kernel licensing rules. Issue found by checkpatch.

---
 drivers/staging/vt6656/mac.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6656/mac.h +0 -0
index 94e700fcd0b6..75166020f7c6 100644

drivers/staging/vt6656/mac.h line 1

Quoted 3 lines
drivers/staging/vt6656/mac.h +1 -2
@@ -1,5 +1,5 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
+/* SPDX-License-Identifier: GPL-2.0+

Should really be:

Quoted 1 line

/* SPDX-License-Identifier: GPL-2.0+ */

There's a fair number of style inconsistencies in the kernel sources for that already.

~8% of the .h files that have an 'SPDX-License-Identifier:' don't use the recommended style.

Quoted 10 lines
$ git grep -h "SPDX-License" -- '*.h' | \
  perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: [^\.].*@Identifier:@' | \
  sort | uniq -c | sort -rn
   8506 /* SPDX-License-Identifier: ... */
    593 // SPDX-License-Identifier:
    154 /* SPDX-License-Identifier:
     53  * SPDX-License-Identifier:
      1  * SPDX-License-Identifier:	GPL-2.0
      1 //SPDX-License-Identifier:
      1 /*  SPDX-License-Identifier: ... */
Quoted 2 lines

Then let's fix them, the documentation says what the correct format is, there's no reason we can't actually follow what is written...

So here's a script that does most all of them except the 50 or so that use the SPDX-License-Identifier in the middle of a comment block.

Using:

$ git grep --name-only 'SPDX-License-Identifier:' -- '*.h' | \
  xargs grep -L '/\* SPDX-License-Identifier:.*\*/'| \
  while read file ; do perl -i update_spdx.perl $file ; done

produces

$ git diff --shortstat
 748 files changed, 902 insertions(+), 902 deletions(-)

And

$ git grep -h "SPDX-License" -- '*.h' | \
  perl -p -e 's@Identifier:.*\*/*@Identifier: ... */@; s@Identifier: [^\.].*@Identifier:@' | \
  sort | uniq -c | sort -rn
   9254 /* SPDX-License-Identifier: ... */
     53  * SPDX-License-Identifier:
      1  * SPDX-License-Identifier:	GPL-2.0
      1 /*  SPDX-License-Identifier: ... */

and the perl script below is also attached

$ cat update_spdx.perl
local $/;
my $file = (<>);

my $spdx_regex = '/\*[ \t]*SPDX-License-Identifier:[ \t]*'; my $spdx_actual = '/* SPDX-License-Identifier: ';

# any // use converted to /* ... */
$file =~ s@^//[ \t]*SPDX-License-Identifier:[ \t]*(.*)\n@/* SPDX-License-Identifier: $1 */\n@;
# first line use with /* without trailing */ gets */ added and 2nd line updated
$file =~ m@^\s*${spdx_regex}([^\n]+)\n@;
if (defined $1 && $1 !~ m@\*/$@) {
    $file =~ s@^[ \t]*${spdx_regex}([^\n]+)\n@${spdx_actual}$1 */\n/* @;
    $file =~ s@^[ \t]*${spdx_regex}([^\n]+)\n[ \t]*/\*[ \t]+\*@${spdx_actual}$1\n/* @;
    $file =~ s@^\s*${spdx_regex}([^\n]+)\n/\* \n@${spdx_actual}$1\n/*\n@;
}
Quoted 2 lines

print $file;

Ok, Thanks for the suggestion and the script.

I'll try to use it and correct the format.

Thanks and regards,
Nishad