public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <ynorov@nvidia.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: linux-kernel@vger.kernel.org, Bibo Mao <maobibo@loongson.cn>,
	Huacai Chen <chenhuacai@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Tianrui Zhao <zhaotianrui@loongson.cn>,
	WANG Xuerui <kernel@xen0n.name>,
	Yury Norov <yury.norov@gmail.com>,
	David Howells <dhowells@redhat.com>,
	kvm@vger.kernel.org, loongarch@lists.linux.dev
Subject: Re: [PATCH] lib: count_zeros: unify count_{leading,trailing}_zeros()
Date: Mon, 23 Mar 2026 13:12:47 -0400	[thread overview]
Message-ID: <acF0j03j5F0ysYT7@yury> (raw)
In-Reply-To: <acFz7bEUchB2Arx7@ashevche-desk.local>

On Mon, Mar 23, 2026 at 07:10:05PM +0200, Andy Shevchenko wrote:
> On Mon, Mar 23, 2026 at 01:00:32PM -0400, Yury Norov wrote:
> > The 'leading' helper returns BITS_PER_LONG if x == 0, while 'trailing'
> > one returns COUNT_TRAILING_ZEROS_0, which turns to be -1.
> > 
> > None of the current users explicitly check the returned value for
> > COUNT_TRAILING_ZEROS_0, except the loongarch, which tests implicitly
> > for the '>= 0'.
> > 
> > So, align count_trailing_zeros() with the count_leading_zeros(), and
> > simplify the loongarch handling.
> 
> Makes sense,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

Thanks, Andy. Moving in -next for testing then.

      reply	other threads:[~2026-03-23 17:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 17:00 [PATCH] lib: count_zeros: unify count_{leading,trailing}_zeros() Yury Norov
2026-03-23 17:10 ` Andy Shevchenko
2026-03-23 17:12   ` 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=acF0j03j5F0ysYT7@yury \
    --to=ynorov@nvidia.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=chenhuacai@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=kernel@xen0n.name \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=loongarch@lists.linux.dev \
    --cc=maobibo@loongson.cn \
    --cc=yury.norov@gmail.com \
    --cc=zhaotianrui@loongson.cn \
    /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