From patchwork Tue Jan 3 17:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 38564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4742977wrt; Tue, 3 Jan 2023 09:52:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuYkZ5jkkbx4D+OHTCJxjZ9FXdDiy4ZSJzdyTUgqaav8qJ6hl9K3OFHDNs++1VUpiOkXSk0 X-Received: by 2002:a17:906:82c3:b0:7c1:9041:8c5 with SMTP id a3-20020a17090682c300b007c1904108c5mr52725048ejy.41.1672768356461; Tue, 03 Jan 2023 09:52:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672768356; cv=none; d=google.com; s=arc-20160816; b=UWi/bZMSX9+ufeLCjl4bAI/Ts8ZUYwKm5UXJP9Y3B4/LKh0Za2JjSczCWO+CFNgs8S BRNnZg2Z315gmvUpmPNZqAs8FlFhFoH214w0ua49HqSwiqa/qCQiDevnVh50/s4RwigW 1GL2VODRZCo5jdLNbGrcAbfiw/MZIPZoOdfbe0wzdN+UGDNya1tQ4rOymW6MHmGJ2zq/ ikFUsyZG6QfmMESoEp+VF0gluNwvkuU9ZUUcyIAdz/PC7tRGdpswozhILccuEQybj3V/ IMi1wvEo9lOkMDLhg/fzZwvlJhalJ9v3/kb1Au8d9XywYJzPssDIRBQ6/RylWmVzlVNj oHBQ== 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=nkth7modkP32rZAKNOnPB5MngeDbBmpDpwMpspeGpqM=; b=GLAEJewLvxdi4bvGrCQmj1GVu2LUXcdgRP+pyAzQFUH56ALeVHEeHRR/4YWgQJBMJ3 ay5ASbq4LufnABS2PWLks4y4qmqJnUHbWDwsYAQHZ2RhiQL+BuDM0VfuaRn6tF6CPuoc 0Sjd4PVGjMaJXLbV51NXNxLPGiqEoMwVCT52AIJJ7k51gWzR+4HN5aQ7LDqPuynwQDtv D6jH6YPCfbOw6MVyqIkGU4eDiS/yORoTZyvYRxXuIz1CTyhb054jtC/MiTkU8loFiFIq 8CBZJJNg+5U0KjISyAbPVjAWv14cAI33vI65/F25oyGYjenmOtwYBZQEdHS59WUPPDVb Yqcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=WXpvchx+; 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 xj4-20020a170906db0400b007c0a70496desi28732584ejb.724.2023.01.03.09.52.12; Tue, 03 Jan 2023 09:52:36 -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=WXpvchx+; 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 S233950AbjACRjJ (ORCPT + 99 others); Tue, 3 Jan 2023 12:39:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238538AbjACRin (ORCPT ); Tue, 3 Jan 2023 12:38:43 -0500 X-Greylist: delayed 20468 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 03 Jan 2023 09:38:39 PST Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53931274C; Tue, 3 Jan 2023 09:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1672767507; bh=zGphmZiu7gBvnxZkhoRCgj7hOsYAa02g9k+8xEUGwcw=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=WXpvchx+pYX7cFVZ/qAfnVS2mrUSK2fuxpxOP4MwYG8ncjPVFu+0GkQgMEmarweMB do5fx3QDzUEFza5B34p8axO0ymUJcetw3wdxuypdAM9CenHwWRQMnjKU+OtTB2Ypa/ +Rpyo2Go3KAQdEMuITetyCHtpIiO25iqiDyz27/M= 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 18:38:27 +0100 (CET) X-EA-Auth: VxAPuyJM929EZlITIfDOtoMc0Vl8+b4lHmH90GCkOLsSXjGZe9dl0ibEqSmXJWF9Rctkw47NEWNIexspR9gqeEqk89EPBNhg Date: Tue, 3 Jan 2023 23:08:20 +0530 From: Deepak R Varma To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , 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 , Praveen Kumar , Deepak R Varma Subject: [PATCH v2] staging: media: imx: change imx_media_fim_set_stream() to return void Message-ID: MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754024752311141749?= X-GMAIL-MSGID: =?utf-8?q?1754024752311141749?= At present, the function imx_media_fim_set_stream() always returns 0. So, convert it to be a function returning void instead. Issue identified using the returnvar.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma Reviewed-by: Marco Felsch --- Changes in v2: 1. Convert the function return type from int to void. Suggested by Fabio Estevam 2. Update patch subject and log accordingly. drivers/staging/media/imx/imx-media-csi.c | 7 ++----- drivers/staging/media/imx/imx-media-fim.c | 8 +++----- drivers/staging/media/imx/imx-media.h | 6 +++--- 3 files changed, 8 insertions(+), 13 deletions(-) -- 2.34.1 diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 5c3cc7de209d..44d87fe30d52 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -779,11 +779,8 @@ static int csi_start(struct csi_priv *priv) goto idmac_stop; /* start the frame interval monitor */ - if (priv->fim && priv->dest == IPU_CSI_DEST_IDMAC) { - ret = imx_media_fim_set_stream(priv->fim, output_fi, true); - if (ret) - goto idmac_stop; - } + if (priv->fim && priv->dest == IPU_CSI_DEST_IDMAC) + imx_media_fim_set_stream(priv->fim, output_fi, true); ret = ipu_csi_enable(priv->csi); if (ret) { diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c index fb6590dcfc36..f456751f100a 100644 --- a/drivers/staging/media/imx/imx-media-fim.c +++ b/drivers/staging/media/imx/imx-media-fim.c @@ -368,12 +368,11 @@ void imx_media_fim_eof_monitor(struct imx_media_fim *fim, ktime_t timestamp) } /* Called by the subdev in its s_stream callback */ -int imx_media_fim_set_stream(struct imx_media_fim *fim, - const struct v4l2_fract *fi, - bool on) +void imx_media_fim_set_stream(struct imx_media_fim *fim, + const struct v4l2_fract *fi, + bool on) { unsigned long flags; - int ret = 0; v4l2_ctrl_lock(fim->ctrl[FIM_CL_ENABLE]); @@ -393,7 +392,6 @@ 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; } int imx_media_fim_add_controls(struct imx_media_fim *fim) diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index f679249d82e4..6f9a46573edd 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -246,9 +246,9 @@ int imx_media_dev_notifier_register(struct imx_media_dev *imxmd, /* imx-media-fim.c */ struct imx_media_fim; void imx_media_fim_eof_monitor(struct imx_media_fim *fim, ktime_t timestamp); -int imx_media_fim_set_stream(struct imx_media_fim *fim, - const struct v4l2_fract *frame_interval, - bool on); +void imx_media_fim_set_stream(struct imx_media_fim *fim, + const struct v4l2_fract *frame_interval, + bool on); int imx_media_fim_add_controls(struct imx_media_fim *fim); struct imx_media_fim *imx_media_fim_init(struct v4l2_subdev *sd); void imx_media_fim_free(struct imx_media_fim *fim);