linux/drivers/power/supply
Greg Kroah-Hartman b24413180f 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-02 11:10:55 +01:00
..
88pm860x_battery.c
88pm860x_charger.c
Kconfig Merge branch 'psy-w1-for-v4.14-immutable' into for-next 2017-07-25 15:18:27 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ab8500_bmdata.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ab8500_btemp.c power: supply: ab8500_btemp: Compress return logic into one line. 2017-01-17 00:28:38 +01:00
ab8500_charger.c power: supply: ab8500_charger: spelling: "prechage" -> "precharge" 2017-05-01 12:37:01 +02:00
ab8500_fg.c power: supply: improve function-level documentation 2016-10-19 05:06:22 +02:00
abx500_chargalg.c
act8945a_charger.c power: supply: act8945a_charger: fix of_irq_get() error check 2017-07-24 14:09:00 +02:00
apm_power.c
axp20x_ac_power.c power: supply: add AC power supply driver for AXP20X and AXP22X PMICs 2017-01-29 23:15:18 +01:00
axp20x_battery.c power: supply: axp20x_battery: add DT support for battery max constant charge current 2017-06-08 17:57:53 +02:00
axp20x_usb_power.c power: supply: axp20x_usb_power: Drop unnecessary static 2017-05-15 15:28:14 +02:00
axp288_charger.c power: supply: axp288_charger: Only wait for INT3496 device if present 2017-04-19 22:53:35 +02:00
axp288_fuel_gauge.c power: supply: axp288_fuel_gauge: Remove unnecessary irq?_en register writes 2017-01-04 22:03:44 +01:00
bq27xxx_battery.c power: supply: bq27xxx: enable writing capacity values for bq27421 2017-08-31 10:25:24 +02:00
bq27xxx_battery_hdq.c power: supply: bq27xxx: move platform driver code into bq27xxx_battery_hdq.c 2017-07-25 15:31:21 +02:00
bq27xxx_battery_i2c.c power: supply: bq27xxx: Add chip IDs for previously shadowed chips 2017-08-29 12:37:35 +02:00
bq2415x_charger.c power: supply: bq2415x: check for NULL acpi_id to avoid null pointer dereference 2017-01-21 03:35:07 +01:00
bq24190_charger.c power: supply: bq24190_charger: Get input_current_limit from our supplier 2017-08-30 18:02:02 +02:00
bq24257_charger.c power: bq24257: Fix use of uninitialized pointer bq->charger 2016-09-19 20:56:22 +02:00
bq24735-charger.c power: supply: bq24735: remove incorrect le16_to_cpu calls 2017-06-15 16:47:35 +02:00
bq25890_charger.c power: supply: bq25890: Use gpiod_get() 2017-04-14 01:41:34 +02:00
charger-manager.c power: supply: charger-manager: Slighly simplify code 2017-08-11 18:54:35 +02:00
collie_battery.c
cpcap-battery.c power: supply: cpcap-battery: Add a battery driver 2017-06-08 13:05:54 +02:00
cpcap-charger.c power: supply: cpcap-charger: Add missing power_supply_config 2017-06-15 10:16:59 +02:00
da9030_battery.c
da9052-battery.c
da9150-charger.c
da9150-fg.c
ds2760_battery.c w1: Add subsystem kernel public interface 2017-06-09 11:54:54 +02:00
ds2780_battery.c power: supply: add const to bin_attribute structures 2017-08-09 17:42:56 +02:00
ds2781_battery.c power: supply: add const to bin_attribute structures 2017-08-09 17:42:56 +02:00
ds2782_battery.c
generic-adc-battery.c power: supply: generic-adc-battery: use SIMPLE_DEV_PM_OPS helper macro 2017-05-01 11:52:24 +02:00
goldfish_battery.c
gpio-charger.c power: supply: gpio_charger: switch to using GPIO descriptors 2017-01-04 22:04:50 +01:00
ipaq_micro_battery.c power: ipaq_micro_battery: fix alias 2016-11-23 23:44:40 +01:00
isp1704_charger.c power: supply: isp1704: Fix unchecked return value of devm_kzalloc 2017-05-01 11:52:25 +02:00
jz4740-battery.c
lego_ev3_battery.c power: supply: New driver for LEGO MINDSTORMS EV3 battery 2017-04-14 01:41:35 +02:00
lp8727_charger.c
lp8788-charger.c power: supply: lp8788: Make several arrays static const * const 2017-08-12 13:58:14 -04:00
ltc2941-battery-gauge.c power: supply: ltc2941-battery-gauge: Add LTC2944 support 2017-07-25 12:13:04 +02:00
ltc3651-charger.c power: supply: ltc3651-charger: fix some error codes in probe 2017-06-08 13:05:27 +02:00
max1721x_battery.c power: supply: Add support for MAX1721x standalone fuel gauge 2017-07-24 14:09:34 +02:00
max8903_charger.c
max8925_power.c
max8997_charger.c power: supply: max8997_charger: Using device managed API and remove OOM print 2017-01-04 21:59:56 +01:00
max8998_charger.c
max14577_charger.c
max14656_charger_detector.c power: supply: max14656: Export I2C and OF device ID as module aliases 2017-01-29 23:15:17 +01:00
max17040_battery.c power: supply: max17040: Add OF device ID table 2017-04-14 01:41:33 +02:00
max17042_battery.c power: supply: max17042_battery: Fix compiler warning 2017-08-29 12:04:14 +02:00
max77693_charger.c
olpc_battery.c power: supply: make device_attribute const 2017-08-28 18:48:44 +02:00
pcf50633-charger.c power: supply: constify attribute_group structures. 2017-07-24 14:09:32 +02:00
pda_power.c power: supply: pda_power: move from timer to delayed_work 2017-05-01 12:41:58 +02:00
pm2301_charger.c
pm2301_charger.h
pmu_battery.c
power_supply.h
power_supply_core.c power: supply: Add power_supply_set_input_current_limit_from_supplier helper 2017-08-29 12:24:52 +02:00
power_supply_leds.c
power_supply_sysfs.c power: supply: core: Add power_supply_prop_precharge 2017-06-08 16:29:28 +02:00
qcom_smbb.c power: supply: qcom_smbb: Add otg regulator for control of vbus 2017-01-16 23:02:46 +01:00
rt5033_battery.c
rt9455_charger.c
rx51_battery.c power: supply: avoid unused twl4030-madc.h 2017-05-01 13:03:09 +02:00
s3c_adc_battery.c
sbs-battery.c power: supply: sbs-battery: Add delay when changing capacity mode bit 2017-07-25 11:30:28 +02:00
sbs-charger.c power: supply: sbs-charger: simplified bool function 2017-04-14 01:41:34 +02:00
smb347-charger.c
test_power.c
tosa_battery.c
tps65090-charger.c
tps65217_charger.c power: supply: tps65217: remove debug messages for function calls 2017-04-14 01:41:35 +02:00
twl4030_charger.c mfd: twl: Move header file out of I2C realm 2017-09-04 14:41:02 +01:00
twl4030_madc_battery.c power: supply: avoid unused twl4030-madc.h 2017-05-01 13:03:09 +02:00
wm97xx_battery.c power: supply: wm97xx_battery: remove redundant 2nd null check on pdata 2017-01-04 22:04:20 +01:00
wm831x_backup.c
wm831x_power.c power: wm831x_power: Support USB charger current limit management 2017-08-15 15:05:01 +03:00
wm8350_power.c wm8350_power: use permission-specific DEVICE_ATTR variants 2016-11-23 23:46:20 +01:00
z2_battery.c