From patchwork Thu Feb 11 14:34:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 8280981 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 508D5BEEE5 for ; Thu, 11 Feb 2016 14:38:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A3AD2009C for ; Thu, 11 Feb 2016 14:38:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A83982035D for ; Thu, 11 Feb 2016 14:38:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTsNt-00074X-7D; Thu, 11 Feb 2016 14:38:17 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTsLV-0004iG-AZ for linux-mediatek@lists.infradead.org; Thu, 11 Feb 2016 14:35:53 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2E0048P0J1WO70@mailout3.w1.samsung.com> for linux-mediatek@lists.infradead.org; Thu, 11 Feb 2016 14:35:25 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-17-56bc9c2dcd8e Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 32.60.21385.D2C9CB65; Thu, 11 Feb 2016 14:35:25 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2E002B10J0O9B0@eusync4.samsung.com>; Thu, 11 Feb 2016 14:35:25 +0000 (GMT) From: Andrzej Hajda To: Linus Walleij , Biao Huang , linux-gpio@vger.kernel.org (open list:PIN CONTROL SUBSYSTEM) Subject: [PATCH] pinctrl: mediatek: fix handling return value of mtk_pmx_find_gpio_mode Date: Thu, 11 Feb 2016 15:34:08 +0100 Message-id: <1455201248-4988-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprALMWRmVeSWpSXmKPExsVy+t/xa7q6c/aEGXT/lrG4te4cq8XGGetZ LZ7v+cVucWRfJ7PFlD/LmSw2z//DaHG5+SKjxdojd9ktmlqMLa53PWBx4PLYOesuu8eda3vY PDYvqfdoObmfxaNvyypGj8+b5ALYorhsUlJzMstSi/TtErgyZmxrZSno5qh4/n0vSwPjZ7Yu Rk4OCQETiY1HZkHZYhIX7q0Hsrk4hASWMkrc+TGFEcJpYpK4vvc6O0gVm4CmxN/NN8GqRASm MEpMuPgCzGEWeMoksfPnYyaQKmGBSIkX7fdZQWwWAVWJowv3g8V5BZwk3qy9ywqxT07i5LHJ rBMYuRcwMqxiFE0tTS4oTkrPNdIrTswtLs1L10vOz93ECAmnrzsYlx6zOsQowMGoxMMbUL87 TIg1say4MvcQowQHs5IIb+jsPWFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeWfueh8iJJCeWJKa nZpakFoEk2Xi4JRqYGQ6eqC+4O8NQZ5X6YUWay94dXVaPEn4qFm5p+p2qsz7CY4XG49JBjzv DHoScs/Bbu3yG0cLnS7alPIy7ZNo/P5MKyBTZpZ0ql3KurX/96ozPd3Wcemj06vPC65ycx94 G2OT9fr6jMaWxsqm5Qx+rhJJIl+0QnWOPp8qd9xlyk1bHvbzBloT/iixFGckGmoxFxUnAgBt 5vMKIwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_063549_816428_F757D7C5 X-CRM114-Status: GOOD ( 11.98 ) X-Spam-Score: -7.1 (-------) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz , Hongzhou Yang , Andrzej Hajda , "moderated list:ARM/Mediatek SoC support" , Matthias Brugger , Yingjoe Chen , Marek Szyprowski MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 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 The function can return negative values, so its result should be assigned to signed variable. The problem has been detected using coccinelle semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci. Fixes: 59ee9c9 ('pinctrl: mediatek: Add gpio_request_enable support') Signed-off-by: Andrzej Hajda Acked-by: Hongzhou Yang --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index cbc2204..ddc9217 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -755,7 +755,7 @@ static int mtk_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, struct pinctrl_gpio_range *range, unsigned offset) { - unsigned long muxval; + int muxval; struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); muxval = mtk_pmx_find_gpio_mode(pctl, offset);