aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-17 19:49:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-17 19:49:31 -0400
commit6ada4e2826794bdf8d88f938a9ced0b80894b037 (patch)
tree4a39e46d6c4502ae9346566b2e384dcc2205c014 /scripts
parent9bd553929f68921be0f2014dd06561e0c8249a0d (diff)
parent1e9264192961aa519595170aa8b0f7651a2ad28e (diff)
Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: - a few misc things - a few Y2038 fixes - ntfs fixes - arch/sh tweaks - ocfs2 updates - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (111 commits) mm/hmm.c: remove unused variables align_start and align_end fs/userfaultfd.c: remove redundant pointer uwq mm, vmacache: hash addresses based on pmd mm/list_lru: introduce list_lru_shrink_walk_irq() mm/list_lru.c: pass struct list_lru_node* as an argument to __list_lru_walk_one() mm/list_lru.c: move locking from __list_lru_walk_one() to its caller mm/list_lru.c: use list_lru_walk_one() in list_lru_walk_node() mm, swap: make CONFIG_THP_SWAP depend on CONFIG_SWAP mm/sparse: delete old sparse_init and enable new one mm/sparse: add new sparse_init_nid() and sparse_init() mm/sparse: move buffer init/fini to the common place mm/sparse: use the new sparse buffer functions in non-vmemmap mm/sparse: abstract sparse buffer allocations mm/hugetlb.c: don't zero 1GiB bootmem pages mm, page_alloc: double zone's batchsize mm/oom_kill.c: document oom_lock mm/hugetlb: remove gigantic page support for HIGHMEM mm, oom: remove sleep from under oom_lock kernel/dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous() mm/cma: remove unsupported gfp_mask parameter from cma_alloc() ...
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/spdxcheck.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
index 7deaef297f52..839e190bbd7a 100755
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -4,6 +4,7 @@
4 4
5from argparse import ArgumentParser 5from argparse import ArgumentParser
6from ply import lex, yacc 6from ply import lex, yacc
7import locale
7import traceback 8import traceback
8import sys 9import sys
9import git 10import git
@@ -32,7 +33,7 @@ def read_spdxdata(repo):
32 33
33 # The subdirectories of LICENSES in the kernel source 34 # The subdirectories of LICENSES in the kernel source
34 license_dirs = [ "preferred", "other", "exceptions" ] 35 license_dirs = [ "preferred", "other", "exceptions" ]
35 lictree = repo.heads.master.commit.tree['LICENSES'] 36 lictree = repo.head.commit.tree['LICENSES']
36 37
37 spdx = SPDXdata() 38 spdx = SPDXdata()
38 39
@@ -102,7 +103,7 @@ class id_parser(object):
102 raise ParserException(tok, 'Invalid License ID') 103 raise ParserException(tok, 'Invalid License ID')
103 self.lastid = id 104 self.lastid = id
104 elif tok.type == 'EXC': 105 elif tok.type == 'EXC':
105 if not self.spdx.exceptions.has_key(id): 106 if id not in self.spdx.exceptions:
106 raise ParserException(tok, 'Invalid Exception ID') 107 raise ParserException(tok, 'Invalid Exception ID')
107 if self.lastid not in self.spdx.exceptions[id]: 108 if self.lastid not in self.spdx.exceptions[id]:
108 raise ParserException(tok, 'Exception not valid for license %s' %self.lastid) 109 raise ParserException(tok, 'Exception not valid for license %s' %self.lastid)
@@ -167,6 +168,7 @@ class id_parser(object):
167 self.curline = 0 168 self.curline = 0
168 try: 169 try:
169 for line in fd: 170 for line in fd:
171 line = line.decode(locale.getpreferredencoding(False), errors='ignore')
170 self.curline += 1 172 self.curline += 1
171 if self.curline > maxlines: 173 if self.curline > maxlines:
172 break 174 break
@@ -199,11 +201,10 @@ def scan_git_tree(tree):
199 continue 201 continue
200 if el.path.find("license-rules.rst") >= 0: 202 if el.path.find("license-rules.rst") >= 0:
201 continue 203 continue
202 if el.path == 'scripts/checkpatch.pl':
203 continue
204 if not os.path.isfile(el.path): 204 if not os.path.isfile(el.path):
205 continue 205 continue
206 parser.parse_lines(open(el.path), args.maxlines, el.path) 206 with open(el.path, 'rb') as fd:
207 parser.parse_lines(fd, args.maxlines, el.path)
207 208
208def scan_git_subtree(tree, path): 209def scan_git_subtree(tree, path):
209 for p in path.strip('/').split('/'): 210 for p in path.strip('/').split('/'):