On Wed, Jan 16, 2019 at 11:26:53AM +0100, Thomas Gleixner wrote:
> The SuperH boot code files use a magic format for the SPDX identifier
> comment:
> 
>   LIST "SPDX-License-Identifier: .... "
> 
> The trailing quotation mark is not stripped before the token parser is
> invoked and causes the scan to fail. Handle it gracefully.
> 
> Fixes: 6a0abce4c4cc ("sh: include: convert to SPDX identifiers")
> Signed-off-by: Thomas Gleixner <t...@linutronix.de>
> Cc: Kuninori Morimoto <kuninori.morimoto...@renesas.com>
> Cc: Simon Horman <horms+rene...@verge.net.au>
> Cc: Yoshinori Sato <ys...@users.sourceforge.jp>
> Cc: Rich Felker <dal...@libc.org>
> Cc: Andrew Morton <a...@linux-foundation.org>
> Cc: Kate Stewart <kstew...@linuxfoundation.org>
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> Cc: Jonathan Corbet <cor...@lwn.net>
> ---
>  scripts/spdxcheck.py |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> --- a/scripts/spdxcheck.py
> +++ b/scripts/spdxcheck.py
> @@ -175,7 +175,13 @@ import os
>                  self.lines_checked += 1
>                  if line.find("SPDX-License-Identifier:") < 0:
>                      continue
> -                expr = line.split(':')[1].replace('*/', '').strip()
> +                expr = line.split(':')[1].strip()
> +                # Remove trailing comment closure
> +                if line.startswith('/*'):
> +                    expr = expr.rstrip('*/').strip()
> +                # Special case for SH magic boot code files
> +                if line.startswith('LIST \"'):
> +                    expr = expr.rstrip('\"').strip()
>                  self.parse(expr)
>                  self.spdx_valid += 1
>                  #
> 
> 

Reviewed-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

Reply via email to