diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-17 16:49:31 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-17 16:49:31 -0700 |
commit | 6ada4e2826794bdf8d88f938a9ced0b80894b037 (patch) | |
tree | 4a39e46d6c4502ae9346566b2e384dcc2205c014 /scripts | |
parent | 9bd553929f68921be0f2014dd06561e0c8249a0d (diff) | |
parent | 1e9264192961aa519595170aa8b0f7651a2ad28e (diff) | |
download | linux-6ada4e2826794bdf8d88f938a9ced0b80894b037.tar.bz2 |
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-x | scripts/spdxcheck.py | 11 |
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 @@ from argparse import ArgumentParser from ply import lex, yacc +import locale import traceback import sys import git @@ -32,7 +33,7 @@ def read_spdxdata(repo): # The subdirectories of LICENSES in the kernel source license_dirs = [ "preferred", "other", "exceptions" ] - lictree = repo.heads.master.commit.tree['LICENSES'] + lictree = repo.head.commit.tree['LICENSES'] spdx = SPDXdata() @@ -102,7 +103,7 @@ class id_parser(object): raise ParserException(tok, 'Invalid License ID') self.lastid = id elif tok.type == 'EXC': - if not self.spdx.exceptions.has_key(id): + if id not in self.spdx.exceptions: raise ParserException(tok, 'Invalid Exception ID') if self.lastid not in self.spdx.exceptions[id]: raise ParserException(tok, 'Exception not valid for license %s' %self.lastid) @@ -167,6 +168,7 @@ class id_parser(object): self.curline = 0 try: for line in fd: + line = line.decode(locale.getpreferredencoding(False), errors='ignore') self.curline += 1 if self.curline > maxlines: break @@ -199,11 +201,10 @@ def scan_git_tree(tree): continue if el.path.find("license-rules.rst") >= 0: continue - if el.path == 'scripts/checkpatch.pl': - continue if not os.path.isfile(el.path): continue - parser.parse_lines(open(el.path), args.maxlines, el.path) + with open(el.path, 'rb') as fd: + parser.parse_lines(fd, args.maxlines, el.path) def scan_git_subtree(tree, path): for p in path.strip('/').split('/'): |