Merge tag 'kbuild-misc-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahi...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 01:51:33 +0000 (17:51 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 01:51:33 +0000 (17:51 -0800)
Pull Kbuild misc updates from Masahiro Yamada:

 - Clean up and fix RPM package build

 - Fix a warning in DEB package build

 - Improve coccicheck script

 - Improve some semantic patches

* tag 'kbuild-misc-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  docs: dev-tools: coccinelle: delete out of date wiki reference
  coccinelle: orplus: reorganize to improve performance
  coccinelle: use exists to improve efficiency
  builddeb: Pass the kernel:debarch substvar to dpkg-genchanges
  Coccinelle: use false positive annotation
  coccinelle: fix verbose message about .cocci file being run
  coccinelle: grep Options and Requires fields more precisely
  Coccinelle: make DEBUG_FILE option more useful
  coccinelle: api: detect identical chip data arrays
  coccinelle: Improve setup_timer.cocci matching
  Coccinelle: setup_timer: improve messages from setup_timer
  kbuild: rpm-pkg: do not force -jN in submake
  kbuild: rpm-pkg: keep spec file until make mrproper
  kbuild: rpm-pkg: fix jobserver unavailable warning
  kbuild: rpm-pkg: replace $RPM_BUILD_ROOT with %{buildroot}
  kbuild: rpm-pkg: fix build error when CONFIG_MODULES is disabled
  kbuild: rpm-pkg: refactor mkspec with here doc
  kbuild: rpm-pkg: clean up mkspec
  kbuild: rpm-pkg: install vmlinux.bz2 unconditionally
  kbuild: rpm-pkg: remove ppc64 specific image handling

1  2 
.gitignore
Documentation/dev-tools/coccinelle.rst
scripts/coccicheck

diff --combined .gitignore
index 6c119eab5d46921575fe606e9fe362ab5190791e,4f034b853d7d53e090fbf7b9197f92d17c679e79..f6050b88e95b5b59e2c08dbef865d92049956e58
@@@ -7,40 -7,38 +7,40 @@@
  # command after changing this file, to see if there are
  # any tracked files which get ignored after the change.
  #
 -# Normal rules
 +# Normal rules (sorted alphabetically)
  #
  .*
 +*.a
 +*.bin
 +*.bz2
 +*.c.[012]*.*
 +*.dtb
 +*.dtb.S
 +*.dwo
 +*.elf
 +*.gcno
 +*.gz
 +*.i
 +*.ko
 +*.ll
 +*.lst
 +*.lz4
 +*.lzma
 +*.lzo
 +*.mod.c
  *.o
  *.o.*
 -*.a
 +*.order
 +*.patch
  *.s
 -*.ko
  *.so
  *.so.dbg
 -*.mod.c
 -*.i
 -*.lst
 +*.su
  *.symtypes
 -*.order
 -*.elf
 -*.bin
  *.tar
 -*.gz
 -*.bz2
 -*.lzma
  *.xz
 -*.lz4
 -*.lzo
 -*.patch
 -*.gcno
 -*.ll
 -modules.builtin
  Module.symvers
 -*.dwo
 -*.su
 -*.c.[012]*.*
 +modules.builtin
  
  #
  # Top-level generic files
  /System.map
  /Module.markers
  
+ #
+ # RPM spec file (make rpm-pkg)
+ #
+ /*.spec
  #
  # Debian directory (make deb-pkg)
  #
index 37e474ff69115da89dd780475a35d119d5ee4383,38f3b32203e980a292c2229c34956093a86f75a4..94f41c290bfc69eb417066c0cff30f361f1c9bcc
@@@ -33,9 -33,6 +33,6 @@@ of many distributions, e.g. 
  You can get the latest version released from the Coccinelle homepage at
  http://coccinelle.lip6.fr/
  
- Information and tips about Coccinelle are also provided on the wiki
- pages at http://cocci.ekstranet.diku.dk/wiki/doku.php
  Once you have it, run the following command::
  
        ./configure
@@@ -209,7 -206,7 +206,7 @@@ err.log will now have the profiling inf
  provide some progress information as Coccinelle moves forward with
  work.
  
 -DEBUG_FILE support is only supported when using coccinelle >= 1.2.
 +DEBUG_FILE support is only supported when using coccinelle >= 1.0.2.
  
  .cocciconfig support
  --------------------
diff --combined scripts/coccicheck
index 28ad1feff9e12d07fbf1ff2369ca1ecf7e76dd85,41a85b1ed35e3142dd9e50e957434a0477511851..d5f28d5044e74e996a66311b691d9b5455b88389
@@@ -1,5 -1,4 +1,5 @@@
  #!/bin/bash
 +# SPDX-License-Identifier: GPL-2.0
  # Linux kernel coccicheck
  #
  # Read Documentation/dev-tools/coccinelle.rst
@@@ -123,15 -122,8 +123,8 @@@ run_cmd_parmap() 
        if [ $VERBOSE -ne 0 ] ; then
                echo "Running ($NPROC in parallel): $@"
        fi
-       if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
-               if [ -f $DEBUG_FILE ]; then
-                       echo "Debug file $DEBUG_FILE exists, bailing"
-                       exit
-               fi
-       else
-               DEBUG_FILE="/dev/null"
-       fi
-       $@ 2>$DEBUG_FILE
+       echo $@ >>$DEBUG_FILE
+       $@ 2>>$DEBUG_FILE
        if [[ $? -ne 0 ]]; then
                echo "coccicheck failed"
                exit $?
@@@ -176,8 -168,8 +169,8 @@@ OPTIONS="$OPTIONS $SPFLAGS
  coccinelle () {
      COCCI="$1"
  
-     OPT=`grep "Option" $COCCI | cut -d':' -f2`
-     REQ=`grep "Requires" $COCCI | cut -d':' -f2 | sed "s| ||"`
+     OPT=`grep "Options:" $COCCI | cut -d':' -f2`
+     REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"`
      REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh)
      if [ "$REQ_NUM" != "0" ] ; then
            if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then
  
      if [ $VERBOSE -ne 0 -a $ONLINE -eq 0 ] ; then
  
-       FILE=`echo $COCCI | sed "s|$srctree/||"`
+       FILE=${COCCI#$srctree/}
  
        echo "Processing `basename $COCCI`"
        echo "with option(s) \"$OPT\""
  
  }
  
+ if [ "$DEBUG_FILE" != "/dev/null" -a "$DEBUG_FILE" != "" ]; then
+       if [ -f $DEBUG_FILE ]; then
+               echo "Debug file $DEBUG_FILE exists, bailing"
+               exit
+       fi
+ else
+       DEBUG_FILE="/dev/null"
+ fi
  if [ "$COCCI" = "" ] ; then
      for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do
        coccinelle $f