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 AD51CC32771 for ; Wed, 28 Sep 2022 16:22:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D154984B70; Wed, 28 Sep 2022 18:21:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="LfbI1GzR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F98D84BB4; Wed, 28 Sep 2022 18:21:57 +0200 (CEST) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9749C84B67 for ; Wed, 28 Sep 2022 18:21:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf2c.google.com with SMTP id ml1so8468087qvb.1 for ; Wed, 28 Sep 2022 09:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=3HpfFwxcGQxChtpujCc1m5NGvWhht+SErp9SCtVGoGw=; b=LfbI1GzRgpDBDDVW3vxrmAEXv7RP/DevIDKlI7uPpTDyHZIDyy8Q437CL3qnA9zFuk vBJthqBvYam/2UNv1Av0dh3gZoRaPprGWfXNYdytyv4/yozSQVjPxtgJhnUW3U8Zw0D/ /YMA3HkTTyVHV1NnIj69Jd5mTpIaKDq5Vc3IFL6kDzVYtKkWVOzYd8kV5HZjbQ4j5U6U 0KOc8hJbm7y/a9Fw3O8DVX6bK4i7WAh4VV7BXZu8Fgor/5cunSKLRUT9OdvzCoY1J4bR PyFesre2m8XtPmhRef+9T90tjs3qMAkjsgV1mIUg1/yW85kJ3X0C2jk54CFHLzGW88T2 dcsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=3HpfFwxcGQxChtpujCc1m5NGvWhht+SErp9SCtVGoGw=; b=mvdKLGUMDdy7r7/EwnH7WsfEofusk7YYcPLZ/SfC3pUCyUGwmxTPV1WAM7EYzNAFh5 hFwOlm7G3QYelnRDoAvV8P2fivOtFZ8ZsJsjnJS07r/jNS6DNWDJMIszZB27muoMOijS zdYdJkVppFoms8+aNjZDgGZD83tT1q7v6otu7dunfz7cbvNAiy0mDdeE1zrKAAS0GnZv enzzyisRds08sEyV7QY3GQxQdEsfYyI2+Zs0wInJWCo+lVHlgrZS7DyFwMBhCoVCZZG8 wbUtatjikvAD9Th4rlWL26jrcpO53HBRENJI57cR/3V/reQy+ajkpzmduMVLb1rtMWGN 6mfA== X-Gm-Message-State: ACrzQf0EQQJqs3v6E4dbJvFGBsdpNaMkfg4lW1WizPhr5Ts1xoa1frA7 RJYY+Tr6LJpQQTk3H0MC7gg= X-Google-Smtp-Source: AMsMyM454wQSggo5s+MYBQn+hCAILga85bNCic5s3vKa2ikWC5lM+VP4FlzQxNtfouZTDnV962d1Zg== X-Received: by 2002:a05:6214:260e:b0:4af:9ea7:a450 with SMTP id gu14-20020a056214260e00b004af9ea7a450mr2028133qvb.81.1664382113344; Wed, 28 Sep 2022 09:21:53 -0700 (PDT) Received: from [192.168.1.201] (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with ESMTPSA id bl18-20020a05620a1a9200b006ce30a5f892sm3217544qkb.102.2022.09.28.09.21.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Sep 2022 09:21:52 -0700 (PDT) Message-ID: <6fa0f09e-4324-dd38-d83e-a76d25b43a8b@gmail.com> Date: Wed, 28 Sep 2022 12:21:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] clk: change return type of clk_get_parent_rate from long long to ulong Content-Language: en-US To: Michal Suchanek , u-boot@lists.denx.de Cc: Giulio Benetti , Heinrich Schuchardt , Lukasz Majewski , Peng Fan , Simon Glass References: <20220928103757.11870-1-msuchanek@suse.de> From: Sean Anderson In-Reply-To: <20220928103757.11870-1-msuchanek@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.6 at phobos.denx.de X-Virus-Status: Clean On 9/28/22 06:37, Michal Suchanek wrote: > All functions getting and setting clock rate use ulong for rate, only > clk_get_parent_rate is an exception. Change the return value to match > other clock rate funcrions. > > Most users directly assign the rate to unsigned long anyway, and the few > users that use u64 (not s64) multiply the rate so they may need the > extra bits for the result in their use case. > > Fixes: 4aa78300a0 ("dm: clk: Define clk_get_parent_rate() for clk operations") > Signed-off-by: Michal Suchanek > --- > > drivers/clk/clk-uclass.c | 2 +- > include/clk.h | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c > index b89c77bf79..4678ed43af 100644 > --- a/drivers/clk/clk-uclass.c > +++ b/drivers/clk/clk-uclass.c > @@ -505,7 +505,7 @@ struct clk *clk_get_parent(struct clk *clk) > return pclk; > } > > -long long clk_get_parent_rate(struct clk *clk) > +ulong clk_get_parent_rate(struct clk *clk) > { > const struct clk_ops *ops; > struct clk *pclk; > diff --git a/include/clk.h b/include/clk.h > index 76bb64bb5e..41a8fb3419 100644 > --- a/include/clk.h > +++ b/include/clk.h > @@ -444,7 +444,7 @@ struct clk *clk_get_parent(struct clk *clk); > * > * Return: clock rate in Hz, or -ve error code. > */ > -long long clk_get_parent_rate(struct clk *clk); > +ulong clk_get_parent_rate(struct clk *clk); > > /** > * clk_round_rate() - Adjust a rate to the exact rate a clock can provide > @@ -577,7 +577,7 @@ static inline struct clk *clk_get_parent(struct clk *clk) > return ERR_PTR(-ENOSYS); > } > > -static inline long long clk_get_parent_rate(struct clk *clk) > +static inline ulong clk_get_parent_rate(struct clk *clk) > { > return -ENOSYS; > } Reviewed-by: Sean Anderson