From: sashiko-bot@kernel.org
To: "Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>
Cc: linux-clk@vger.kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH 1/2] clk: renesas: tidyup DEF_GEN4_Z()
Date: Tue, 15 Sep 2026 02:36:17 +0000 [thread overview]
Message-ID: <20260915023617.7D2421F000FF@smtp.kernel.org> (raw)
In-Reply-To: <87bj9zs0xp.wl-kuninori.morimoto.gx@renesas.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] clk: renesas: DEF_GEN4_Z macro arguments lack parentheses
--
commit ad51061672812b3bccf2c0614e480e134d8fc4e5
Author: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
clk: renesas: tidyup DEF_GEN4_Z()
This commit updates the DEF_GEN4_Z macro to take the register offset
and bit position explicitly rather than deriving them from a single
flat offset. It simplifies the offset calculation logic inside
cpg_z_clk_register().
> diff --git a/drivers/clk/renesas/rcar-gen4-cpg.h b/drivers/clk/renesas/rcar-gen4-cpg.h
> index 6c8280b37c37b..cfc150750dc4d 100644
> --- a/drivers/clk/renesas/rcar-gen4-cpg.h
> +++ b/drivers/clk/renesas/rcar-gen4-cpg.h
> @@ -58,8 +58,14 @@ enum rcar_gen4_clk_types {
> #define DEF_GEN4_PLL_V9_24(_name, _idx, _id, _parent) \
> DEF_BASE(_name, _id, CLK_TYPE_GEN4_PLL_V9_24, _parent, .offset = _idx)
>
> -#define DEF_GEN4_Z(_name, _id, _type, _parent, _div, _offset) \
> - DEF_BASE(_name, _id, _type, _parent, .div = _div, .offset = _offset)
> +/*
> + * offset 0xAAABB
> + * AAA : reg
> + * BB : pos
> + */
> +#define FRQCR_offset 8
> +#define DEF_GEN4_Z(_name, _id, _type, _parent, _div, reg, pos) \
> + DEF_BASE(_name, _id, _type, _parent, .div = _div, .offset = (reg << FRQCR_offset) + pos)
[Severity: Low]
This isn't a bug introduced by this patch since current callers pass simple
constants, but could the lack of parentheses around the reg and pos arguments
cause issues in the future?
If an expression is ever passed for these arguments, operator precedence
rules might cause the offset to be miscalculated (e.g., if reg is passed
as BASE + 4, it would expand to BASE + 4 << 8 + pos). Could parentheses
be added around (reg) and (pos) to prevent this?
--
Sashiko AI review · https://sashiko.dev/#/patchset/87cxufs0yi.wl-kuninori.morimoto.gx@renesas.com?part=1
next prev parent reply other threads:[~2026-09-15 2:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 2:27 [PATCH 0/2] clk: renesas: r8a779g0: Add ZG clocks Kuninori Morimoto
2026-09-15 2:28 ` [PATCH 1/2] clk: renesas: tidyup DEF_GEN4_Z() Kuninori Morimoto
2026-09-15 2:36 ` sashiko-bot [this message]
2026-09-15 3:14 ` Kuninori Morimoto
2026-09-15 2:28 ` [PATCH 2/2] clk: renesas: r8a779g0: Add ZG clocks Kuninori Morimoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260915023617.7D2421F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-clk@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.