Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull misc kbuild changes from Michal Marek:
"The non-critical part of kbuild is small this time:
- Three fixes for make deb-pkg
- A new coccinelle check

One of the deb-pkg fixes is a leftover from the last merge window,
hence the merge commit"

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
deb-pkg: Fix building for MIPS big-endian or ARM OABI
deb-pkg: Fix cross-building linux-headers package
scripts: Coccinelle script for pm_runtime_* return checks with IS_ERR_VALUE
deb-pkg: Inhibit initramfs builders if CONFIG_BLK_DEV_INITRD is not set

+126 -8
+109
scripts/coccinelle/api/pm_runtime.cocci
··· 1 + /// Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE 2 + // 3 + // Keywords: pm_runtime 4 + // Confidence: Medium 5 + // Copyright (C) 2013 Texas Instruments Incorporated - GPLv2. 6 + // URL: http://coccinelle.lip6.fr/ 7 + // Options: --include-headers 8 + 9 + virtual patch 10 + virtual context 11 + virtual org 12 + virtual report 13 + 14 + //---------------------------------------------------------- 15 + // Detection 16 + //---------------------------------------------------------- 17 + 18 + @runtime_bad_err_handle exists@ 19 + expression ret; 20 + @@ 21 + ( 22 + ret = \(pm_runtime_idle\| 23 + pm_runtime_suspend\| 24 + pm_runtime_autosuspend\| 25 + pm_runtime_resume\| 26 + pm_request_idle\| 27 + pm_request_resume\| 28 + pm_request_autosuspend\| 29 + pm_runtime_get\| 30 + pm_runtime_get_sync\| 31 + pm_runtime_put\| 32 + pm_runtime_put_autosuspend\| 33 + pm_runtime_put_sync\| 34 + pm_runtime_put_sync_suspend\| 35 + pm_runtime_put_sync_autosuspend\| 36 + pm_runtime_set_active\| 37 + pm_schedule_suspend\| 38 + pm_runtime_barrier\| 39 + pm_generic_runtime_suspend\| 40 + pm_generic_runtime_resume\)(...); 41 + ... 42 + IS_ERR_VALUE(ret) 43 + ... 44 + ) 45 + 46 + //---------------------------------------------------------- 47 + // For context mode 48 + //---------------------------------------------------------- 49 + 50 + @depends on runtime_bad_err_handle && context@ 51 + identifier pm_runtime_api; 52 + expression ret; 53 + @@ 54 + ( 55 + ret = pm_runtime_api(...); 56 + ... 57 + * IS_ERR_VALUE(ret) 58 + ... 59 + ) 60 + 61 + //---------------------------------------------------------- 62 + // For patch mode 63 + //---------------------------------------------------------- 64 + 65 + @depends on runtime_bad_err_handle && patch@ 66 + identifier pm_runtime_api; 67 + expression ret; 68 + @@ 69 + ( 70 + ret = pm_runtime_api(...); 71 + ... 72 + - IS_ERR_VALUE(ret) 73 + + ret < 0 74 + ... 75 + ) 76 + 77 + //---------------------------------------------------------- 78 + // For org and report mode 79 + //---------------------------------------------------------- 80 + 81 + @r depends on runtime_bad_err_handle exists@ 82 + position p1, p2; 83 + identifier pm_runtime_api; 84 + expression ret; 85 + @@ 86 + ( 87 + ret = pm_runtime_api@p1(...); 88 + ... 89 + IS_ERR_VALUE@p2(ret) 90 + ... 91 + ) 92 + 93 + @script:python depends on org@ 94 + p1 << r.p1; 95 + p2 << r.p2; 96 + pm_runtime_api << r.pm_runtime_api; 97 + @@ 98 + 99 + cocci.print_main(pm_runtime_api,p1) 100 + cocci.print_secs("IS_ERR_VALUE",p2) 101 + 102 + @script:python depends on report@ 103 + p1 << r.p1; 104 + p2 << r.p2; 105 + pm_runtime_api << r.pm_runtime_api; 106 + @@ 107 + 108 + msg = "%s returns < 0 as error. Unecessary IS_ERR_VALUE at line %s" % (pm_runtime_api, p2[0].line) 109 + coccilib.report.print_report(p1[0],msg)
+17 -8
scripts/package/builddeb
··· 41 41 parisc*) 42 42 debarch=hppa ;; 43 43 mips*) 44 - debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el) ;; 44 + debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;; 45 45 arm*) 46 - debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el) ;; 46 + debarch=arm$(grep -q CONFIG_AEABI=y $KCONFIG_CONFIG && echo el || true) ;; 47 47 *) 48 48 echo "" >&2 49 49 echo "** ** ** WARNING ** ** **" >&2 ··· 62 62 fi 63 63 64 64 # Create the package 65 - dpkg-gencontrol -isp $forcearch -p$pname -P"$pdir" 65 + dpkg-gencontrol -isp $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" 66 66 dpkg --build "$pdir" .. 67 67 } 68 68 ··· 172 172 173 173 # Install the maintainer scripts 174 174 # Note: hook scripts under /etc/kernel are also executed by official Debian 175 - # kernel packages, as well as kernel packages built using make-kpkg 175 + # kernel packages, as well as kernel packages built using make-kpkg. 176 + # make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and 177 + # so do we; recent versions of dracut and initramfs-tools will obey this. 176 178 debhookdir=${KDEB_HOOKDIR:-/etc/kernel} 179 + if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then 180 + want_initrd=Yes 181 + else 182 + want_initrd=No 183 + fi 177 184 for script in postinst postrm preinst prerm ; do 178 185 mkdir -p "$tmpdir$debhookdir/$script.d" 179 186 cat <<EOF > "$tmpdir/DEBIAN/$script" ··· 190 183 191 184 # Pass maintainer script parameters to hook scripts 192 185 export DEB_MAINT_PARAMS="\$*" 186 + 187 + # Tell initramfs builder whether it's wanted 188 + export INITRD=$want_initrd 193 189 194 190 test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d 195 191 exit 0 ··· 298 288 (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be 299 289 ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" 300 290 rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" 301 - arch=$(dpkg --print-architecture) 302 291 303 292 cat <<EOF >> debian/control 304 293 305 294 Package: $kernel_headers_packagename 306 295 Provides: linux-headers, linux-headers-2.6 307 - Architecture: $arch 308 - Description: Linux kernel headers for $KERNELRELEASE on $arch 309 - This package provides kernel header files for $KERNELRELEASE on $arch 296 + Architecture: any 297 + Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch} 298 + This package provides kernel header files for $KERNELRELEASE on \${kernel:debarch} 310 299 . 311 300 This is useful for people who need to build external modules 312 301 EOF