From patchwork Mon Oct 2 07:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandra Diupina X-Patchwork-Id: 147203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1255896vqb; Mon, 2 Oct 2023 00:42:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFttRQJOjXURgZHSW1d9VCHYxp/DscVvYbPPkGFBEr5ziA/LTt+/T3e27SlEZYbmE7VMNq8 X-Received: by 2002:a05:6a21:197:b0:157:1b5:61ce with SMTP id le23-20020a056a21019700b0015701b561cemr14702337pzb.4.1696232551727; Mon, 02 Oct 2023 00:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696232551; cv=none; d=google.com; s=arc-20160816; b=BgzgHLHOgICfTUS0ac23XFaBBoGbyLHVQ1i554YLIGD+Tyf7nf3uPddTu6oXLruswN lObTV5P/FXltDPhpWaDB/VUDEf9Ez77dSCPlPg3K5XvnKg3O6eqzGEBLoaNwAsvUpznu NPAiJLsnAo7qUiYr0zZwpcDbsBGvBR49UPCvggH5tgKjWsw5y2d19CvzImpwIPVFWSoN o7kXrbTe/Gje0a9+DPH199QFLVTwIygbsAD2UMEzLOSnWesZ8M+noM803HtvGU3MFiMh T+wjmUPhGAL9FkdZoL5YtGcvoleZ3drCnccc8HOUdY8+y9P1Vql8I+Iiv/Eq5aue/A0x x4gQ== 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=jZxAmfS+dE1rC/opa1dmtPiCKyv8bJlrpeLdya/eheM=; fh=x/XWKGNCH89EiUJUrVOiBE6Z7dl91b9taY5c/TGb2mY=; b=wqss0a19QBHKP2bHLcAUFm4BYn1AEnCnoW+0+nql9JrV/ogM6nmb9e42I8UCgIrBur S1TLxXJjm8oairrGC0apzSzVOxE0a65Wmgq5Fq/R5eoxZH3pUT5N3D42Xpxv/kyMOlnO qGzi8tmW/J1/BevfR06/UgSKz3H66AKJwvVzP6HvSlAcqOONFoRLCpe8OZyC+UHMUZ32 dDj7rTIhlysJZ/i1P2wnALt83JrXdrMZVkuinSMF2S/dHh1aLTtEGxZ4gUPqjpsh8zzw VYkp6sAIT4A7/dhDXUBaVV1AlsVFKsBN897IXEIh/MdqzT4wpayGkIYzBNBDgUMBH37e Ydig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cr15-20020a056a000f0f00b0068fe8cac913si25999139pfb.324.2023.10.02.00.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 00:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 901258049D65; Mon, 2 Oct 2023 00:30:16 -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 S235696AbjJBHaD (ORCPT + 17 others); Mon, 2 Oct 2023 03:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235641AbjJBHaC (ORCPT ); Mon, 2 Oct 2023 03:30:02 -0400 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C246B7; Mon, 2 Oct 2023 00:29:59 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 6181F18651E1; Mon, 2 Oct 2023 10:29:57 +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 MhpPlMfsexIS; Mon, 2 Oct 2023 10:29:56 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id CEFB51862F42; Mon, 2 Oct 2023 10:29:56 +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 AGFD1h-Y19PO; Mon, 2 Oct 2023 10:29:56 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.232.254]) by mail.astralinux.ru (Postfix) with ESMTPSA id CF8D41863156; Mon, 2 Oct 2023 10:29:54 +0300 (MSK) From: Alexandra Diupina To: Laurent Pinchart Cc: Alexandra Diupina , 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: [PATCH v3] drm: rcar-du: turn rcar_du_group_get() into void and remove its return value check Date: Mon, 2 Oct 2023 10:29:17 +0300 Message-Id: <20231002072917.22194-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230930145032.GD31829@pendragon.ideasonboard.com> References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 00:30:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778189655639073793 X-GMAIL-MSGID: 1778628743864377900 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 --- v3: fix build errors 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 +---- drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h | 2 +- 3 files changed, 3 insertions(+), 10 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; } /* diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h index 55649ad86a10..5330dc4ce64a 100644 --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h @@ -54,7 +54,7 @@ struct rcar_du_group { u32 rcar_du_group_read(struct rcar_du_group *rgrp, u32 reg); void rcar_du_group_write(struct rcar_du_group *rgrp, u32 reg, u32 data); -int rcar_du_group_get(struct rcar_du_group *rgrp); +void rcar_du_group_get(struct rcar_du_group *rgrp); void rcar_du_group_put(struct rcar_du_group *rgrp); void rcar_du_group_start_stop(struct rcar_du_group *rgrp, bool start); void rcar_du_group_restart(struct rcar_du_group *rgrp);