mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>,
	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 15:17:09 +0800	[thread overview]
Message-ID: <arDZ9SSQo0N5BsMA@shlinux89> (raw)
In-Reply-To: <06158c64-6d2c-4dda-a742-0ef7b2cd0583@linux.ibm.com>

On Mon, Sep 21, 2026 at 09:06:26AM +0200, Christian Borntraeger wrote:
>
>
>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.

No problem. Let's drop the patch.

Thanks,
Peng

>
>

      reply	other threads:[~2026-09-21  7:12 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
2026-09-21  7:17     ` Peng Fan [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=arDZ9SSQo0N5BsMA@shlinux89 \
    --to=peng.fan@oss.nxp.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@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=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®