From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
"Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
David Hildenbrand <david@kernel.org>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Steffen Eiden <seiden@linux.ibm.com>,
Christoph Schlameuss <schlameuss@linux.ibm.com>,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH] KVM: s390: gmap: use assign_bit() where applicable
Date: Mon, 21 Sep 2026 09:06:26 +0200 [thread overview]
Message-ID: <06158c64-6d2c-4dda-a742-0ef7b2cd0583@linux.ibm.com> (raw)
In-Reply-To: <20260920161808.18515Ba3-hca@linux.ibm.com>
Am 20.09.26 um 18:18 schrieb Heiko Carstens:
> On Sun, Sep 20, 2026 at 10:26:25AM +0800, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> ---
>> arch/s390/kvm/gmap/gmap.c | 17 +++++------------
>> 1 file changed, 5 insertions(+), 12 deletions(-)
> ...
>> - if (test_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &parent->flags))
>> - set_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &child->flags);
>> - else
>> - clear_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &child->flags);
>> + assign_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &child->flags,
>> + test_bit(GMAP_FLAG_ALLOW_HPAGE_1M, &parent->flags));
>>
>> - if (test_bit(GMAP_FLAG_ALLOW_HPAGE_2G, &parent->flags))
>> - set_bit(GMAP_FLAG_ALLOW_HPAGE_2G, &child->flags);
>> - else
>> - clear_bit(GMAP_FLAG_ALLOW_HPAGE_2G, &child->flags);
>> + assign_bit(GMAP_FLAG_ALLOW_HPAGE_2G, &child->flags,
>> + test_bit(GMAP_FLAG_ALLOW_HPAGE_2G, &parent->flags));
>
> This turns something which was easily readable into an unreadable mess.
I agree, this is not a good use for the assign_bit helper.
next prev parent reply other threads:[~2026-09-21 7:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 2:26 Peng Fan (OSS)
2026-09-20 16:18 ` Heiko Carstens
2026-09-21 7:06 ` Christian Borntraeger [this message]
2026-09-21 7:17 ` Peng Fan
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=06158c64-6d2c-4dda-a742-0ef7b2cd0583@linux.ibm.com \
--to=borntraeger@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=david@kernel.org \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=schlameuss@linux.ibm.com \
--cc=seiden@linux.ibm.com \
--cc=svens@linux.ibm.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
all inboxes | Powered by JetHome®