All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bence Csokas" <bence.csokas@arm.com>
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, media-ci@linuxtv.org
Subject: Re: [PATCH v2 1/2] stddef: Add offsetofend() variant of struct_offset()
Date: Fri, 13 Nov 2026 09:31:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-212547@kernel.org> (raw)
In-Reply-To: <20261112-offsetof-v2-1-276ede839967@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] overflow: inaccurate kernel-doc Return comment for
  struct_offsetofend()
--

commit a83afd15b73f01058421922341af6cf7cf31d535
Author: Bence Csokas <bence.csokas@arm.com>

stddef: Add offsetofend() variant of struct_offset()

This commit adds the struct_offsetofend() macro to include/linux/overflow.h
to calculate offsetofend() on the type of a struct pointer.

> diff --git a/include/linux/overflow.h b/include/linux/overflow.h
> index d0f04436343e5..060dad4b6f3e0 100644
> --- a/include/linux/overflow.h
> +++ b/include/linux/overflow.h
> @@ -464,6 +464,18 @@ static __always_inline size_t __must_check size_sub(size_t minuend, size_t subtr
>   */
>  #define struct_offset(p, member) (offsetof(typeof(*(p)), member))
>  
> +/**
> + * struct_offsetofend() - Calculate the end of a member within a struct
> + * @p: Pointer to the struct
> + * @member: Name of the member to get the end offset of
> + *
> + * Calculates the offset of the end of a particular @member of the structure
> + * pointed to by @p.
> + *
> + * Return: number of bytes to the location of @member.
> + */
> +#define struct_offsetofend(p, member) (offsetofend(typeof(*(p)), member))

[Severity: Low]
This isn't a bug, but the Return description was copied from
struct_offset() and says "the location of @member" rather than the end of
@member.  Also, the commit message body refers to adding an "offsetof()
variant" instead of an offsetofend() variant, and the subject uses the
"stddef:" prefix for a change in include/linux/overflow.h.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112-offsetof-v2-0-276ede839967@arm.com?part=1

  parent reply	other threads:[~2026-11-13  9:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:29 [PATCH v2 0/2] Add struct_offsetofend() for pointer arithmetic Bence Csokas
2026-11-12  9:29 ` [PATCH v2 1/2] stddef: Add offsetofend() variant of struct_offset() Bence Csokas
2026-11-12 10:47   ` Alejandro Colomar
2026-11-12 10:47     ` Alejandro Colomar
2026-11-12 13:30   ` Add struct_offsetofend() for pointer arithmetic bluez.test.bot
2026-11-13  9:31   ` sashiko-bot [this message]
2026-11-12  9:29 ` [PATCH v2 2/2] treewide: Use struct_offset() Bence Csokas
2026-11-13  9:31   ` sashiko-bot
2026-11-12 10:29 ` ✗ i915.CI.BAT: failure for Add struct_offsetofend() for pointer arithmetic Patchwork
2026-11-12 17:17 ` [PATCH v2 0/2] " Kees Cook
2026-11-12 17:17   ` Kees Cook

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=sashiko-outbox-212547@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bence.csokas@arm.com \
    --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=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 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.