From patchwork Sat Apr 13 07:14:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 10899337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6ECB417E1 for ; Sat, 13 Apr 2019 07:22:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4704C28E89 for ; Sat, 13 Apr 2019 07:22:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B23328E91; Sat, 13 Apr 2019 07:22:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E7D6528E89 for ; Sat, 13 Apr 2019 07:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=qIudpkxij5GeJt5USJ0wfulfqF3xdCygTRC3IlUs1mU=; b=HVBrw3LmKy2+tnp8Qf3cH3aoGx VUt3gNxefMzzsc3kygJZtZRI6vJgPyPzv+9H1WSkorHWU3hrYJPh39WJ6nbgFnZay0IYRNlucP73x GlkRa7grhYrBC1A38TDUYyA59jhpNixBVQd9XZifncp5nShtNcbuIcHII2IWfPRTWcRryan0nYQaW hRjJjns1sOIWAmHe+1sf1gBhLz86Y9mw3cOPS2gUlQsm+Y4MYNtT8xurRkwApMmSFuwckAdES5TcY 0XW33KtBpu+6tcKFPlQ5LjBYWlO3bbZrfbYDaMiCoopTlJXISzeRnGzbStCftOlFVx6B6+Wmri0SR FNiJ+nCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFCzj-0005jM-6f; Sat, 13 Apr 2019 07:22:35 +0000 Received: from www.osadl.org ([2001:a60:9266:ffff:62:245:132:105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFCyd-0004Q2-V8 for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2019 07:21:43 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7JfAT003435; Sat, 13 Apr 2019 09:20:08 +0200 From: Nicholas Mc Guire To: Russell King Subject: [PATCH 1/4 RFC] ARM: imx legacy: warn on failed allocation Date: Sat, 13 Apr 2019 09:14:17 +0200 Message-Id: <1555139666-948-6-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555139666-948-1-git-send-email-hofrat@osadl.org> References: <1555139666-948-1-git-send-email-hofrat@osadl.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190413_002128_726303_A3676E2F X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Rapoport , Tony Lindgren , Shawn Guo , Sascha Hauer , Janusz Krzysztofik , linux-kernel@vger.kernel.org, Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Nicholas Mc Guire , Fabio Estevam , Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Even in init the allocation can fail and thus should at least warn so that the cause can be identified. Signed-off-by: Nicholas Mc Guire --- Problem located with an experimental coccinelle script Note sure if there is a better solution as this is early in the boot process so not that could be done anyway but fuss - anyway unchecked allocation is not a good thing. Patch was compile-tested with: imx_v4_v5_defconfig (implies CONFIG_MACH_MX27ADS=y) (with some unrelated sparse warnings about unimplemented syscalls and a few checkpatch warnings - covered in the other patches) Patch is against 5.1-rc4 (localversion-next is 20190412) arch/arm/mach-imx/mach-mx27ads.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 6dd7f57..528846f 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c @@ -247,6 +247,7 @@ static void __init mx27ads_regulator_init(void) struct gpio_chip *vchip; vchip = kzalloc(sizeof(*vchip), GFP_KERNEL); + WARN_ON(!vchip); vchip->owner = THIS_MODULE; vchip->label = "LCD"; vchip->base = MX27ADS_LCD_GPIO; From patchwork Sat Apr 13 07:23:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 10899345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EC121515 for ; Sat, 13 Apr 2019 07:29:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1135A2871C for ; Sat, 13 Apr 2019 07:29:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F422028E91; Sat, 13 Apr 2019 07:29:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8FE202871C for ; Sat, 13 Apr 2019 07:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DViK6r1B1FfQTC/9SKfrE+EcHotPce8bi8gVD6XilEw=; b=hJgz8Tx19stgvP3EtacK9ybKX+ DdG8xE4TekuNgywgb8AlRaOljEnLJZhlj4Zo/6akW6pf/pprjvYG/1oannv/FBBU3ShqYSyImP1MZ Xv9101eYwzu82i8fG2AEUWNldr1eW3FIu1yaZARRM180AOeR3ztJZH/OggwdUV2NKYdIk0ZoA7/EL RI8vQnLjUbLmlxnogjXSebVac32aOvQRgc6gXrUhaCmCPXHSrmaMhe2j5HSyXYIYE9QgLIO5ptlEA 6mJH0jn4bF2XCc/g6nXGW2CGHpfrAMx6/we9IbB61Czt7AUQFyzAywz9Pa5huB+Et6MRfEFGcNerB pDeb2oTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFD6J-0008C7-Kq; Sat, 13 Apr 2019 07:29:23 +0000 Received: from www.osadl.org ([2001:a60:9266:ffff:62:245:132:105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFD6F-0008Bp-T8 for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2019 07:29:21 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7Sohd010572; Sat, 13 Apr 2019 09:29:02 +0200 From: Nicholas Mc Guire To: Russell King Subject: [PATCH 2/4] ARM: imx legacy: declare unsigned int rather than unsigned Date: Sat, 13 Apr 2019 09:23:31 +0200 Message-Id: <1555140213-1081-3-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555140213-1081-1-git-send-email-hofrat@osadl.org> References: <1555140213-1081-1-git-send-email-hofrat@osadl.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190413_002920_238985_390431D4 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Rapoport , Tony Lindgren , Shawn Guo , Sascha Hauer , Janusz Krzysztofik , linux-kernel@vger.kernel.org, Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Nicholas Mc Guire , Fabio Estevam , Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP provide the proper type for unsigned int. Signed-off-by: Nicholas Mc Guire --- Problem reported by checkpatch Patch was compile-tested with: imx_v4_v5_defconfig (implies CONFIG_MACH_MX27ADS=y) Patch is against 5.1-rc4 (localversion-next is 20190412) arch/arm/mach-imx/mach-mx27ads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 528846f..49ac898 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c @@ -202,7 +202,7 @@ static const struct imxi2c_platform_data mx27ads_i2c1_data __initconst = { static struct i2c_board_info mx27ads_i2c_devices[] = { }; -static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value) +static void vgpio_set(struct gpio_chip *chip, unsigned int offset, int value) { if (value) imx_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG); @@ -210,7 +210,7 @@ static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value) imx_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG); } -static int vgpio_dir_out(struct gpio_chip *chip, unsigned offset, int value) +static int vgpio_dir_out(struct gpio_chip *chip, unsigned int offset, int value) { return 0; } From patchwork Sat Apr 13 07:23:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 10899349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D222E1515 for ; Sat, 13 Apr 2019 07:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54A661FEBD for ; Sat, 13 Apr 2019 07:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 409DE28E8B; Sat, 13 Apr 2019 07:29:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D3212871C for ; Sat, 13 Apr 2019 07:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hGOpuuctGfnAz+pnrfniwwBFQQ31UzI3x2v1Uumhqck=; b=uTrTUpAWGn7WSAyydbdwZwDFzm t1s+TA0Yi5800BjsgS9kPL1fYbc1kMi6y8VVUhsHuuJB/ZUHeUY59hDB3+Ga3iLfsFHIDdMzduNsT W7AZm8uMc18Vw/6EIxZiJMFXiot3FI6kGKNJJ61JY+glIpp8dgacAEnDaDGPwyWbkYmaxvxKMYz1V Ox4SGji0nyrgJNzWKy1uxMsMvtM+2d2ENZp0paYHuJUg6OUCtk2KI9X6WQ5X8a4s6Vl1/7tyC5ZrD sWkahg7xVgasf/AsEmVcMK0Qatn1mUxB6CSw1H3n6s1nOFMjhn469ZjEWAS0iMdl/fMOdN36eBMIv CwNJ0QxQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFD6S-0008Mh-Ht; Sat, 13 Apr 2019 07:29:32 +0000 Received: from www.osadl.org ([2001:a60:9266:ffff:62:245:132:105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFD6J-0008C6-Ki for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2019 07:29:25 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7Sohe010572; Sat, 13 Apr 2019 09:29:07 +0200 From: Nicholas Mc Guire To: Russell King Subject: [PATCH 3/4 RFC] ARM: imx legacy: wrap complex macro in () Date: Sat, 13 Apr 2019 09:23:32 +0200 Message-Id: <1555140213-1081-4-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555140213-1081-1-git-send-email-hofrat@osadl.org> References: <1555140213-1081-1-git-send-email-hofrat@osadl.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190413_002924_021077_2E2CE8FD X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Rapoport , Tony Lindgren , Shawn Guo , Sascha Hauer , Janusz Krzysztofik , linux-kernel@vger.kernel.org, Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Nicholas Mc Guire , Fabio Estevam , Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Checkpatch suggests to place a parenthesis around this complex macro. Signed-off-by: Nicholas Mc Guire --- Problem reported by checkpatch I'm actually not sure this really is improving readability but by default checkpatch gets it right so... Patch was compile-tested with: imx_v4_v5_defconfig (implies CONFIG_MACH_MX27ADS=y) Patch is against 5.1-rc4 (localversion-next is 20190412) arch/arm/mach-imx/mach-mx27ads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 49ac898..c83fdd3 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c @@ -42,8 +42,8 @@ * Base address of PBC controller, CS4 */ #define PBC_BASE_ADDRESS 0xf4300000 -#define PBC_REG_ADDR(offset) (void __force __iomem *) \ - (PBC_BASE_ADDRESS + (offset)) +#define PBC_REG_ADDR(offset) ((void __force __iomem *) \ + (PBC_BASE_ADDRESS + (offset))) /* When the PBC address connection is fixed in h/w, defined as 1 */ #define PBC_ADDR_SH 0