netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>,
	 Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-can@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	 netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] can: rcar_canfd: Simplify clock handling
Date: Fri, 21 Jun 2024 10:36:06 +0200	[thread overview]
Message-ID: <20240621-sensible-cerulean-pheasant-0a64e7-mkl@pengutronix.de> (raw)
In-Reply-To: <CAMuHMdWCAU7VK97d3yOALpgg7S9+Aa3ZKwC3VVsivUev1iA+Ag@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]

On 06.06.2024 13:38:24, Geert Uytterhoeven wrote:
> > > > > @@ -545,8 +539,8 @@ struct rcar_canfd_global {
> > > > >         struct platform_device *pdev;   /* Respective platform device */
> > > > >         struct clk *clkp;               /* Peripheral clock */
> > > > >         struct clk *can_clk;            /* fCAN clock */
> > > > > -       enum rcar_canfd_fcanclk fcan;   /* CANFD or Ext clock */
> > > > >         unsigned long channels_mask;    /* Enabled channels mask */
> > > > > +       bool extclk;                    /* CANFD or Ext clock */
> > > > >         bool fdmode;                    /* CAN FD or Classical CAN only mode */
> > > >
> > > > Notwithstanding comment: you may consider to replace those two booleans by a:
> > > >
> > > >           unsigned int flags;
> > > >
> > > > This way, no more fields would be needed in the future if more quirks are added.
> > >
> > > Using "unsigned int flags" and BIT(x) flags would increase code size
> > > by 8 bytes (arm/arm64).
> >
> > I am not sure where you derive your figure from, but looking at the pahole:
> 
> pahole shows the size of data structures.
> 
> > > Using "unsigned int foo:1" bitfields would increase code size by 16
> > > (arm) or 12 (arm64) bytes.
> > > So as long as we can fit more bools inside the hole, it is more
> > > efficient to do so...
> >
> > I do not get this either. Where did you get your 16 bytes from? If I do:
> 
> I also looked at code size[*]: while storing bits takes less space than
> storing bytes, processing bits may require more instructions than
> processing bytes (depending on the architecture).
> 
> [*] size drivers/net/can/rcar/rcar_canfd.o

You have probably used "scripts/bloat-o-meter" from the kernel source
for this, right?

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-06-21  8:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29  9:12 [PATCH 0/3] can: rcar_canfd: Small improvements and cleanups Geert Uytterhoeven
2024-05-29  9:12 ` [PATCH 1/3] can: rcar_canfd: Simplify clock handling Geert Uytterhoeven
2024-06-02  8:03   ` Vincent MAILHOL
2024-06-06 10:15     ` Geert Uytterhoeven
2024-06-06 11:04       ` Vincent MAILHOL
2024-06-06 11:38         ` Geert Uytterhoeven
2024-06-21  8:36           ` Marc Kleine-Budde [this message]
2024-06-21 11:27             ` Geert Uytterhoeven
2024-06-03 10:32   ` Wolfram Sang
2024-05-29  9:12 ` [PATCH 2/3] can: rcar_canfd: Improve printing of global operational state Geert Uytterhoeven
2024-06-03 10:32   ` Wolfram Sang
2024-05-29  9:12 ` [PATCH 3/3] can: rcar_canfd: Remove superfluous parentheses in address calculations Geert Uytterhoeven
2024-06-03 10:33   ` Wolfram Sang
2024-06-02  8:04 ` [PATCH 0/3] can: rcar_canfd: Small improvements and cleanups Vincent MAILHOL
2024-06-21  8:38 ` Marc Kleine-Budde

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=20240621-sensible-cerulean-pheasant-0a64e7-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).