Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp407243rdb; Sat, 30 Sep 2023 09:01:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2dfUQAjS/TuxnYXj/QHDx4DTFJSyvSLY9ZYNzhQoYzv3bw7AvcMZHW8o2OWDuNPhCQkxW X-Received: by 2002:a17:903:41c1:b0:1c7:37e2:13fe with SMTP id u1-20020a17090341c100b001c737e213femr8127571ple.2.1696089668088; Sat, 30 Sep 2023 09:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696089668; cv=none; d=google.com; s=arc-20160816; b=A9ZyyyILTcO192GXYAE3jLb8x2FOEdjwB9MDU7ofABe9BrGwchfim+qwtYb6Ni82K0 tb+RcfQfNyo/24dtWaoJYaoXYHFgX1NFOCPeFl1AP6fc0Sxhs62iWJ6b1pFNaxDCfyuP wF+TgIDywkvOe6eRGXAF59lWI2+BaiUd6EulLiA4GPYaXEw5dST3RtEkBh4BMNgWawv0 ZfEjZkJa1SrGflOdi7fLL1Z+GB3/dZrVoxXRjViUK6L3ejeLHTGsj6uIIHCsL53p//81 ZJwEJjz6SX35GQUPR7RdivN7trHiTKL3vVKNXnmyd35O8jXa3w1UAGlfzL0aOsRrNyiI o33A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dP6uyUZ3hst7AUm5jfl8vrkb1EOemtJUKmxWzH4S3aA=; fh=/uOpdcxRXEpkF3eY4NvBnGcJHR/+SP7a4o/J7wGNx/M=; b=VXrGxfT9TJ7qN8Mmaj8XWQ+qaXZ/3HzTCHJlMxCm/f4HjG1KBu5uOfqTntilph28gz pFpNLHzI2qgMXnDJMFf4BjXh8wNtW+Zo/Q0Igh0YCY+0Fb4OwTOUfOjEUMPiJqqyBvF4 +01vH7IEyORS3llHPvcub6subjmtycpDPPsA8BLpJKXeX8lKPplKp3ksp80FEp5hqhZV fhhpncC28uQmSyqurH4Pr7KM0+FcAZPs2LOgoKxurLWyzaChTD/vLzZvS+r4ImupAEbq VRy4U/4n42ECIJoQxS0uOIWpSTcLLK4aD/fyFkSRUIY5PgaIgufX5kzgEaTldLTCIne0 CXTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Lu/s6Pk3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z1-20020a1709027e8100b001c61bd9db5csi14194269pla.317.2023.09.30.09.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 09:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Lu/s6Pk3"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 22F9982DE86B; Sat, 30 Sep 2023 07:50:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234320AbjI3Ou3 (ORCPT + 99 others); Sat, 30 Sep 2023 10:50:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234299AbjI3Ou2 (ORCPT ); Sat, 30 Sep 2023 10:50:28 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D76BFC5; Sat, 30 Sep 2023 07:50:24 -0700 (PDT) Received: from pendragon.ideasonboard.com (lfbn-idf1-1-343-200.w86-195.abo.wanadoo.fr [86.195.61.200]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5E5954DA; Sat, 30 Sep 2023 16:48:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1696085318; bh=0YqXD3+eosGItzd6UoevtWRB5iXyw47u0+mzSfkk8OM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lu/s6Pk3+5+wlQNXrGF+KamnzoFxnCp0+nR1rbVwdgkC2vj7wm7HuEBnFvyG4Nsd1 joAE/wMKA1VsOPKxbdKr+eUktOnRQjaF9VY/KAgpH0M4sZ3R1RURV6Dhte3rdEfR6/ vONkz129ed6k+z/3OEP2RgDrZRsULZC1NpNLlmtI= Date: Sat, 30 Sep 2023 17:50:32 +0300 From: Laurent Pinchart To: Alexandra Diupina Cc: Kieran Bingham , David Airlie , Daniel Vetter , Tomi Valkeinen , Wolfram Sang , Biju Das , Jacopo Mondi , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH v2] drm: rcar-du: turn rcar_du_group_get() into void and remove its return value check Message-ID: <20230930145032.GD31829@pendragon.ideasonboard.com> References: <169383224922.277971.15400887308406098634@ping.linuxembedded.co.uk> <20230927104438.30628-1-adiupina@astralinux.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230927104438.30628-1-adiupina@astralinux.ru> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 30 Sep 2023 07:50:32 -0700 (PDT) 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 > --- > 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; > } > > /* -- Regards, Laurent Pinchart