From patchwork Thu Jun 13 13:10:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 2716431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E0029F4BB for ; Thu, 13 Jun 2013 13:30:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 206DC2028F for ; Thu, 13 Jun 2013 13:30:57 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B862E20286 for ; Thu, 13 Jun 2013 13:30:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Un7L5-00014x-RT; Thu, 13 Jun 2013 13:13:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Un7Jw-0003xG-Gt; Thu, 13 Jun 2013 13:12:08 +0000 Received: from jacques.telenet-ops.be ([195.130.132.50]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Un7JR-0003tu-Ie for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2013 13:11:40 +0000 Received: from ayla.of.borg ([84.193.72.141]) by jacques.telenet-ops.be with bizsmtp id npB41l00Y32ts5g0JpB40a; Thu, 13 Jun 2013 15:11:12 +0200 Received: from geert by ayla.of.borg with local (Exim 4.71) (envelope-from ) id 1Un7Iu-0008FV-GD; Thu, 13 Jun 2013 15:11:04 +0200 From: Geert Uytterhoeven To: Yoshinori Sato , Simon Horman , Magnus Damm , Russell King , Paul Mundt Subject: [PATCH 0/3] Use POSIX "$((..))" instead of bashism "$[...]" Date: Thu, 13 Jun 2013 15:10:49 +0200 Message-Id: <1371129052-31506-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.0.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130613_091137_951531_42339F07 X-CRM114-Status: GOOD ( 10.32 ) X-Spam-Score: -1.9 (-) Cc: linux-kbuild@vger.kernel.org, Thorsten Glaser , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, David McCullough , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series replaces the bash-specific "$[...]" by POSIX "$((..))" for arithmetic expansion, and gets rid of some dependencies on bash. [1/3] h8300/boot: Use POSIX "$((..))" instead of bashism "$[...]" [2/3] ARM: shmobile: Use POSIX "$((..))" instead of bashism "$[...]" [3/3] sh/boot: Use POSIX "$((..))" instead of bashism "$[...]" The first one is a build fix on systems where /bin/sh is not bash, as it uses the bashism without forcing bash. This series was tested using the patch at the bottom, and running make ARCH=h8300 clean make ARCH=arm clean make ARCH=sh clean with an optional "SHELL=/bin/..." appended, to test difference shells, on Ubuntu 10.04.4 LTS. It works fine with bash (4.1-2ubuntu3) and dash (0.5.5.1-3ubuntu2). With mksh (39.3-1ubuntu3), 32-bit integers seem to be sign-extended to 64-bit integers, e.g. arch/sh/boot/Makefile: KERNEL_MEMORY = 0x0c000000 arch/sh/boot/Makefile: KERNEL_LOAD = 0xffffffff8c001000 arch/sh/boot/Makefile: KERNEL_ENTRY = 0xffffffff8c002000 arch/sh/boot/compressed/Makefile: IMAGE_OFFSET = 0xffffffff8c800000 Should these be truncated to 32-bit explicitly, or is this a bug in mksh? Thanks for your comments! Gr{oetje,eeting}s, Geert --- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds In-Reply-To: diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 1ba358b..5029108 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -319,3 +319,5 @@ define archhelp echo ' (distribution) /sbin/$(INSTALLKERNEL) or' echo ' install to $$(INSTALL_PATH) and run lilo' endef + +include arch/arm/mach-shmobile/Makefile.boot diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot index 498efd9..95ebc7c 100644 --- a/arch/arm/mach-shmobile/Makefile.boot +++ b/arch/arm/mach-shmobile/Makefile.boot @@ -7,3 +7,5 @@ __ZRELADDR := $(shell /bin/bash -c 'printf "0x%08x" \ # #params_phys-y (Instead: Pass atags pointer in r2) #initrd_phys-y (Instead: Use compiled-in initramfs) + +XXX := $(shell echo arch/arm/mach-shmobile/Makefile.boot: __ZRELADDR = $(__ZRELADDR) >> /tmp/loggy) diff --git a/arch/h8300/boot/compressed/Makefile b/arch/h8300/boot/compressed/Makefile index 6745cb1..94faad1 100644 --- a/arch/h8300/boot/compressed/Makefile +++ b/arch/h8300/boot/compressed/Makefile @@ -35,3 +35,5 @@ OBJCOPYFLAGS := -O binary $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE $(call if_changed,ld) + +XXX := $(shell echo arch/h8300/boot/compressed/Makefile: IMAGE_OFFSET = $(IMAGE_OFFSET) >> /tmp/loggy) diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index 58592df..4ab2ba5 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile @@ -113,3 +113,7 @@ $(obj)/uImage: $(obj)/uImage.$(suffix-y) export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \ CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \ KERNEL_MEMORY suffix-y + +XXX := $(shell echo arch/sh/boot/Makefile: KERNEL_MEMORY = $(KERNEL_MEMORY) >> /tmp/loggy) +XXX := $(shell echo arch/sh/boot/Makefile: KERNEL_LOAD = $(KERNEL_LOAD) >> /tmp/loggy) +XXX := $(shell echo arch/sh/boot/Makefile: KERNEL_ENTRY = $(KERNEL_ENTRY) >> /tmp/loggy) diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index 23bc849..43d1b9a 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile @@ -79,3 +79,5 @@ LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE $(call if_changed,ld) + +XXX := $(shell echo arch/sh/boot/compressed/Makefile: IMAGE_OFFSET = $(IMAGE_OFFSET) >> /tmp/loggy)