* [PATCH 0/2] clean up in tegra clk
@ 2025-07-09 7:37 Pei Xiao
2025-07-09 7:37 ` [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning Pei Xiao
2025-07-09 7:37 ` [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static Pei Xiao
0 siblings, 2 replies; 7+ messages in thread
From: Pei Xiao @ 2025-07-09 7:37 UTC (permalink / raw)
To: pdeschrijver, pgaikwad, mturquette, sboyd, linux-clk, linux-tegra,
linux-kernel
Cc: Pei Xiao
1.Fix error handling and resolve unsigned compare
2.Make tegra_clk_periph_ops static
Pei Xiao (2):
clk: tegra: periph: Fix error handling and resolve unsigned compare
warning
clk: tegra: periph: Make tegra_clk_periph_ops static
drivers/clk/tegra/clk-periph.c | 6 +++---
drivers/clk/tegra/clk.h | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning 2025-07-09 7:37 [PATCH 0/2] clean up in tegra clk Pei Xiao @ 2025-07-09 7:37 ` Pei Xiao 2025-07-09 12:08 ` Thierry Reding 2025-07-24 22:31 ` Stephen Boyd 2025-07-09 7:37 ` [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static Pei Xiao 1 sibling, 2 replies; 7+ messages in thread From: Pei Xiao @ 2025-07-09 7:37 UTC (permalink / raw) To: pdeschrijver, pgaikwad, mturquette, sboyd, linux-clk, linux-tegra, linux-kernel Cc: Pei Xiao ./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 <xiaopei01@kylinos.cn> --- 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 = to_clk_periph(hw); const struct clk_ops *div_ops = periph->div_ops; struct clk_hw *div_hw = &periph->divider.hw; - unsigned long rate; + long rate; __clk_hw_set_clk(div_hw, hw); @@ -59,7 +59,7 @@ static int clk_periph_determine_rate(struct clk_hw *hw, if (rate < 0) return rate; - req->rate = rate; + req->rate = (unsigned long)rate; return 0; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning 2025-07-09 7:37 ` [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning Pei Xiao @ 2025-07-09 12:08 ` Thierry Reding 2025-07-24 22:31 ` Stephen Boyd 1 sibling, 0 replies; 7+ messages in thread From: Thierry Reding @ 2025-07-09 12:08 UTC (permalink / raw) To: Pei Xiao Cc: pdeschrijver, pgaikwad, mturquette, sboyd, linux-clk, linux-tegra, linux-kernel [-- Attachment #1: Type: text/plain, Size: 589 bytes --] On Wed, Jul 09, 2025 at 03:37:13PM +0800, Pei Xiao wrote: > ./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 <xiaopei01@kylinos.cn> > --- > drivers/clk/tegra/clk-periph.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Thierry Reding <treding@nvidia.com> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning 2025-07-09 7:37 ` [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning Pei Xiao 2025-07-09 12:08 ` Thierry Reding @ 2025-07-24 22:31 ` Stephen Boyd 1 sibling, 0 replies; 7+ messages in thread From: Stephen Boyd @ 2025-07-24 22:31 UTC (permalink / raw) To: Pei Xiao, linux-clk, linux-kernel, linux-tegra, mturquette, pdeschrijver, pgaikwad Cc: Pei Xiao Quoting Pei Xiao (2025-07-09 00:37:13) > ./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 <xiaopei01@kylinos.cn> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static 2025-07-09 7:37 [PATCH 0/2] clean up in tegra clk Pei Xiao 2025-07-09 7:37 ` [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning Pei Xiao @ 2025-07-09 7:37 ` Pei Xiao 2025-07-09 12:09 ` Thierry Reding 2025-07-24 22:31 ` Stephen Boyd 1 sibling, 2 replies; 7+ messages in thread From: Pei Xiao @ 2025-07-09 7:37 UTC (permalink / raw) To: pdeschrijver, pgaikwad, mturquette, sboyd, linux-clk, linux-tegra, linux-kernel Cc: Pei Xiao Reduce symbol visibility by converting tegra_clk_periph_ops to static. Removed the extern declaration from clk.h as the symbol is now locally scoped to clk-periph.c. Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> --- drivers/clk/tegra/clk-periph.c | 2 +- drivers/clk/tegra/clk.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/clk/tegra/clk-periph.c b/drivers/clk/tegra/clk-periph.c index c9fc52a36fce..fa0cd7bb8ee6 100644 --- a/drivers/clk/tegra/clk-periph.c +++ b/drivers/clk/tegra/clk-periph.c @@ -132,7 +132,7 @@ static void clk_periph_restore_context(struct clk_hw *hw) clk_periph_set_parent(hw, parent_id); } -const struct clk_ops tegra_clk_periph_ops = { +static const struct clk_ops tegra_clk_periph_ops = { .get_parent = clk_periph_get_parent, .set_parent = clk_periph_set_parent, .recalc_rate = clk_periph_recalc_rate, diff --git a/drivers/clk/tegra/clk.h b/drivers/clk/tegra/clk.h index 5d80d8b79b8e..9ea839af14bc 100644 --- a/drivers/clk/tegra/clk.h +++ b/drivers/clk/tegra/clk.h @@ -629,7 +629,6 @@ struct tegra_clk_periph { #define TEGRA_CLK_PERIPH_MAGIC 0x18221223 -extern const struct clk_ops tegra_clk_periph_ops; struct clk *tegra_clk_register_periph(const char *name, const char * const *parent_names, int num_parents, struct tegra_clk_periph *periph, void __iomem *clk_base, -- 2.25.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static 2025-07-09 7:37 ` [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static Pei Xiao @ 2025-07-09 12:09 ` Thierry Reding 2025-07-24 22:31 ` Stephen Boyd 1 sibling, 0 replies; 7+ messages in thread From: Thierry Reding @ 2025-07-09 12:09 UTC (permalink / raw) To: Pei Xiao Cc: pdeschrijver, pgaikwad, mturquette, sboyd, linux-clk, linux-tegra, linux-kernel [-- Attachment #1: Type: text/plain, Size: 479 bytes --] On Wed, Jul 09, 2025 at 03:37:14PM +0800, Pei Xiao wrote: > Reduce symbol visibility by converting tegra_clk_periph_ops to static. > Removed the extern declaration from clk.h as the symbol is now locally > scoped to clk-periph.c. > > Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> > --- > drivers/clk/tegra/clk-periph.c | 2 +- > drivers/clk/tegra/clk.h | 1 - > 2 files changed, 1 insertion(+), 2 deletions(-) Acked-by: Thierry Reding <treding@nvidia.com> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static 2025-07-09 7:37 ` [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static Pei Xiao 2025-07-09 12:09 ` Thierry Reding @ 2025-07-24 22:31 ` Stephen Boyd 1 sibling, 0 replies; 7+ messages in thread From: Stephen Boyd @ 2025-07-24 22:31 UTC (permalink / raw) To: Pei Xiao, linux-clk, linux-kernel, linux-tegra, mturquette, pdeschrijver, pgaikwad Cc: Pei Xiao Quoting Pei Xiao (2025-07-09 00:37:14) > Reduce symbol visibility by converting tegra_clk_periph_ops to static. > Removed the extern declaration from clk.h as the symbol is now locally > scoped to clk-periph.c. > > Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-07-24 22:31 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-07-09 7:37 [PATCH 0/2] clean up in tegra clk Pei Xiao 2025-07-09 7:37 ` [PATCH 1/2] clk: tegra: periph: Fix error handling and resolve unsigned compare warning Pei Xiao 2025-07-09 12:08 ` Thierry Reding 2025-07-24 22:31 ` Stephen Boyd 2025-07-09 7:37 ` [PATCH 2/2] clk: tegra: periph: Make tegra_clk_periph_ops static Pei Xiao 2025-07-09 12:09 ` Thierry Reding 2025-07-24 22:31 ` Stephen Boyd
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox