From: "Bence Csókás" <bence.csokas@arm.com>
To: sashiko-reviews@lists.linux.dev
Cc: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-scsi@vger.kernel.org, bpf@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-sound@vger.kernel.org, media-ci@linuxtv.org
Subject: Re: [PATCH v4 1/2] overflow: Add offsetofend() variant of struct_offset()
Date: Wed, 18 Nov 2026 13:21:37 +0100 [thread overview]
Message-ID: <082abd33-4e9e-4b7f-9640-4930a302c998@arm.com> (raw)
In-Reply-To: <sashiko-outbox-220875@kernel.org>
Hi,
On 2026. 11. 18. 13:07, sashiko-bot@kernel.org wrote:
>> +@offsetof depends on patch@
>> +expression ptr, member;
>> +@@
>> +- offsetof(typeof(*(ptr)), member)
>> ++ struct_offset(ptr, member)
>> +@offsetofend depends on patch@
>> +expression ptr, member;
>> +@@
>> +- offsetofend(typeof(*(ptr)), member)
>> ++ struct_offsetofend(ptr, member)
>
> [Severity: Low]
> Do the inner parentheses in typeof(*(ptr)) prevent these rules from
> matching unparenthesized typeof(*ptr) call sites?
>
> In Coccinelle, the paren isomorphism expands E to (E) in one direction,
> so matching typeof(*(ptr)) requires explicit parentheses around ptr in
> the C source. Writing typeof(*ptr) matches both typeof(*ptr) and
> typeof(*(ptr)).
It's actually the other way around. In fact, these parentheses were
suggested by Sashiko in the first place!
Bence
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2026-11-18 12:22 UTC|newest]
Thread overview: 6+ 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 ` [PATCH v4 1/2] overflow: Add offsetofend() variant of struct_offset() Bence Csokas
2026-11-18 12:07 ` sashiko-bot
2026-11-18 12:21 ` Bence Csókás [this message]
2026-11-18 11:50 ` [PATCH v4 2/2] treewide: Use struct_offset() Bence Csokas
2026-11-18 11:56 ` sashiko-bot
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=082abd33-4e9e-4b7f-9640-4930a302c998@arm.com \
--to=bence.csokas@arm.com \
--cc=bpf@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
/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