]> code.ossystems Code Review - openembedded-core.git/commitdiff
linux-dtb.inc: explicit test for empty string not needed
authorStefan Christ <s.christ@phytec.de>
Mon, 26 Oct 2015 08:20:35 +0000 (09:20 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Nov 2015 11:28:36 +0000 (11:28 +0000)
The for loop already handles the case when KERNEL_DEVICETREE is empty.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-kernel/linux/linux-dtb.inc

index 173e945ef6777e7705ce96ddcff99dd4620208f7..2b8b11f084fe790e842f6828e2645d9d33b326c7 100644 (file)
@@ -6,54 +6,48 @@ python __anonymous () {
 }
 
 do_compile_append() {
-       if test -n "${KERNEL_DEVICETREE}"; then
-               for DTB in ${KERNEL_DEVICETREE}; do
-                       if echo ${DTB} | grep -q '/dts/'; then
-                               bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
-                               DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
-                       fi
-                       oe_runmake ${DTB}
-               done
-       fi
+       for DTB in ${KERNEL_DEVICETREE}; do
+               if echo ${DTB} | grep -q '/dts/'; then
+                       bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+                       DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+               fi
+               oe_runmake ${DTB}
+       done
 }
 
 do_install_append() {
-       if test -n "${KERNEL_DEVICETREE}"; then
-               for DTB in ${KERNEL_DEVICETREE}; do
-                       if echo ${DTB} | grep -q '/dts/'; then
-                               bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
-                               DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
-                       fi
-                       DTB_BASE_NAME=`basename ${DTB} .dtb`
-                       DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-                       DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
-                       if [ ! -e "${DTB_PATH}" ]; then
-                               DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
-                       fi
-                       install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
-               done
-       fi
+       for DTB in ${KERNEL_DEVICETREE}; do
+               if echo ${DTB} | grep -q '/dts/'; then
+                       bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+                       DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+               fi
+               DTB_BASE_NAME=`basename ${DTB} .dtb`
+               DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+               DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+               if [ ! -e "${DTB_PATH}" ]; then
+                       DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+               fi
+               install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
+       done
 }
 
 do_deploy_append() {
-       if test -n "${KERNEL_DEVICETREE}"; then
-               for DTB in ${KERNEL_DEVICETREE}; do
-                       if echo ${DTB} | grep -q '/dts/'; then
-                               bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
-                               DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
-                       fi
-                       DTB_BASE_NAME=`basename ${DTB} .dtb`
-                       DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-                       DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-                       DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
-                       if [ ! -e "${DTB_PATH}" ]; then
-                               DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
-                       fi
-                       install -d ${DEPLOYDIR}
-                       install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
-                       ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb
-               done
-       fi
+       for DTB in ${KERNEL_DEVICETREE}; do
+               if echo ${DTB} | grep -q '/dts/'; then
+                       bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+                       DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+               fi
+               DTB_BASE_NAME=`basename ${DTB} .dtb`
+               DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+               DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+               DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+               if [ ! -e "${DTB_PATH}" ]; then
+                       DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+               fi
+               install -d ${DEPLOYDIR}
+               install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
+               ln -sf ${DTB_NAME}.dtb ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.dtb
+       done
 }
 
 pkg_postinst_kernel-devicetree () {