From patchwork Sun Dec 25 18:32:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9488275 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 BE66E60471 for ; Sun, 25 Dec 2016 18:32:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B01331FF8E for ; Sun, 25 Dec 2016 18:32:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2C2F20246; Sun, 25 Dec 2016 18:32:43 +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 31A431FF8E for ; Sun, 25 Dec 2016 18:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753140AbcLYScX (ORCPT ); Sun, 25 Dec 2016 13:32:23 -0500 Received: from mout.web.de ([217.72.192.78]:59128 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbcLYScW (ORCPT ); Sun, 25 Dec 2016 13:32:22 -0500 Received: from [192.168.1.2] ([77.182.80.223]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M9GJ0-1cGJlI2khS-00Cexh; Sun, 25 Dec 2016 19:32:14 +0100 Subject: [PATCH 03/19] [media] uvc_driver: Adjust three function calls together with a variable assignment To: linux-media@vger.kernel.org, Laurent Pinchart , Mauro Carvalho Chehab References: <47aa4314-74ec-b2bf-ee3b-aad4d6e9f0a2@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <5d6e7fac-d464-687b-ef87-d813d707911f@users.sourceforge.net> Date: Sun, 25 Dec 2016 19:32:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <47aa4314-74ec-b2bf-ee3b-aad4d6e9f0a2@users.sourceforge.net> X-Provags-ID: V03:K0:3PCL7mCvcYnCS3bFvhXa3kXELz9wOzLQ4qu7Bc839t0RpFEpIzS sUbewsNV1o4iithZYlS8mSELaL2P6xtm4rKSnEWJ2rde6UheRj1idNaNukJkUVCtw4C5/fW /9rHN0IxGM7ZomSPh1UaCD6hQiLrmlGzcFIsTTbaKnG3jlkOzzCjXZ9U3XzruEIjZ4LFv73 /B/TumneaA0XSdupQpmyg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/g7LcGsrB3M=:v+l8TCEPOz0W1iO1GQnXFT EbjMceS0f3qaNmOXEBQM0tYrZwIkh+8Ex1RmXR+wYE72t6qFaYiwfEIG71d0y4NOgCnKhJy/y i9BCw90pmxHQv9DPE01GyMfaKuMZtMNHiJlYwVln0MwmVgh0D5Tym+4uYNFAax5MRP3fjFEuW pQieCICR5k9mGZsyOqujNsMYI4h7Dr8CwuHFYdAAaR9tShXJ/imhRys+9NbdovheBmToYrpZf k2L/zSQTjrwstlhg7wpu7l005OXmfxoesIqLdCxZV0nDN0wrESBx+4pkmCxzNQvDpPT9MMpMK rFORcrmgpcryY/PFZdzegGOlg32pPWDV0EG9WayIdhS0gdd62we83bWOEEFksA5D1GnhOWGGr lsK+wctwCWdZIqX43wZ4tqfv7nni6AtyNSTJJWi0e/J7CjNj3B+KXS8ibfgC/vmhnwN67OalR UvSL58WEtKDeF8nmyGBGsrPZimTHitaBJAl6k82EDecKaLVv2PowXbnf7sElO1u+LlLaMAiMt 4gI/O6NA9ioaoqeyiaRcU1vI1zDfTnYrlIe91udv9eYuqm48EF2y6RptOlFnVwon4LX1/7FLu 1Jy+612+VaxABWGUGjUAXiznXCNuruD4zG0OEpBrYHSvYp9Acfn6/tYhH3OjQroWbfSL7xwqe ubTcIZmCaKciD1W57+p5BeWQowuW7NNIVwp0AQg+Ai9b+fYj1yOHKj1c9PAYG1hJ/8rGAU3zn bI8MDv7hH0OQlLFwW+vFXK0o/w0fzv++gw997pnDjPDTz1TcmpXCk7MJjfZrXuFMNx5RHXAsJ ukVpwzT 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, 25 Dec 2016 08:05:58 +0100 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/uvc/uvc_driver.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 7c42be2414ea..bddaf98ef828 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -1275,7 +1275,8 @@ static int uvc_parse_control(struct uvc_device *dev) buffer[1] != USB_DT_CS_INTERFACE) goto next_descriptor; - if ((ret = uvc_parse_standard_control(dev, buffer, buflen)) < 0) + ret = uvc_parse_standard_control(dev, buffer, buflen); + if (ret < 0) return ret; next_descriptor: @@ -2030,7 +2031,8 @@ static int uvc_probe(struct usb_interface *intf, udev->devpath); /* Allocate memory for the device and initialize it. */ - if ((dev = kzalloc(sizeof *dev, GFP_KERNEL)) == NULL) + dev = kzalloc(sizeof(*dev), GFP_KERNEL); + if (!dev) return -ENOMEM; INIT_LIST_HEAD(&dev->entities); @@ -2113,11 +2115,11 @@ static int uvc_probe(struct usb_interface *intf, usb_set_intfdata(intf, dev); /* Initialize the interrupt URB. */ - if ((ret = uvc_status_init(dev)) < 0) { + ret = uvc_status_init(dev); + if (ret < 0) uvc_printk(KERN_INFO, "Unable to initialize the status endpoint (%d), status interrupt will not be supported.\n", ret); - } uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n"); usb_enable_autosuspend(udev);