[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdU=7YUZgcwK_annDigTgE9YqQ=sxjtF9ttAGzPV-7wR6A@mail.gmail.com>
Date: Thu, 19 Jun 2025 12:16:00 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>
Cc: Jakub Kicinski <kuba@...nel.org>, Marc Kleine-Budde <mkl@...gutronix.de>, netdev@...r.kernel.org,
davem@...emloft.net, linux-can@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH net-next 06/10] can: rcar_canfd: Repurpose f_dcfg base for
other registers
Hi Vincent, Jakub,
On Thu, 19 Jun 2025 at 06:43, Vincent Mailhol
<mailhol.vincent@...adoo.fr> wrote:
> On Thu. 19 Jun. 2025 at 10:38, Jakub Kicinski <kuba@...nel.org> wrote:
> > On Wed, 18 Jun 2025 11:20:00 +0200 Marc Kleine-Budde wrote:
> > > +static inline unsigned int rcar_canfd_f_dcfg(struct rcar_canfd_global *gpriv,
> > > + unsigned int ch)
> > > +{
> > > + return gpriv->info->regs->coffset + 0x00 + 0x20 * ch;
> > > +}
> > > +
> > > +static inline unsigned int rcar_canfd_f_cfdcfg(struct rcar_canfd_global *gpriv,
> > > + unsigned int ch)
> > > +{
> > > + return gpriv->info->regs->coffset + 0x04 + 0x20 * ch;
> > > +}
> > > +
> > > +static inline unsigned int rcar_canfd_f_cfdctr(struct rcar_canfd_global *gpriv,
> > > + unsigned int ch)
> > > +{
> > > + return gpriv->info->regs->coffset + 0x08 + 0x20 * ch;
> > > +}
> > > +
> > > +static inline unsigned int rcar_canfd_f_cfdsts(struct rcar_canfd_global *gpriv,
> > > + unsigned int ch)
> > > +{
> > > + return gpriv->info->regs->coffset + 0x0c + 0x20 * ch;
> > > +}
> > > +
> > > +static inline unsigned int rcar_canfd_f_cfdcrc(struct rcar_canfd_global *gpriv,
> > > + unsigned int ch)
> > > +{
> > > + return gpriv->info->regs->coffset + 0x10 + 0x20 * ch;
> > > +}
> >
> > clang is no longer fooled by static inline, it identifies that 4 out of
Oh well, that explains why someone pointed to a CI log showing more
unused functions in a different driver. I hope it only does that
for unused functions in .c files, not in header files?
> > these functions are never called. I think one ends up getting used in
> > patch 10 (just looking at warning counts), but the other 3 remain dead
> > code. Geert, do you have a strong attachment to having all helpers
> > defined or can we trim this, please?
I would like to keep them (or at least the information), as it serves
as register documentation, just like the macros they replaced....
> I had a discussion with Geert on these functions here:
>
> https://lore.kernel.org/linux-can/20250613-misty-amethyst-swine-7bd775-mkl@pengutronix.de/t/#mef5cb235313c5f0c4910d5571b052eb5e9ada92e
>
> in which I made a suggestion to reword these. That suggestion would
> actually resolve your concerns. Geert was OK with the suggestion but
> we agreed to move on as-is and make those changes later on.
>
> If temporarily having those static inline functions unused is not a
> big blocker for you, can we just have this merged and wait for the
> bigger refactor which is on Geert TODO’s list?
I am still working on converting more ugly macros (while increasing
functionality, and fixing bugs ^-). But given the clang warnings,
I agree it would be good to fast-track the first conversion.
Patch sent: "[PATCH] can: rcar_canfd: Describe channel-specific FD
registers using C struct"
https://lore.kernel.org/292b75b3bc8dd95f805f0223f606737071c8cf86.1750327217.git.geert+renesas@glider.be
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists