Message ID | Y7QVN0XY+ld2mBk4@qemulion |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4569349wrt; Tue, 3 Jan 2023 03:52:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXvKoCzkPIXHFf/3FnjenX0jdpmdnXmKwHxfro7qB6XXCOYGmVZSzLAEBdsNCWRqiF5PPIeN X-Received: by 2002:a17:906:34db:b0:842:3920:df75 with SMTP id h27-20020a17090634db00b008423920df75mr38943350ejb.33.1672746753179; Tue, 03 Jan 2023 03:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672746753; cv=none; d=google.com; s=arc-20160816; b=tIzIzpmOZtsnXkSnlNw5dgT/KoQi9NnqTh9VxCd3A9FX116Xq1Efg/TE4k4lvj4PAA I1M8ZxdfsQS3/XafgBlll+DXDXCp33VyomWaGVmzX5lvwBR1KA+zejJu2ZI4+9wFqdYY 8pbg5+0F5IFhHwnuymDKw9OMR8l9wYZEUWEOShx94/OwebW9sopDPUmhpD2Bp5Szxvcf 6zyEFR9IoV/yaYgGxGmF/2Hae33DevEPQGWGnyMLo0ZMsTYeObYdG25dkAxlYekIxO2W M7dmGukoysBxY3FgXpIEFKr6w553NZerOAWQ5IxQlr/a6CDqct4173yA05DR+CbhY2A5 eOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=VjPlBnjpRwdgIht9FKVS7dhX9Satoq8LaWKqVyIFLvA=; b=i4qfj7KbwYzEzcuUcZhakqgEcNCiRgzw0PDTP9aJr7RFAGFrsw9eBX+2Y1dvDik6JT zA55Lj8dKZ/KrIJ4UnpGWqZL1MZTEpz87dpx3/claa7qazqLl8LvCv8DmVGfSU66WfTn rakGq8ukAA7jW52CWty4rMcxo4ts7H+IprlpjiqrxBx2K1gz3IgxNtjsofehM0vveJmJ BJO1kocLR73za6BQD5E8XUnYvQKqc0bysNJmRs4MvDx+xhPfUqs7XxivgLYj+6OCRscZ G39d2y5E90WwUH+IjQUrLxN7JtZvpGujRmTM/OR+kcl7SVTIt3WsI64tgwqiz5Hk7Ox3 jQjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=JOv+xNVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js3-20020a17090797c300b007bd112b2764si28027114ejc.381.2023.01.03.03.52.10; Tue, 03 Jan 2023 03:52:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=JOv+xNVK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233103AbjACLpk (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Tue, 3 Jan 2023 06:45:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236914AbjACLpQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Jan 2023 06:45:16 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D59C35F83; Tue, 3 Jan 2023 03:45:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1672746301; bh=hq1Mr8Cwby3ZbX2qb3uIoXDEXzZmuXFc29XcF8N/+r4=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=JOv+xNVKD5112S93a8c7aYmoCdX5KoU6wBhdnCWFfbKPJpGhoWZRjuks+zSBEsw75 SQPqDig8L+0Joav7loNL8qDYPMUh7sgIJsfpHPEyZZveFpTHIJKn7i+T7pkINA6PBZ A56vNK7INh6hKl8O63cSAqsmToub/440/EUs+c68= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Tue, 3 Jan 2023 12:45:01 +0100 (CET) X-EA-Auth: FA+GNfPw6PUD7+tjmQeBh7FR6EBoNuE5zSwpXBGXi4UNiowYmso+Xd15a3rfkgucAXYCHE1qTxBD6g3O2bSauSf9YlqOl8BE Date: Tue, 3 Jan 2023 17:14:55 +0530 From: Deepak R Varma <drv@mailo.com> To: Steve Longerbeam <slongerbeam@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, Deepak R Varma <drv@mailo.com> Subject: [PATCH] staging: media: imx: remove unnecessary return variable Message-ID: <Y7QVN0XY+ld2mBk4@qemulion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754002099752202766?= X-GMAIL-MSGID: =?utf-8?q?1754002099752202766?= |
Series |
staging: media: imx: remove unnecessary return variable
|
|
Commit Message
Deepak R Varma
Jan. 3, 2023, 11:44 a.m. UTC
The function imx_media_fim_set_stream() can directly return 0 instead of
using a ret variable which never changes its value. Issue identified
using the returnvar.cocci Coccinelle semantic patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
drivers/staging/media/imx/imx-media-fim.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--
2.34.1
Comments
On Tue, Jan 3, 2023 at 8:45 AM Deepak R Varma <drv@mailo.com> wrote: > > The function imx_media_fim_set_stream() can directly return 0 instead of > using a ret variable which never changes its value. Issue identified > using the returnvar.cocci Coccinelle semantic patch. > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- > drivers/staging/media/imx/imx-media-fim.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c > index fb6590dcfc36..e719227d4323 100644 > --- a/drivers/staging/media/imx/imx-media-fim.c > +++ b/drivers/staging/media/imx/imx-media-fim.c > @@ -373,7 +373,6 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, > bool on) > { > unsigned long flags; > - int ret = 0; > > v4l2_ctrl_lock(fim->ctrl[FIM_CL_ENABLE]); > > @@ -393,7 +392,7 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, > fim->stream_on = on; > out: > v4l2_ctrl_unlock(fim->ctrl[FIM_CL_ENABLE]); > - return ret; > + return 0; Maybe you could change imx_media_fim_set_stream() to a void function instead?
diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c index fb6590dcfc36..e719227d4323 100644 --- a/drivers/staging/media/imx/imx-media-fim.c +++ b/drivers/staging/media/imx/imx-media-fim.c @@ -373,7 +373,6 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, bool on) { unsigned long flags; - int ret = 0; v4l2_ctrl_lock(fim->ctrl[FIM_CL_ENABLE]); @@ -393,7 +392,7 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, fim->stream_on = on; out: v4l2_ctrl_unlock(fim->ctrl[FIM_CL_ENABLE]); - return ret; + return 0; } int imx_media_fim_add_controls(struct imx_media_fim *fim)