All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Christian Borntraeger <borntraeger@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: Sun, 20 Sep 2026 18:18:08 +0200	[thread overview]
Message-ID: <20260920161808.18515Ba3-hca@linux.ibm.com> (raw)
In-Reply-To: <20260920022642.3145674-1-peng.fan@oss.nxp.com>

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.

  parent reply	other threads:[~2026-09-20 16:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20  2:26 [PATCH] KVM: s390: gmap: use assign_bit() where applicable Peng Fan (OSS)
2026-09-20  2:32 ` sashiko-bot
2026-09-20 16:18 ` Heiko Carstens [this message]
2026-09-21  7:06   ` Christian Borntraeger
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=20260920161808.18515Ba3-hca@linux.ibm.com \
    --to=hca@linux.ibm.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=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 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.