License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 15:07:57 +01:00
# SPDX-License-Identifier: GPL-2.0
2015-04-21 10:00:35 +08:00
if MACH_LOONGSON64
2011-02-07 11:31:36 +09:00
2009-07-02 23:26:45 +08:00
choice
2009-10-16 14:17:14 +08:00
prompt "Machine Type"
2009-07-02 23:26:45 +08:00
config LEMOTE_FULOONG2E
2009-10-16 14:17:14 +08:00
bool "Lemote Fuloong(2e) mini-PC"
select ARCH_SPARSEMEM_ENABLE
2018-03-01 10:37:41 +08:00
select ARCH_MIGHT_HAVE_PC_PARPORT
2018-03-01 10:37:42 +08:00
select ARCH_MIGHT_HAVE_PC_SERIO
2009-10-16 14:17:14 +08:00
select CEVT_R4K
select CSRC_R4K
select SYS_HAS_CPU_LOONGSON2E
select DMA_NONCOHERENT
select BOOT_ELF32
select BOARD_SCACHE
2018-11-15 20:05:32 +01:00
select HAVE_PCI
2009-10-16 14:17:14 +08:00
select I8259
select ISA
2015-05-26 18:20:06 +02:00
select IRQ_MIPS_CPU
2009-10-16 14:17:14 +08:00
select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_SUPPORTS_HIGHMEM
select SYS_HAS_EARLY_PRINTK
select GENERIC_ISA_DMA_SUPPORT_BROKEN
select CPU_HAS_WB
2010-06-02 00:39:54 +02:00
select LOONGSON_MC146818
2009-10-16 14:17:14 +08:00
help
Lemote Fuloong(2e) mini-PC board based on the Chinese Loongson-2E CPU and
an FPGA northbridge
2009-07-02 23:26:45 +08:00
2009-10-16 14:17:14 +08:00
Lemote Fuloong(2e) mini PC have a VIA686B south bridge.
2009-11-10 00:06:10 +08:00
config LEMOTE_MACH2F
bool "Lemote Loongson 2F family machines"
select ARCH_SPARSEMEM_ENABLE
2018-03-01 10:37:41 +08:00
select ARCH_MIGHT_HAVE_PC_PARPORT
2018-03-01 10:37:42 +08:00
select ARCH_MIGHT_HAVE_PC_SERIO
2009-11-10 00:06:10 +08:00
select BOARD_SCACHE
select BOOT_ELF32
2009-11-17 01:32:59 +08:00
select CEVT_R4K if ! MIPS_EXTERNAL_TIMER
2009-11-10 00:06:10 +08:00
select CPU_HAS_WB
select CS5536
2009-11-17 01:32:59 +08:00
select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
2009-11-10 00:06:10 +08:00
select DMA_NONCOHERENT
select GENERIC_ISA_DMA_SUPPORT_BROKEN
2012-08-01 17:15:32 +02:00
select HAVE_CLK
2018-11-15 20:05:32 +01:00
select HAVE_PCI
2009-11-10 00:06:10 +08:00
select I8259
2015-05-26 18:20:06 +02:00
select IRQ_MIPS_CPU
2009-11-10 00:06:10 +08:00
select ISA
select SYS_HAS_CPU_LOONGSON2F
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_HIGHMEM
select SYS_SUPPORTS_LITTLE_ENDIAN
2010-06-02 00:39:54 +02:00
select LOONGSON_MC146818
2009-11-10 00:06:10 +08:00
help
Lemote Loongson 2F family machines utilize the 2F revision of
Loongson processor and the AMD CS5536 south bridge.
These family machines include fuloong2f mini PC, yeeloong2f notebook,
LingLoong allinone PC and so forth.
2014-03-21 18:44:07 +08:00
2014-06-26 11:41:32 +08:00
config LOONGSON_MACH3X
bool "Generic Loongson 3 family machines"
2014-03-21 18:44:07 +08:00
select ARCH_SPARSEMEM_ENABLE
2018-03-01 10:37:41 +08:00
select ARCH_MIGHT_HAVE_PC_PARPORT
2018-03-01 10:37:42 +08:00
select ARCH_MIGHT_HAVE_PC_SERIO
2014-03-21 18:44:07 +08:00
select GENERIC_ISA_DMA_SUPPORT_BROKEN
select BOOT_ELF32
select BOARD_SCACHE
select CSRC_R4K
select CEVT_R4K
select CPU_HAS_WB
2018-11-15 20:05:32 +01:00
select FORCE_PCI
2014-03-21 18:44:07 +08:00
select ISA
select I8259
2015-05-26 18:20:06 +02:00
select IRQ_MIPS_CPU
2014-03-21 18:44:07 +08:00
select NR_CPUS_DEFAULT_4
select SYS_HAS_CPU_LOONGSON3
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_SMP
2014-03-21 18:44:09 +08:00
select SYS_SUPPORTS_HOTPLUG_CPU
2014-06-26 11:41:28 +08:00
select SYS_SUPPORTS_NUMA
2014-03-21 18:44:07 +08:00
select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_HIGHMEM
select SYS_SUPPORTS_LITTLE_ENDIAN
select LOONGSON_MC146818
select ZONE_DMA32
select LEFI_FIRMWARE_INTERFACE
help
2014-06-26 11:41:32 +08:00
Generic Loongson 3 family machines utilize the 3A/3B revision
of Loongson processor and RS780/SBX00 chipset.
2009-07-02 23:26:45 +08:00
endchoice
2009-11-10 00:06:12 +08:00
config CS5536
bool
MIPS: Loongson 2F: Add suspend support framework
This patch add basic suspend support for loongson2f family machines,
loongson2f have a specific feature: when we set it's frequency to ZERO,
it will go into a wait mode, and then can be waked up by the external
interrupt. so, if we setup suitable interrupts before putting it into
wait mode, we will be able wake it up whenever we want via sending the
relative interrupts to it.
These interrupts are board-specific, Yeeloong2F use the keyboard
interrupt and SCI interrupt, but LingLoong and Fuloong2F use the
interrupts connected to the processors directly. and BTW: some old
LingLoong and FuLoong2F have no such interrupts connected, so, there is
no way to wake them up from suspend mode. and therefore, please do not
enable the kernel support for them.
The board-specific support will be added in the coming patches.
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: yanh@lemote.com
Cc: huhb@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org
Patchwork: http://patchwork.linux-mips.org/patch/629/
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-11-11 14:57:05 +08:00
2009-11-17 01:32:57 +08:00
config CS5536_MFGPT
bool "CS5536 MFGPT Timer"
2014-05-13 17:07:05 +02:00
depends on CS5536 && !HIGH_RES_TIMERS
2009-11-17 01:32:59 +08:00
select MIPS_EXTERNAL_TIMER
2009-11-17 01:32:57 +08:00
help
2014-05-13 17:07:05 +02:00
This option enables the mfgpt0 timer of AMD CS5536. With this timer
switched on you can not use high resolution timers.
2009-11-17 01:32:57 +08:00
If you want to enable the Loongson2 CPUFreq Driver, Please enable
this option at first, otherwise, You will get wrong system time.
If unsure, say Yes.
2014-11-04 14:15:31 +08:00
config RS780_HPET
bool "RS780/SBX00 HPET Timer"
depends on LOONGSON_MACH3X
select MIPS_EXTERNAL_TIMER
help
This option enables the hpet timer of AMD RS780/SBX00.
If you want to enable the Loongson3 CPUFreq Driver, Please enable
this option at first, otherwise, You will get wrong system time.
If unsure, say Yes.
2009-11-28 14:21:50 +08:00
config LOONGSON_UART_BASE
bool
default y
depends on EARLY_PRINTK || SERIAL_8250
2010-06-02 00:39:54 +02:00
config LOONGSON_MC146818
bool
default n
2011-02-07 11:31:36 +09:00
2014-03-21 18:44:07 +08:00
config LEFI_FIRMWARE_INTERFACE
bool
2015-04-21 10:00:35 +08:00
endif # MACH_LOONGSON64