From nobody Tue Oct 7 16:38:54 2025 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CEA6270EAB; Wed, 9 Jul 2025 07:37:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752046652; cv=none; b=qKdqbEsW7zKbLOrtiM9qGfkScRXyQDExuqF8Q1cHwPh0nqzmkRQ7mpM+V+u8tHBKazfjQGyfvBNK6y1Py6lYrtUY+yuFzc8OPSLEoj8TWb7tZlwng24JO8AHrav1fOSufmDZstlfYDIjfbJrRO+Aw+vXVRVhzIt22ostH7IJDXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752046652; c=relaxed/simple; bh=u4alZ4zGTTPRm68+9CqnN78vUOB2rMPAShMaUb3pefE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lqA6DD7+ZhIBCjJf13rsfqitR8HKTbAZtJhxcAM66jTmm0ba1uDJ67kBP/DHNCBVmtHLfLVU+ZfA0lJqAsuo8phbGjcHZ5Yz5H+nfMuQgFCB0wuGPkEo33zUP5c3xFh1R6VfVYALYcXA6KciR9hpk+Yg9pbf8D6bT2y1wGsrwnc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 8c730aba5c9711f0b29709d653e92f7d-20250709 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:27a80908-a798-4318-8049-208477025e7c,IP:0,U RL:0,TC:0,Content:-5,EDM:25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:20 X-CID-META: VersionHash:6493067,CLOUDID:e8abe1e010e877df5d1301640cfee3eb,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:5,IP:n il,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LE S:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 8c730aba5c9711f0b29709d653e92f7d-20250709 X-User: xiaopei01@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 859517003; Wed, 09 Jul 2025 15:37:21 +0800 From: Pei Xiao To: pdeschrijver@nvidia.com, pgaikwad@nvidia.com, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pei Xiao Subject: [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning Date: Wed, 9 Jul 2025 15:37:13 +0800 Message-Id: <79c7f01e29876c612e90d6d0157fb1572ca8b3fb.1752046270.git.xiaopei01@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ./drivers/clk/tegra/clk-periph.c:59:5-9: WARNING: Unsigned expression compared with zero: rate < 0 The unsigned long 'rate' variable caused: - Incorrect handling of negative errors - Compile warning: "Unsigned expression compared with zero" Fix by changing to long type and adding req->rate cast. Signed-off-by: Pei Xiao Acked-by: Thierry Reding --- drivers/clk/tegra/clk-periph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c index 0626650a7011..c9fc52a36fce 100644 --- a/drivers/clk/tegra/clk-periph.c +++ b/drivers/clk/tegra/clk-periph.c @@ -51,7 +51,7 @@ static int clk_periph_determine_rate(struct clk_hw *hw, struct tegra_clk_periph *periph =3D to_clk_periph(hw); const struct clk_ops *div_ops =3D periph->div_ops; struct clk_hw *div_hw =3D &periph->divider.hw; - unsigned long rate; + long rate; =20 __clk_hw_set_clk(div_hw, hw); =20 @@ -59,7 +59,7 @@ static int clk_periph_determine_rate(struct clk_hw *hw, if (rate < 0) return rate; =20 - req->rate =3D rate; + req->rate =3D (unsigned long)rate; return 0; } =20 --=20 2.25.1