Message ID | Y8K2SS/zNiPAmLsS@ubun2204.myguest.virtualbox.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp302748wrn; Sat, 14 Jan 2023 06:17:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXsZVweDoY+A8ri2ip5U4Ztcmi8jXH2Rrdq7H/nKG1NYemljg/oQMtxF4qeObtM/5ghP1+X1 X-Received: by 2002:a17:90b:8d4:b0:227:1c79:ac2b with SMTP id ds20-20020a17090b08d400b002271c79ac2bmr20468991pjb.5.1673705842030; Sat, 14 Jan 2023 06:17:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673705842; cv=none; d=google.com; s=arc-20160816; b=tVjAvVd9fVk6qMePrDQLp2lmq+bmlzExXf/yOaxyXDFZY4Ce2zzLTpEqQXzbVdyaia 5mHGuiNnOFJyT08b2XyyDEdRNv1gmFW1Sq0HnnOAf7d4KuHs8AtYw5uA9f4QNJ+CGQ1c Kz6aZbI0mf9LOKi45rkju9sJv5cMTD9oOl4HNkkxjxeoDE78bLAqqeMdwx+Eul/5g3gi mojF40EVkOt0AShFRrkAuumJ+vMaXAtR3rm6YdN+Ge2mhTdC3ZhAJhJ6n7ceciofw1X8 LNxF5dBKHVkWp7aJiU2g6YTtKPCKdNaA1+ErtXEB/AalobtS4OFNwcVSMg688fy0yGoc 9yfA== 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=bqZ+ouBCD107p2woOcIMhXDLx63WfXaWZqufuZ18akU=; b=WLlBv3o6QogbhlnwLW9HPCNSMoFpUHN/Rg67C+PFhjb2r/BKXpwMqnK6zVJEEj+kzQ y6wdzlU4SFKJtXKJZgsxzE6Mt6OpWtksvakwlzyWf0TKmipX9uZED7ie5r5SXzDQwKFp 1o2rmG6NCnJBqMaHZfq/LcoArBWGP3mLCftmcso3amJnrhp4n9rsa6o2LIfJFob4rduu YlDJqrbuy24PIoBTL0SdiaHLKxe4sE3MFww8z+yP21YvZFs6u2SWGF3vuWsNP/RWqnZv /cNWIdzRzik30F9iBhNCgBI/+DXQPAfiMhE8k4uMK+8UVz9/BEF/gxo+f/P/TweCnqws B5kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b="Bu/P+uck"; 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 q19-20020a17090a2e1300b0021982fba453si25309582pjd.40.2023.01.14.06.17.09; Sat, 14 Jan 2023 06:17:22 -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="Bu/P+uck"; 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 S229969AbjANOER (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Sat, 14 Jan 2023 09:04:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbjANOEO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 14 Jan 2023 09:04:14 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBF867EC2 for <linux-kernel@vger.kernel.org>; Sat, 14 Jan 2023 06:04:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1673705038; bh=kBGWBKHIIKQIpYxP0OzdkdWOafSEc8bDoiSabz6C4S8=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=Bu/P+uckxIILRoyNCCIE8VRlk2ynL7kwkt5QCnjI8E4VzpnbWqUcgqOZKpswfuiB8 kOUpbmU41aiYEQLmTvpmUvOHUT3UU8nrCF4F+vYZUUp97ihVVKEm6mOjnrD09zU8QX AzjRnY9dHpRAAYvnXOBvwJFJWn9hKSQR6zRNwdM4= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sat, 14 Jan 2023 15:03:58 +0100 (CET) X-EA-Auth: 1SrSBt70RjsiUzKSXWkgrhGKybdJO3t+s2nn7krxM8MgIPE6VodeGCtCPIciVl4mp7id9IJhJBwpj6IDplEW3+KSCzFkV5SL Date: Sat, 14 Jan 2023 19:33:53 +0530 From: Deepak R Varma <drv@mailo.com> To: Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com> Subject: [PATCH] drm/i915/display: Convert i9xx_pipe_crc_auto_source to void Message-ID: <Y8K2SS/zNiPAmLsS@ubun2204.myguest.virtualbox.org> 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?1755007776668494216?= X-GMAIL-MSGID: =?utf-8?q?1755007776668494216?= |
Series |
drm/i915/display: Convert i9xx_pipe_crc_auto_source to void
|
|
Commit Message
Deepak R Varma
Jan. 14, 2023, 2:03 p.m. UTC
Convert function i9xx_pipe_crc_auto_source() to return void instead
of int since the current implementation always returns 0 to the caller.
Issue identified using returnvar Coccinelle semantic patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Please note: The change is compile tested only.
drivers/gpu/drm/i915/display/intel_pipe_crc.c | 23 ++++++-------------
1 file changed, 7 insertions(+), 16 deletions(-)
Comments
On Sat, Jan 14, 2023 at 07:33:53PM +0530, Deepak R Varma wrote: > Convert function i9xx_pipe_crc_auto_source() to return void instead > of int since the current implementation always returns 0 to the caller. > Issue identified using returnvar Coccinelle semantic patch. could you please share the coccinelle commands and files you used here? > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- > Please note: The change is compile tested only. np, our CI liked it. I liked the clean up as well: Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > > drivers/gpu/drm/i915/display/intel_pipe_crc.c | 23 ++++++------------- > 1 file changed, 7 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c > index e9774670e3f6..8d3ea8d7b737 100644 > --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c > +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c > @@ -72,14 +72,13 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source, > return 0; > } > > -static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > - enum pipe pipe, > - enum intel_pipe_crc_source *source) > +static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > + enum pipe pipe, > + enum intel_pipe_crc_source *source) > { > struct intel_encoder *encoder; > struct intel_crtc *crtc; > struct intel_digital_port *dig_port; > - int ret = 0; > > *source = INTEL_PIPE_CRC_SOURCE_PIPE; > > @@ -121,8 +120,6 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > } > } > drm_modeset_unlock_all(&dev_priv->drm); > - > - return ret; > } > > static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > @@ -132,11 +129,8 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > { > bool need_stable_symbols = false; > > - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { > - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > - if (ret) > - return ret; > - } > + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) > + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > switch (*source) { > case INTEL_PIPE_CRC_SOURCE_PIPE: > @@ -200,11 +194,8 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > enum intel_pipe_crc_source *source, > u32 *val) > { > - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { > - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > - if (ret) > - return ret; > - } > + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) > + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > switch (*source) { > case INTEL_PIPE_CRC_SOURCE_PIPE: > -- > 2.34.1 > > >
On Tue, Jan 17, 2023 at 02:21:59PM -0500, Rodrigo Vivi wrote: > On Sat, Jan 14, 2023 at 07:33:53PM +0530, Deepak R Varma wrote: > > Convert function i9xx_pipe_crc_auto_source() to return void instead > > of int since the current implementation always returns 0 to the caller. > > Issue identified using returnvar Coccinelle semantic patch. > > could you please share the coccinelle commands and files you used here? Hello Rodrigo, I used following command to identify this change opportunity: make coccicheck COCCI=scripts/coccinelle/misc/returnvar.cocci M=drivers/gpu/drm/ Let me know if you would like me to include the same in the commit message. > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > --- > > Please note: The change is compile tested only. > > np, our CI liked it. > > I liked the clean up as well: > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Thank you for your review and the feedback. Regards, ./drv > > > > > > > drivers/gpu/drm/i915/display/intel_pipe_crc.c | 23 ++++++------------- > > 1 file changed, 7 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c > > index e9774670e3f6..8d3ea8d7b737 100644 > > --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c > > +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c > > @@ -72,14 +72,13 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source, > > return 0; > > } > > > > -static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > > - enum pipe pipe, > > - enum intel_pipe_crc_source *source) > > +static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > > + enum pipe pipe, > > + enum intel_pipe_crc_source *source) > > { > > struct intel_encoder *encoder; > > struct intel_crtc *crtc; > > struct intel_digital_port *dig_port; > > - int ret = 0; > > > > *source = INTEL_PIPE_CRC_SOURCE_PIPE; > > > > @@ -121,8 +120,6 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > > } > > } > > drm_modeset_unlock_all(&dev_priv->drm); > > - > > - return ret; > > } > > > > static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > > @@ -132,11 +129,8 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > > { > > bool need_stable_symbols = false; > > > > - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { > > - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > - if (ret) > > - return ret; > > - } > > + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) > > + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > > > switch (*source) { > > case INTEL_PIPE_CRC_SOURCE_PIPE: > > @@ -200,11 +194,8 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > > enum intel_pipe_crc_source *source, > > u32 *val) > > { > > - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { > > - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > - if (ret) > > - return ret; > > - } > > + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) > > + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > > > switch (*source) { > > case INTEL_PIPE_CRC_SOURCE_PIPE: > > -- > > 2.34.1 > > > > > >
On Wed, Jan 18, 2023 at 10:13:04AM +0530, Deepak R Varma wrote: > On Tue, Jan 17, 2023 at 02:21:59PM -0500, Rodrigo Vivi wrote: > > On Sat, Jan 14, 2023 at 07:33:53PM +0530, Deepak R Varma wrote: > > > Convert function i9xx_pipe_crc_auto_source() to return void instead > > > of int since the current implementation always returns 0 to the caller. > > > Issue identified using returnvar Coccinelle semantic patch. > > > > could you please share the coccinelle commands and files you used here? > > Hello Rodrigo, > I used following command to identify this change opportunity: > > make coccicheck COCCI=scripts/coccinelle/misc/returnvar.cocci M=drivers/gpu/drm/ > > Let me know if you would like me to include the same in the commit message. Thanks for the line. Added to the commit message while pushing it. Thanks, Rodrigo. > > > > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > --- > > > Please note: The change is compile tested only. > > > > np, our CI liked it. > > > > I liked the clean up as well: > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Thank you for your review and the feedback. > > Regards, > ./drv > > > > > > > > > > > > drivers/gpu/drm/i915/display/intel_pipe_crc.c | 23 ++++++------------- > > > 1 file changed, 7 insertions(+), 16 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c > > > index e9774670e3f6..8d3ea8d7b737 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c > > > +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c > > > @@ -72,14 +72,13 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source, > > > return 0; > > > } > > > > > > -static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > > > - enum pipe pipe, > > > - enum intel_pipe_crc_source *source) > > > +static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > > > + enum pipe pipe, > > > + enum intel_pipe_crc_source *source) > > > { > > > struct intel_encoder *encoder; > > > struct intel_crtc *crtc; > > > struct intel_digital_port *dig_port; > > > - int ret = 0; > > > > > > *source = INTEL_PIPE_CRC_SOURCE_PIPE; > > > > > > @@ -121,8 +120,6 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, > > > } > > > } > > > drm_modeset_unlock_all(&dev_priv->drm); > > > - > > > - return ret; > > > } > > > > > > static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > > > @@ -132,11 +129,8 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > > > { > > > bool need_stable_symbols = false; > > > > > > - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { > > > - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > > - if (ret) > > > - return ret; > > > - } > > > + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) > > > + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > > > > > switch (*source) { > > > case INTEL_PIPE_CRC_SOURCE_PIPE: > > > @@ -200,11 +194,8 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, > > > enum intel_pipe_crc_source *source, > > > u32 *val) > > > { > > > - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { > > > - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > > - if (ret) > > > - return ret; > > > - } > > > + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) > > > + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); > > > > > > switch (*source) { > > > case INTEL_PIPE_CRC_SOURCE_PIPE: > > > -- > > > 2.34.1 > > > > > > > > > > >
diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c index e9774670e3f6..8d3ea8d7b737 100644 --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c @@ -72,14 +72,13 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source, return 0; } -static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, - enum pipe pipe, - enum intel_pipe_crc_source *source) +static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, + enum pipe pipe, + enum intel_pipe_crc_source *source) { struct intel_encoder *encoder; struct intel_crtc *crtc; struct intel_digital_port *dig_port; - int ret = 0; *source = INTEL_PIPE_CRC_SOURCE_PIPE; @@ -121,8 +120,6 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, } } drm_modeset_unlock_all(&dev_priv->drm); - - return ret; } static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, @@ -132,11 +129,8 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, { bool need_stable_symbols = false; - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); - if (ret) - return ret; - } + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); switch (*source) { case INTEL_PIPE_CRC_SOURCE_PIPE: @@ -200,11 +194,8 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, enum intel_pipe_crc_source *source, u32 *val) { - if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) { - int ret = i9xx_pipe_crc_auto_source(dev_priv, pipe, source); - if (ret) - return ret; - } + if (*source == INTEL_PIPE_CRC_SOURCE_AUTO) + i9xx_pipe_crc_auto_source(dev_priv, pipe, source); switch (*source) { case INTEL_PIPE_CRC_SOURCE_PIPE: