From: Yury Norov <yury.norov@gmail.com>
To: Ben Horgan <ben.horgan@arm.com>
Cc: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org,
oliver.upton@linux.dev, joey.gouly@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org,
james.morse@arm.com
Subject: Re: [PATCH v2 2/2] bitfield: Ensure the return values of helper functions are checked
Date: Wed, 9 Jul 2025 11:33:08 -0400 [thread overview]
Message-ID: <aG6LtJ2N1smBKHh1@yury> (raw)
In-Reply-To: <20250709093808.920284-3-ben.horgan@arm.com>
On Wed, Jul 09, 2025 at 10:38:08AM +0100, Ben Horgan wrote:
> As type##_replace_bits() has no side effects it is only useful if its
> return value is checked. Add __must_check to enforce this usage. To have
> the bits replaced in-place typep##_replace_bits() can be used instead.
>
> Although, type_##_get_bits() and type_##_encode_bits() are harder to misuse
> they are still only useful if the return value is checked. For
> consistency, also add __must_check to these.
>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Applied.
Thanks,
Yury
prev parent reply other threads:[~2025-07-09 19:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 9:38 [PATCH v2 0/2] Fix and add warning of misuse of type##_replace_bits() Ben Horgan
2025-07-09 9:38 ` [PATCH v2 1/2] KVM: arm64: Fix enforcement of upper bound on MDCR_EL2.HPMN Ben Horgan
2025-07-09 12:22 ` (subset) " Marc Zyngier
2025-07-09 9:38 ` [PATCH v2 2/2] bitfield: Ensure the return values of helper functions are checked Ben Horgan
2025-07-09 15:33 ` Yury Norov [this message]
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=aG6LtJ2N1smBKHh1@yury \
--to=yury.norov@gmail.com \
--cc=ben.horgan@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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