From patchwork Tue Sep 19 18:47:39 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: 9960017 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 D820860568 for ; Tue, 19 Sep 2017 18:50:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA79C28EE2 for ; Tue, 19 Sep 2017 18:50:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8FCF28F0A; Tue, 19 Sep 2017 18:50:24 +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 A230528F00 for ; Tue, 19 Sep 2017 18:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751411AbdISSsG (ORCPT ); Tue, 19 Sep 2017 14:48:06 -0400 Received: from mout.web.de ([212.227.17.12]:56123 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938AbdISSsF (ORCPT ); Tue, 19 Sep 2017 14:48:05 -0400 Received: from [192.168.1.2] ([92.228.164.239]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MVcZf-1dtTH73PXr-00YxKU; Tue, 19 Sep 2017 20:47:43 +0200 Subject: [PATCH 3/3] [media] hdpvr: Return an error code only as a constant in hdpvr_alloc_buffers() From: SF Markus Elfring To: linux-media@vger.kernel.org, Andrew Morton , Arvind Yadav , Hans Verkuil , Jonathan Sims , Laurent Pinchart , Masahiro Yamada , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net> Message-ID: <0be95f0b-cc0e-27cc-5ec1-b5bc1bc48496@users.sourceforge.net> Date: Tue, 19 Sep 2017 20:47:39 +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: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:CqE0lwuKyW2h5EDSJ/1pWq/y/vusJ15v27Qj/YwZB/T/2Gk4aCT faIF7dtxb/zN9SgJer+4yfmcDJvb2EyFfRKB6E/oIva3E89m0RJiUkqplDsN7jngHH8DPhC BwrZIE0K86PGNI0ShiCNOPR5uvvz+JIpBjUn+4dSoHDyXjG0GxjK+DxZrCYvNFDUj6+yWdA 9xvlYGuSuRBSfs/RkGgUA== X-UI-Out-Filterresults: notjunk:1; V01:K0:NiN97fFtaRs=:X6AUoP/aKetv8chDlJU8AP 45PqUc8ptPYfjqTP/G5RM5o1C0rLcb10PoUboLbDbEHsfK9EgaNL2zsAtoLV/uUA/LwKuChG9 224I/2cBtOFd102fet5vFgDDFXsX6/O4ijvrE1EIVYKLPvRglUs3KlXu6zg6Kx+WCqUdHFUyp ikXtkm+xLmLIRH6DqRWKmblzrkWyzv4WHhSpiLjf60VvzlhwXZL1V9VH8RrpMT/9vHLkJDYM0 w2iIghI4MBHlIl9lswmbXdZ+P0Xowdwumqg3OXkj1nwtT02EsgRP83Q51dhmqPqwKTD2c0e6A b6EknG0IJ9JPmBGugIAGwHTx/sOa3II+kMzdQ1iM/4RcbPxHkSao0ASrHH5cnWhWBlwJ1WkMG OeNafoAQvP4DrZwqBNjU3B57CpjWob/6UFhSQX0Yj7ni8dEn8bB9xpFYd/fkX58AkwdC5NYuS +UJ7RImuSXDma9Hfl45olRHQGMB43s1Q0C9HTs6jRpxG/fiOEUIrRhIu0OdHcsdwhp78+687f HQ5Ne7fQbj1Bv/i1++d/vMu9mQdSAXzBiIxsCoHVWDxCAUHrBECK6CAcgNzQlr4bd5SySB6Hy VYYIMoIXsaNs4YFaDR0Fb6uss8Gkta7wlqrl2EutjOEHSQXMQ/LgmDOZQl74C+5zIhJHElVjx tb0Z4cCveIaR2m0lTQQC08u8Vn0Lbp8/b1q3S7ssiatx+/tWP2ofiGODXIslNOBZwoolF2X4I ANRjtpo+J9iGbUe+0DAlweMoxlRGioo7nphkt4QwUa3087BVabV4d88vQpryXF36yeHIrf9wp s5PeIppGaWWyVbOUdQ8Y0tr2GRpenS45Ziyq5M23oU14MMLcYc= 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: Tue, 19 Sep 2017 19:32:36 +0200 * Return an error code without storing it in an intermediate variable. * Delete the local variable "retval" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- drivers/media/usb/hdpvr/hdpvr-video.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index f06efcd70c14..2b39834309d2 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -136,6 +136,5 @@ int hdpvr_free_buffers(struct hdpvr_device *dev) int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) { uint i; - int retval = -ENOMEM; u8 *mem; struct hdpvr_buffer *buf; @@ -181,6 +180,6 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) kfree(buf); exit: hdpvr_free_buffers(dev); - return retval; + return -ENOMEM; }