From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88B474A02 for ; Sat, 10 Jan 2026 18:21:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768069296; cv=none; b=FWjNVnITHVinPCipYWuHnH6zvC6EUqQbiCKiJ5I3JkOvP1d5r0zbc4vmTPiwm6fA5fUdXNDFpfxT1VZ1nZM9TtuZwIXXNoQjypJ7V7k15RDE/3l/VaKxUxsBy6hvjD3HFwNkXK24XddF5C+WRdH5/Uy7BCsJGYWyuu+Fj1WTawk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768069296; c=relaxed/simple; bh=Ee66QURJq/U/hJEySpc3NR5E7Sylh5Ut/Iu8rf0ulZU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=W5Fim+BAu2yeoUd71yGVmVepLyP/d8U1Uz0MUmjM9pWZqNHxYIYvEAu6YkoIlSyHyCELoUJDIZqhFV1b2kkmGOzm+a6/bp/G301zR3yKozj3JDibJV7bxGVXvbp9hSXJRGBOrCCzArxG7PsePPxxH4RBNa1/I1GBzaMhndhcPwU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GU4vAQ6d; arc=none smtp.client-ip=209.85.219.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GU4vAQ6d" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-88888d80590so66767946d6.3 for ; Sat, 10 Jan 2026 10:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768069294; x=1768674094; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=G6Uqzv9ItF1RI/p5FTm1FNtlGmNA6LUzIZnnhuq59gU=; b=GU4vAQ6dcfnTOnETreVWyDiS/TLnILk5t8FNAo7ikZvBaOLpdP9CdkZhZc770TVnei lYODn0OZrhzxW+uNtW2ZrBdkyJ7w+0699yD8vHUurFjEfVCil8IsfjBnSj9UL0tfIQ8a vwdal3cXbtOIZf+H+Rxr0iWT0VOxpaaq3d9xEBj9xowTrKO/PK3f9INKCW1Hst1Me/Bu ktYxTx/UQZd+/ASJgCEq4CnPkVoH+kPO7S/DqiN0BlFE2We5Po8ejlbp4l9seBWKWenR CGx+7KZiFr1pl/2uiABcsvjWHzcvrofU2flvq9YIDCxxlgvSWJZkFJK+rSA8YS1i35db rYqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768069294; x=1768674094; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G6Uqzv9ItF1RI/p5FTm1FNtlGmNA6LUzIZnnhuq59gU=; b=XC8IlFq5dx2lVbimJxchNxsj5tZDcMxyUuDtoww4lRIydQWmo9c9TZnttzSe1A4avd M9TrmAIDkSrLbTySOWd4IwBAt/M+rw2xSlTXFvUh681FH0YfKrtEAJeLKHgIHIRuWi5X v4HcRBaG1AZHRXz9vIykh+drj4Jl4cHxW7fD00v9YiQWr4c4tCJrcJp9N9/LC9HWsUDQ JaodTyLslNu4FzVhY/HAp8pyjhmEtG1DkcLvdpiil4TmUT/7Y0hvmUylYSY3xnsDtjZu Ofae+qVRhz359Hl7FZq0EVZfqHZCb28PJfkH+hyCKlUJyeTk4L4AM7kAfoGEXYEs8tVN u1Fg== X-Forwarded-Encrypted: i=1; AJvYcCVLdrPdCvG3JVPaZO05Y0NZz8EHEbr1CO5xD99TjPma+uq22tjYm1U/gr4PU3J276YrBzEisVjmVncFC8M=@vger.kernel.org X-Gm-Message-State: AOJu0YyjmgV+G5my6hMr3NE8MXgLt41OwVNgBaPNdjMPQkqI7d+aclNI hdbapmA3OO3/xSvft+T1VMZ5pg76lWzFg9XOWimm89ikG6uqNycYuKHt X-Gm-Gg: AY/fxX4vNIus55vkdoMHc+RcNlfkiI35cUcoPdWNeKdeRQ8TMt8iYRxhdMht48tEt2z LcOAaJ4tOOv5WXgpXzaRI/5y0jC4xWtSYhtwgDCy4ZyJcDU6D6VPkpyvbsDRrBsHVGNsplfmxFX 9cC7kLMCySOK5b8C0CpyGSeaTmVfNsRsA/TrkSAMzIlO3QHScDuCw7gkh23AyHdiB6gg9ZiaGWW mS6LwEBcL5F0WnWBpHIQppVOKY+m2ZIcO+Pg6T0Wi8bpqhONh2oK1MFHsNnUVphJbcgn00w76oj MrR+hrXt0BdRDqnfqzM8HjtTKTl+5/3zxpmA7IIi+D6Sd0q5eJP0T/j1kbeQc3ovhMGEdTw71xQ 6JOmR6oj4d5zRZ1O8/Zi7kcE/Gx28OhiExmWorZOrAEh++Js3WVFbn6CNmi8GuHpvmDEf7h9nqZ QUjvJNYzKUUQl3RYoMDzEu3Piu8ZuOOSKNe68GRkC+7JMUCo+EhKg1mTYr6A== X-Google-Smtp-Source: AGHT+IFmgsmOEydGKYUEo2/dVvc/xQnagU52i70ixiWNLA3sukdBM92m6OL83jjF9aKzcPRrbUfoxA== X-Received: by 2002:a17:90b:4b07:b0:345:badf:f1b7 with SMTP id 98e67ed59e1d1-34f68d23a5amr11990160a91.28.1768063385038; Sat, 10 Jan 2026 08:43:05 -0800 (PST) Received: from google.com (61-230-24-179.dynamic-ip.hinet.net. [61.230.24.179]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34f5fb64d68sm1214697a91.12.2026.01.10.08.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jan 2026 08:43:04 -0800 (PST) Date: Sun, 11 Jan 2026 00:42:56 +0800 From: Kuan-Wei Chiu To: "Maciej W. Rozycki" Cc: Yury Norov , Petr Tesarik , Yury Norov , Rasmus Villemoes , Richard Henderson , Matt Turner , Magnus Lindholm , Vineet Gupta , Geert Uytterhoeven , Thomas Bogendoerfer , Madhavan Srinivasan , Michael Ellerman , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Chris Zankel , Max Filippov , Patrik Jakobsson , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Robin Murphy , Joerg Roedel , Will Deacon , Jakub Kicinski , Andrew Lunn , "David S. Miller" , Eric Dumazet , Paolo Abeni , Oliver Neukum , Arnd Bergmann , Andrew Morton , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Pablo Neira Ayuso , Florian Westphal , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/2] treewide, bits: use ffs_val() where it is open-coded Message-ID: References: <1ce341045ad0487c66ca21003f9974916aba0bce.1767975412.git.ptesarik@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Jan 10, 2026 at 10:36:07AM +0000, Maciej W. Rozycki wrote: > On Fri, 9 Jan 2026, Yury Norov wrote: > > > > diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c > > > index ed06367ece574..2f3809c015b99 100644 > > > --- a/arch/alpha/kernel/smp.c > > > +++ b/arch/alpha/kernel/smp.c > > > @@ -525,7 +525,7 @@ handle_ipi(struct pt_regs *regs) > > > do { > > > unsigned long which; > > > > > > - which = ops & -ops; > > > + which = ffs_val(ops); > > > ops &= ~which; > > > which = __ffs(which); > > > > I guess, this should be: > > > > which = __ffs(ops); > > ops &= ops - 1; > > I think it's the wrong operation order. > > > > diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c > > > index 1eb356fdd8323..8934b8b1cf375 100644 > > > --- a/arch/mips/dec/ecc-berr.c > > > +++ b/arch/mips/dec/ecc-berr.c > > > @@ -153,7 +153,7 @@ static int dec_ecc_be_backend(struct pt_regs *regs, int is_fixup, int invoker) > > > /* Ack now, now we've rewritten (or not). */ > > > dec_ecc_be_ack(); > > > > > > - if (syn && syn == (syn & -syn)) { > > > + if (syn && syn == ffs_val(syn)) { > > > > It opencodes is_power_of_2(). > > Correct and it also predates that helper's existence by ~4 years. I'll > be happy to see this converted as the intent will be obviously clearer. > > Maciej > Hi all, (Apologies for the off-topic question regarding email delivery) I noticed Maciej's reply only after seeing David's subsequent response. For some reason, this specific email from Maciej never reached my gmail inbox, nor did it appear in my spam folder. It seems gmail may have silently dropped it. I have retrieved this raw message from the lore.kernel.org web interface to reply here. Since there are other gmail users on this thread (e.g., David, whom I assume received it successfully given the reply), I am wondering if anyone else using gmail experienced similar issues with this message? If anyone has insights on why this might be happening or how to adjust settings to prevent this, please let me know. I want to ensure I don't inadvertently miss any comments or appear unresponsive in the future. Regards, Kuan-Wei