mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	 Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	 Vincent Mailhol <mailhol@kernel.org>
Subject: [PATCH v2 0/3] can: raw: optimize the sizes of struct uniqframe and struct raw_sock
Date: Wed, 17 Sep 2025 13:48:23 +0900	[thread overview]
Message-ID: <20250917-can-raw-repack-v2-0-395e8b3a4437@kernel.org> (raw)

A few bytes can be shaved out of can raw's struct uniqframe and struct
raw_sock.

Patch #1 reorders struct uniqframe fields to save 8 bytes.

Patch #2 and #3 modify struct raw_sock to use bitfields and to reorder
its fields to save 24 bytes in total.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
Changes in v2:

  - in patch #2 also add raw_sock->bound and raw_sock->join_filters to
    the bitfield.

  - add Oliver's Ack tags.

Link to v1: https://lore.kernel.org/r/20250915-can-raw-repack-v1-0-5ea293bc6d33@kernel.org

---
Vincent Mailhol (3):
      can: raw: reorder struct uniqframe's members to optimise packing
      can: raw: use bitfields to store flags in struct raw_sock
      can: raw: reorder struct raw_sock's members to optimise packing

 net/can/raw.c | 65 ++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 38 insertions(+), 27 deletions(-)
---
base-commit: 5e87fdc37f8dc619549d49ba5c951b369ce7c136
change-id: 20250915-can-raw-repack-c21aab25cc11

Best regards,
-- 
Vincent Mailhol <mailhol@kernel.org>


             reply	other threads:[~2025-09-17  4:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17  4:48 Vincent Mailhol [this message]
2025-09-17  4:48 ` [PATCH v2 1/3] can: raw: reorder struct uniqframe's members to optimise packing Vincent Mailhol
2025-09-17  4:48 ` [PATCH v2 2/3] can: raw: use bitfields to store flags in struct raw_sock Vincent Mailhol
2025-09-17  4:48 ` [PATCH v2 3/3] can: raw: reorder struct raw_sock's members to optimise packing Vincent Mailhol
2025-09-19 18:57 ` [PATCH v2 0/3] can: raw: optimize the sizes of struct uniqframe and struct raw_sock 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=20250917-can-raw-repack-v2-0-395e8b3a4437@kernel.org \
    --to=mailhol@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=socketcan@hartkopp.net \
    /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

all inboxes | Powered by JetHome®