From patchwork Sun Sep 17 13:32:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9954813 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 19596603F2 for ; Sun, 17 Sep 2017 13:33:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C91C28974 for ; Sun, 17 Sep 2017 13:33:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0117128881; Sun, 17 Sep 2017 13:33:47 +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 E281928704 for ; Sun, 17 Sep 2017 13:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377AbdIQNdI (ORCPT ); Sun, 17 Sep 2017 09:33:08 -0400 Received: from mout.web.de ([212.227.17.12]:53744 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbdIQNdH (ORCPT ); Sun, 17 Sep 2017 09:33:07 -0400 Received: from [192.168.1.2] ([77.181.201.34]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MVtxM-1dve7O0MwK-00X4Ek; Sun, 17 Sep 2017 15:32:58 +0200 Subject: [PATCH 2/4] [media] cpia2: Adjust two function calls together with a variable assignment From: SF Markus Elfring To: linux-media@vger.kernel.org, Arvind Yadav , Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , Shyam Saini Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Sun, 17 Sep 2017 15:32:56 +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: Content-Language: en-GB X-Provags-ID: V03:K0:1qdM4qprU7D+vgefTYDe93zh/WSNAbT5iJkpZljqbqebRRWJDKM oXQyC8WBBK/N1w6dZdPBFGaGWQhvf86LFemeTpib26dnxJqa2whDPvjdf6WIzEei9BBOglr WE8G7WpdDoCeyKIZ7CHaXsadMfKXuevusJcqdNXjrXgxcgRMm76sMZG4c93R6Eejt4ddJVf l97i969wy9vwpT9RNV1Fw== X-UI-Out-Filterresults: notjunk:1; V01:K0:cJSKKfLpzWY=:a4UOWcCTLUzxZW11Hd/DY/ cUN5MM00caTVhE+ogurzaal/32YEKxOpAdy8+qTWKsYjzkbvW3oh8FUFD2Mc8D4NoG1mfp58a 85S4l01eoYf09UtafkT8wPOqEJQHMRKWhyA2x2B+FuzP454UagWOZ5tTeakOHeh9F4RHvszta 0YCvZ4TXGYspFEvCkvvCaiaglEd1LuGGIVp61Fe65Jj7+nm0qPpTKZtBzHSI/0epa2KWGeB4b 66A2xzeA+1g0tdYZUHbNH53K8ml2TJ0uq3bYFzc0CWivsulmKsRcINRSEoCcZk62IS483SCqF qGripX/htUSokuuTJYGmkUSdMCz7cXfu+UX1NQRGSBqH/FxVKxhumI0mO0nN5XtH7KbMWh3cH OIhZ5wI1mduYDEBhKBi57P5Ah1BKmW4WViZfUjUp4Sr6WRrD+tN389Eg71sf8Fn7no6pOmkmY h+URyY8ZjzaIZk4aktue2Ehs3oE0fZSG0K4BhbVR1/Xw1R+AN/xlhaK7MO5ob6gFvIAcGLef3 d86WQ3mZ2EP2DiTFmyLxhc5aPRTYBSgVgexOxS+P4vsTZdgQACzfdqmMtiVpf/uEiCCTiQuer a9smM5KuYjZl27sAxl1OQvcIndZPfTHu7Q0pvi/xMBvCO+FAUzgCaIE8fQxGl8XDat634/TRg woTLQrDC0z8L60tQ4peZqnBolc8KVG1PQvSUPmo8FVDxBHK3xkejz126ubqVHYA1sDHYe3Emx gi5iu5ERLyS9bfwFi/w3AibF20d43tiQALhuJ7GZY9bDcGFWatZuFSTDgbz1oksAYSe29WrRP D3hEibnMKVDFAFu/CyPNknvcWBZuVm572WCmtluuekriGoMQUc= 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: Sun, 17 Sep 2017 12:56:50 +0200 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/usb/cpia2/cpia2_usb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c index c6be2786a66f..161c9b827f8e 100644 --- a/drivers/media/usb/cpia2/cpia2_usb.c +++ b/drivers/media/usb/cpia2/cpia2_usb.c @@ -367,7 +367,8 @@ static void cpia2_usb_complete(struct urb *urb) if(cam->streaming) { /* resubmit */ urb->dev = cam->dev; - if ((i = usb_submit_urb(urb, GFP_ATOMIC)) != 0) + i = usb_submit_urb(urb, GFP_ATOMIC); + if (i != 0) ERR("%s: usb_submit_urb ret %d!\n", __func__, i); } } @@ -852,5 +853,5 @@ static int cpia2_usb_probe(struct usb_interface *intf, } - - if((ret = cpia2_init_camera(cam)) < 0) { + ret = cpia2_init_camera(cam); + if (ret < 0) { ERR("%s: failed to initialize cpia2 camera (ret = %d)\n", __func__, ret);