Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 304D9EB64DA for ; Mon, 19 Jun 2023 11:06:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 24A6384783; Mon, 19 Jun 2023 13:06:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="SeUGzw/o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C4F6384780; Mon, 19 Jun 2023 13:06:01 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0423D84796 for ; Mon, 19 Jun 2023 13:05:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from eugen-station.. (unknown [192.166.149.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id DF1CE6606F8A; Mon, 19 Jun 2023 11:48:28 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687171709; bh=hbMPxCT+vH00NhJRa+qKBqQ/XgK0yRWLwGqTWj75l0c=; h=From:To:Cc:Subject:Date:From; b=SeUGzw/ogYculrRuRbZLB0HpqYlMzLjK7687qycRfjYYM+DBJ6BtxmZBv2DveVk4X wwCpaQSx9KtM0ibuWuRtI6j4uY0OU3hyZrXQEHkesfkSA9TIt6HOVGmKH5mtUC3uqX vTpWbPva8a6t6P2U8YM8gnZL+x1tXAfIu559aflHCY9YNr57W+YjdoX5WoStGuNSc+ copU84d9yH3jRb25XajgQio4z9H90mef4sY6JOZyc843TMOTz188CZRLcya5pnzhO0 u0ikSlHVAd3gYyHU8rLsaVsfUhJQQ0pVkSl19pSWxFPBtBK9bPM9lB3AG+5Y8NVN4j LcQLMbL1OqnJA== From: Eugen Hristev To: lukma@denx.de, seanga2@gmail.com Cc: u-boot@lists.denx.de, Eugen Hristev Subject: [PATCH] clk: fix count parameter type for clk_release_all Date: Mon, 19 Jun 2023 13:47:52 +0300 Message-Id: <20230619104752.278500-1-eugen.hristev@collabora.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The second parameter for clk_release_all is used as an unsigned (which makes sense) but the function prototype declares it as an int. This causes warnings/error like such below: include/clk.h:422:48: error: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Werror=sign-conversion] 422 | return clk_release_all(bulk->clks, bulk->count); To fix this, changed the type of the count to `unsigned int` Fixes: 82a8a669b4f7 ("clk: add clk_release_all()") Signed-off-by: Eugen Hristev --- drivers/clk/clk-uclass.c | 7 ++++--- include/clk.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index dc3e9d6a2615..eada3a3a5b62 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -416,12 +416,13 @@ int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk) return clk_get_by_index_nodev(node, index, clk); } -int clk_release_all(struct clk *clk, int count) +int clk_release_all(struct clk *clk, unsigned int count) { - int i, ret; + unsigned int i; + int ret; for (i = 0; i < count; i++) { - debug("%s(clk[%d]=%p)\n", __func__, i, &clk[i]); + debug("%s(clk[%u]=%p)\n", __func__, i, &clk[i]); /* check if clock has been previously requested */ if (!clk[i].dev) diff --git a/include/clk.h b/include/clk.h index d91285235f79..a342297007b6 100644 --- a/include/clk.h +++ b/include/clk.h @@ -243,7 +243,7 @@ static inline struct clk *devm_clk_get_optional(struct udevice *dev, * * Return: zero on success, or -ve error code. */ -int clk_release_all(struct clk *clk, int count); +int clk_release_all(struct clk *clk, unsigned int count); /** * devm_clk_put - "free" a managed clock source @@ -307,7 +307,7 @@ clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk) return -ENOSYS; } -static inline int clk_release_all(struct clk *clk, int count) +static inline int clk_release_all(struct clk *clk, unsigned int count) { return -ENOSYS; } -- 2.34.1