All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Bence Csokas <bence.csokas@arm.com>
Subject: Re: [PATCH v4 2/2] treewide: Use struct_offset()
Date: Thu, 19 Nov 2026 10:19:05 +0000	[thread overview]
Message-ID: <20261119101905.2c644510@pumpkin> (raw)
In-Reply-To: <20261118140513.GO1813469@noisy.programming.kicks-ass.net>

On Wed, 18 Nov 2026 15:05:13 +0100
Peter Zijlstra <peterz@infradead.org> wrote:

(far too many recipients....)

> On Wed, Nov 18, 2026 at 12:50:09PM +0100, Bence Csokas wrote:
> > Generated with a simple Coccinelle patch found in
> > scripts/coccinelle/api/struct_offsetof.cocci  
> 
> I think this is a good example of why we don't need this. It adds yet
> another macro to remember, and doesn't actually save many characters at
> all.
> 

A more interesting exercise would be adding a typeof() into offsetof() itself.
That would let you do offsetof(variable, field) as well as offsetof(type, field).

The same is true for offsetofend().

But the churn of changing all the current uses is silly.

David

  reply	other threads:[~2026-11-19 10:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 11:50 [PATCH v4 0/2] Add struct_offsetofend() for pointer arithmetic Bence Csokas
2026-11-18 11:50 ` [cocci] " Bence Csokas
2026-11-18 11:50 ` [PATCH v4 1/2] overflow: Add offsetofend() variant of struct_offset() Bence Csokas
2026-11-18 11:50   ` [cocci] " Bence Csokas
2026-11-18 12:07   ` sashiko-bot
2026-11-18 12:21     ` Bence Csókás
2026-11-18 14:07   ` Julia Lawall
2026-11-18 14:07     ` Julia Lawall
2026-11-18 14:07     ` [cocci] " Julia Lawall
2026-11-18 16:11   ` [PATCH v4 1/2] coccinelle: " Markus Elfring
2026-11-18 16:11     ` Markus Elfring
2026-11-18 18:58   ` Add struct_offsetofend() for pointer arithmetic bluez.test.bot
2026-11-18 11:50 ` [PATCH v4 2/2] treewide: Use struct_offset() Bence Csokas
2026-11-18 11:50   ` [cocci] " Bence Csokas
2026-11-18 11:56   ` sashiko-bot
2026-11-18 14:05   ` Peter Zijlstra
2026-11-18 14:05     ` Peter Zijlstra
2026-11-18 14:05     ` [cocci] " Peter Zijlstra
2026-11-19 10:19     ` David Laight [this message]
2026-11-18 22:02 ` ✓ i915.CI.BAT: success for Add struct_offsetofend() for pointer arithmetic (rev3) Patchwork
2026-11-19  4:56 ` ✓ i915.CI.Full: " Patchwork

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=20261119101905.2c644510@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=bence.csokas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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.