checkpatch: Properly detect /* */ style SPDX header.
PATCH 1/1 checkpatch: Properly detect /* */ style SPDX header.
Currently for a header line "/* SPDX-License-Identifier: GPL-2.0 */", only the part starting from "SPDX-" is passed to spdxcheck.py, and cause false warning. Fix this by passing the whole line to spdxcheck.py instead.
--- scripts/checkpatch.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
scripts/checkpatch.pl +2 -3
@@ -3044,10 +3044,9 @@ sub process { WARN("SPDX_LICENSE_TAG", "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { - my $spdx_license = $1; - if (!is_SPDX_License_valid($spdx_license)) { + if (!is_SPDX_License_valid($rawline)) { WARN("SPDX_LICENSE_TAG", - "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); + "'$rawline' is not supported in LICENSES/...\n" . $herecurr); } } }
Signature · 1 line
2.20.1.611.gfbb209baf1-goog
Joe Perches
maintainerQuoted 4 lines · Pi-Hsun Shih
Currently for a header line "/* SPDX-License-Identifier: GPL-2.0 */", only the part starting from "SPDX-" is passed to
spdxcheck.py, and cause false warning. Fix this by passing the whole line tospdxcheck.pyinstead.
Thanks but I submitted a different patch:
Quoted 11 lines · Joe Perches
Quoted 4 lines · Pi-Hsun Shih
Currently for a header line "/* SPDX-License-Identifier: GPL-2.0 */", only the part starting from "SPDX-" is passed to
spdxcheck.py, and cause false warning. Fix this by passing the whole line tospdxcheck.pyinstead.Thanks but I submitted a different patch:
I tried your patch, but when running checkpatch.pl on
https://patchwork.kernel.org/patch/10790203/, I still get:
WARNING: 'SPDX-License-Identifier: GPL-2.0 */' is not supported in LICENSES/... #75: FILE: drivers/remoteproc/mtk_common.h:1:
+/* SPDX-License-Identifier: GPL-2.0 */
Feels that these two patches fix different issues.