[v2] drm: rcar-du: turn rcar_du_group_get() into void and remove its return value check
Message ID | 20230927104438.30628-1-adiupina@astralinux.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2554876vqu; Wed, 27 Sep 2023 04:23:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/J0fev+FQ1zIBBMINMOP8TQeirbbT4JsbErpVhe5twQDoX2d37OWiiJFbRstgWyjHRQh5 X-Received: by 2002:a05:6a20:914a:b0:14c:4deb:7189 with SMTP id x10-20020a056a20914a00b0014c4deb7189mr1743792pzc.26.1695813804483; Wed, 27 Sep 2023 04:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695813804; cv=none; d=google.com; s=arc-20160816; b=K+yT38iLbzaSSL8SPsjPwLewJJmJGL5gADKyt1E3y/r0a9uS9idAZ0mL06Ao5TUvHz WDDAYzl8En+Y8iO5BsuQQDv73XTT8reoJrKCszK7DrW7e1bNRfdm9vBEpQjbUIm/SZE2 IRQBiBfJiZQUKaOy23cc3Mf0QBlIAwqlUuRh5bNi2HBAiqZdBON5ST8lGHQYu3nDdWdj 9LQk/yYvVhrZRdmnubivrND4WmGZBPWKN17kC39nLImz/dxfbTXw5RsT+ZfSgd1KzJVC gEcUKbU4YILs3AOlHzPHDlIBsqq131UK5tShSejhBKe5rTXfnjP2vmmzf9zdQkdb9ujD Ww7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/pCLZiOIkHyWpkpTknNBPtyWMi8x+lvttb6QHkWjg2Y=; fh=x/XWKGNCH89EiUJUrVOiBE6Z7dl91b9taY5c/TGb2mY=; b=YHeOhWtiAP69ZPZODyL4fToUmBt6mXI8kCs3SAtDK0USz1dx468Kw0Spc4a5xG33eb wiTS0NFR1n9VVpNUzeE/S+kmRmAPxsl+TZdStClNVJQSaOLiBRIuQLLwQDaEmT79UHLN Z1NXXeUpgGkm6czvvARWeWR3luY8ZocQg6qxpWk/3+PvyTB4V8XBAe2pKAwlNVjn/ApL YHPShHnjklTEE1Q0aR5YBXL3ueTbIZUVoqQw2TiQxuq+GDHkJ8BioduEzEc1NCBuFH2D oMgCXhTPzP0V/D8iu0FV0P28Ja4jlPfXgfBzvxiN1l2X77eFd5E3/xRdb+lTRkyI/DMc gIpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b00582f2161cb4si7788242pgb.300.2023.09.27.04.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 04:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id B456D80DB363; Wed, 27 Sep 2023 03:45:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbjI0KpQ (ORCPT <rfc822;pwkd43@gmail.com> + 22 others); Wed, 27 Sep 2023 06:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjI0KpL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 27 Sep 2023 06:45:11 -0400 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB16013A; Wed, 27 Sep 2023 03:45:07 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 6DD891867E3A; Wed, 27 Sep 2023 13:45:03 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nNZF-6neTcXu; Wed, 27 Sep 2023 13:45:03 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id DB4EF1867DA8; Wed, 27 Sep 2023 13:45:02 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id K11eK_b7uODQ; Wed, 27 Sep 2023 13:45:02 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.236.148]) by mail.astralinux.ru (Postfix) with ESMTPSA id 3AC741867E3A; Wed, 27 Sep 2023 13:45:01 +0300 (MSK) From: Alexandra Diupina <adiupina@astralinux.ru> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Alexandra Diupina <adiupina@astralinux.ru>, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Biju Das <biju.das.jz@bp.renesas.com>, Jacopo Mondi <jacopo+renesas@jmondi.org>, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH v2] drm: rcar-du: turn rcar_du_group_get() into void and remove its return value check Date: Wed, 27 Sep 2023 13:44:38 +0300 Message-Id: <20230927104438.30628-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <169383224922.277971.15400887308406098634@ping.linuxembedded.co.uk> References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 27 Sep 2023 03:45:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778189655639073793 X-GMAIL-MSGID: 1778189655639073793 |
Series |
[v2] drm: rcar-du: turn rcar_du_group_get() into void and remove its return value check
|
|
Commit Message
Alexandra Diupina
Sept. 27, 2023, 10:44 a.m. UTC
rcar_du_group_get() never returns a negative
error code (always returns 0), so change the comment
about returned value, turn function into void (return
code of rcar_du_group_get has been redundant for a
long time, so perhaps it's just not required) and
remove redundant error path handling in rcar_du_crtc_get()
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 0bb63534fdf3 ("drm: rcar-du: Perform the initial CRTC setup from rcar_du_crtc_get()")
Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
---
v2: rcar_du_group_get() is turned into void and its return
value check is removed in rcar_du_crtc_get()
drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 6 +-----
drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 5 +----
2 files changed, 2 insertions(+), 9 deletions(-)
Comments
Hi Alexandra, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.6-rc3 next-20230929] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Alexandra-Diupina/drm-rcar-du-turn-rcar_du_group_get-into-void-and-remove-its-return-value-check/20230927-184651 base: linus/master patch link: https://lore.kernel.org/r/20230927104438.30628-1-adiupina%40astralinux.ru patch subject: [PATCH v2] drm: rcar-du: turn rcar_du_group_get() into void and remove its return value check config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20230930/202309301402.uR7IRQVj-lkp@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230930/202309301402.uR7IRQVj-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202309301402.uR7IRQVj-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c:203:6: error: conflicting types for 'rcar_du_group_get'; have 'void(struct rcar_du_group *)' 203 | void rcar_du_group_get(struct rcar_du_group *rgrp) | ^~~~~~~~~~~~~~~~~ In file included from drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.h:20, from drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c:29: drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h:57:5: note: previous declaration of 'rcar_du_group_get' with type 'int(struct rcar_du_group *)' 57 | int rcar_du_group_get(struct rcar_du_group *rgrp); | ^~~~~~~~~~~~~~~~~ vim +203 drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c 194 195 /* 196 * rcar_du_group_get - Acquire a reference to the DU channels group 197 * 198 * Acquiring the first reference setups core registers. A reference must be held 199 * before accessing any hardware registers. 200 * 201 * This function must be called with the DRM mode_config lock held. 202 */ > 203 void rcar_du_group_get(struct rcar_du_group *rgrp) 204 { 205 if (rgrp->use_count) 206 goto done; 207 208 rcar_du_group_setup(rgrp); 209 210 done: 211 rgrp->use_count++; 212 } 213
Hi Alexandra, On Wed, Sep 27, 2023 at 01:44:38PM +0300, Alexandra Diupina wrote: > rcar_du_group_get() never returns a negative > error code (always returns 0), so change the comment > about returned value, turn function into void (return > code of rcar_du_group_get has been redundant for a > long time, so perhaps it's just not required) and > remove redundant error path handling in rcar_du_crtc_get() > > Found by Linux Verification Center (linuxtesting.org) with SVACE. Using tools to find issues is fine in principle, but not even compile-testing the resulting patch before submitting it is not. > Fixes: 0bb63534fdf3 ("drm: rcar-du: Perform the initial CRTC setup from rcar_du_crtc_get()") > Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru> > --- > v2: rcar_du_group_get() is turned into void and its return > value check is removed in rcar_du_crtc_get() > drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 6 +----- > drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 5 +---- > 2 files changed, 2 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c > index 7e175dbfd892..2be7c6e64d72 100644 > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c > @@ -565,17 +565,13 @@ static int rcar_du_crtc_get(struct rcar_du_crtc *rcrtc) > if (ret < 0) > goto error_clock; > > - ret = rcar_du_group_get(rcrtc->group); > - if (ret < 0) > - goto error_group; > + rcar_du_group_get(rcrtc->group); > > rcar_du_crtc_setup(rcrtc); > rcrtc->initialized = true; > > return 0; > > -error_group: > - clk_disable_unprepare(rcrtc->extclock); > error_clock: > clk_disable_unprepare(rcrtc->clock); > return ret; > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c > index 2ccd2581f544..7113025dabff 100644 > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c > @@ -199,10 +199,8 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp) > * before accessing any hardware registers. > * > * This function must be called with the DRM mode_config lock held. > - * > - * Return 0 in case of success or a negative error code otherwise. > */ > -int rcar_du_group_get(struct rcar_du_group *rgrp) > +void rcar_du_group_get(struct rcar_du_group *rgrp) > { > if (rgrp->use_count) > goto done; > @@ -211,7 +209,6 @@ int rcar_du_group_get(struct rcar_du_group *rgrp) > > done: > rgrp->use_count++; > - return 0; > } > > /*
Hi Laurent, I'm sorry, my mistake. Thank you for your comment, I will be more careful in the future 30.09.2023 17:50, Laurent Pinchart пишет: > Using tools to find issues is fine in principle, but not even > compile-testing the resulting patch before submitting it is not. Alexandra
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c index 7e175dbfd892..2be7c6e64d72 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c @@ -565,17 +565,13 @@ static int rcar_du_crtc_get(struct rcar_du_crtc *rcrtc) if (ret < 0) goto error_clock; - ret = rcar_du_group_get(rcrtc->group); - if (ret < 0) - goto error_group; + rcar_du_group_get(rcrtc->group); rcar_du_crtc_setup(rcrtc); rcrtc->initialized = true; return 0; -error_group: - clk_disable_unprepare(rcrtc->extclock); error_clock: clk_disable_unprepare(rcrtc->clock); return ret; diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c index 2ccd2581f544..7113025dabff 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c @@ -199,10 +199,8 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp) * before accessing any hardware registers. * * This function must be called with the DRM mode_config lock held. - * - * Return 0 in case of success or a negative error code otherwise. */ -int rcar_du_group_get(struct rcar_du_group *rgrp) +void rcar_du_group_get(struct rcar_du_group *rgrp) { if (rgrp->use_count) goto done; @@ -211,7 +209,6 @@ int rcar_du_group_get(struct rcar_du_group *rgrp) done: rgrp->use_count++; - return 0; } /*