From patchwork Tue Sep 6 14:51:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9317153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44A3260752 for ; Tue, 6 Sep 2016 14:51:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3464A28C97 for ; Tue, 6 Sep 2016 14:51:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2933E28DD1; Tue, 6 Sep 2016 14:51:35 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94E7B28C97 for ; Tue, 6 Sep 2016 14:51:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756810AbcIFOv0 (ORCPT ); Tue, 6 Sep 2016 10:51:26 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:43126 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756807AbcIFOvY (ORCPT ); Tue, 6 Sep 2016 10:51:24 -0400 X-IronPort-AV: E=Sophos;i="5.30,292,1470693600"; d="scan'208";a="235440447" Received: from unknown (HELO hadrien.local) ([61.8.221.8]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Sep 2016 16:51:18 +0200 Date: Tue, 6 Sep 2016 22:51:15 +0800 (SGT) From: Julia Lawall X-X-Sender: jll@hadrien To: Tiffany Lin cc: Hans Verkuil , Mauro Carvalho Chehab , linux-media@vger.kernel.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PTR_ERR should access the value just tested by IS_ERR Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Tiffany Lin Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Reviewed-by:Tiffany Lin --- mtk_vcodec_dec_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -255,7 +255,7 @@ static int mtk_vcodec_probe(struct platf } dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR((__force void *)dev->reg_base[i])) { - ret = PTR_ERR((__force void *)dev->reg_base); + ret = PTR_ERR((__force void *)dev->reg_base[i]); goto err_res; } mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);