From patchwork Tue May 20 10:33:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 4208821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00586BEEAB for ; Tue, 20 May 2014 10:34:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2307820364 for ; Tue, 20 May 2014 10:34:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51DD920353 for ; Tue, 20 May 2014 10:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753259AbaETKeJ (ORCPT ); Tue, 20 May 2014 06:34:09 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:40337 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753204AbaETKeG (ORCPT ); Tue, 20 May 2014 06:34:06 -0400 Received: by mail-wg0-f41.google.com with SMTP id z12so286915wgg.0 for ; Tue, 20 May 2014 03:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PNayDOwz6KmR5RH3WMI6bfWZtYUYqqInU/7WVVuw3kI=; b=fAlBqq9EcFcFZaCz/tRZ80DiEntYwqcYECfbjWRoTFh1T4FjdTN8WwgbtiiEm4dhfW sDX5eyWCWZjlYM4ZTpCJPf+W6L9LSKG1TBiUWBCwwEtnekql9idOjUX3cpMP2Jt5bzJD vDvytjVwZr/8untjTLHmRHhC0PwXoXvbv/Fq1POYluV1EXNHadyaY7GZgWVVe/uYX4IM w5l9H1iFU+iIcjV50U8jzraY19l07bEqao3xUgcPS1vXOV+a1z05EoWVOVT4OgTmog8R D90YNRv1wYl/GnOAQRK0vFh7nf9FA/PuUspGxfM+SzXYutAE9Mm8/ALF/fS+/NlBvwdr JO+w== X-Received: by 10.180.106.1 with SMTP id gq1mr3141671wib.45.1400582045177; Tue, 20 May 2014 03:34:05 -0700 (PDT) Received: from localhost.localdomain (toshiba-peter.rsr.lip6.fr. [132.227.76.134]) by mx.google.com with ESMTPSA id k2sm17823905wjq.20.2014.05.20.03.34.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 May 2014 03:34:04 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Greg Kroah-Hartman , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] USB: as102_usb_drv.c: Remove useless return variables Date: Tue, 20 May 2014 12:33:46 +0200 Message-Id: <1400582028-24990-6-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret - return ret; + return C; // Signed-off-by: Peter Senna Tschudin --- drivers/staging/media/as102/as102_usb_drv.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 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 diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c index e4a6945..e6f6278 100644 --- a/drivers/staging/media/as102/as102_usb_drv.c +++ b/drivers/staging/media/as102/as102_usb_drv.c @@ -249,7 +249,7 @@ static void as102_free_usb_stream_buffer(struct as102_dev_t *dev) static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) { - int i, ret = 0; + int i; dev->stream = usb_alloc_coherent(dev->bus_adap.usb_dev, MAX_STREAM_URB * AS102_USB_BUF_SIZE, @@ -280,7 +280,7 @@ static int as102_alloc_usb_stream_buffer(struct as102_dev_t *dev) dev->stream_urb[i] = urb; } - return ret; + return 0; } static void as102_usb_stop_stream(struct as102_dev_t *dev) @@ -458,7 +458,6 @@ exit: static int as102_release(struct inode *inode, struct file *file) { - int ret = 0; struct as102_dev_t *dev = NULL; dev = file->private_data; @@ -467,7 +466,7 @@ static int as102_release(struct inode *inode, struct file *file) kref_put(&dev->kref, as102_usb_release); } - return ret; + return 0; } MODULE_DEVICE_TABLE(usb, as102_usb_id_table);