From patchwork Fri Sep 8 20:53:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9945033 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 C806F604D4 for ; Fri, 8 Sep 2017 20:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB09928914 for ; Fri, 8 Sep 2017 20:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFCF528916; Fri, 8 Sep 2017 20:54:31 +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=unavailable 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 55AA528914 for ; Fri, 8 Sep 2017 20:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932522AbdIHUyP (ORCPT ); Fri, 8 Sep 2017 16:54:15 -0400 Received: from mout.web.de ([217.72.192.78]:55376 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757089AbdIHUyO (ORCPT ); Fri, 8 Sep 2017 16:54:14 -0400 Received: from [192.168.1.2] ([92.228.166.205]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MDgDS-1dg2IA2ptm-00H9Dp; Fri, 08 Sep 2017 22:53:36 +0200 Subject: [PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four functions From: SF Markus Elfring To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, Andrzej Hajda , Jeongtae Park , Kamil Debski , Kyungmin Park , Marek Szyprowski , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <482a6c92-a85e-0bcd-edf7-3c2f63ea74c5@users.sourceforge.net> Message-ID: Date: Fri, 8 Sep 2017 22:53:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <482a6c92-a85e-0bcd-edf7-3c2f63ea74c5@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:rvBWpKC9cR+S4kDMNyyx+ovEMLYokT6K7bMVN3+dKIvCDp05j6A JOWMy7U/XpsMpAvMZN4q1MUMRYGcEbhsPmul1YiI0OzxkbLWesMN7WKQQt5vwYJ0cYc7ZbY jz6Q+AiWPi7pqziwZ04VxSROCkkT2hZNXbfll8P4Qop938tKcOpHogXXiMECZZIVX22cHJC 1ajuGRCZA638CkPlR5Pqw== X-UI-Out-Filterresults: notjunk:1; V01:K0:IItmpIMTf58=:dXWjSMciECVJU1fd/Dr03N 3JwATxaqUhbEOUk0rSCcFkV911ZRdmkV6azs4A0e5JhtEYDnouwpbJntVKM26wsWt7K0u4W7R FVVg6wl3JlrcOoMhuoMF/oWNTKECU1GjafZaJsf4DXboBfcMRvBU1xHDm/ifjL9xGcLfuWWbf 7ZOFkdkCXQb2p4jNug5J/w+/ETuS+dGyz+KB4k8t8VlLuBgOI2Xvkaq7JWbHJe3Hk9BAuF2qu 4TW/pUDfTPSHYVJFifENwLbynZoHmzOzsn0jeuXdn7qzSyASeGKu27RlRAz1dyIv5+OpsyjOq Jr2gU7ftMDWG/dPlSZsjDW47dnhM739tlOZZsdFKYCrNftjxz9e8W0GROVLT38cTEJvYjqhcN j3srjhAqjz8uiD7SiDiEQlRfDsMk/08wfJ5T1mR3iVWsUnrMhf34JD/XP39rxb5Fz3LcWea2Y FAbGJ6SF4o2L6P2vEk/EkbK5ZQg2M9dPwFAq18+IDZXO4fTpdzNRx1eVj/slRv+E1hH0vgNHM FsM1Em+OxvyqGoHvK/0Y9xhHsBQ3okGLlLBbWfhcekVKQ7CWQEnrW9VIyLdymh8w/+aYwXdOk TgnrcIb+r7f4XhYgTtJfAmcPVPhvXcavzmsa3iOYVjyX5o964xBvUkV6uybXoMyJHsCtcQ9t0 JmPymlvn5gQp1rqbjnsz7W3jp9MehdrRrJ/6kfwHJmUs5kF0MXk4+0ABwiLfLUDHKftLHG6G4 QdepfUMCrn8rpfbZ81uwEeoDChPBu7NSmtLroR8di4OBQqvtJO/yOHIc+CzZ8qEXQUx/yyAzC bDZ3fCjCUs340uBK3zqw8+2YM/d5Q85YTVUMz85qrWNqmlGu68= 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 From: Markus Elfring Date: Fri, 8 Sep 2017 22:37:00 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written … Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index abfb70b07032..cf68aed59e0d 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -470,7 +470,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, { mfc_err("Interrupt Error: %08x\n", err); - if (ctx != NULL) { + if (ctx) { /* Error recovery is dependent on the state of context */ switch (ctx->state) { case MFCINST_RES_CHANGE_INIT: @@ -508,7 +508,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, { struct s5p_mfc_dev *dev; - if (ctx == NULL) + if (!ctx) return; dev = ctx->dev; if (ctx->c_ops->post_seq_start) { @@ -562,7 +562,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *src_buf; struct s5p_mfc_dev *dev; - if (ctx == NULL) + if (!ctx) return; dev = ctx->dev; s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); @@ -1289,7 +1289,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) return PTR_ERR(dev->regs_base); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (res == NULL) { + if (!res) { dev_err(&pdev->dev, "failed to get irq resource\n"); return -ENOENT; }