Subject: Re: [PATCH 05/17] powerpc: Add __attribute_const__ to ffs()-family implementations

From: Segher Boessenkool <[email-masked]>
Date: Fri, 15 Aug 2025 11:34:56 -0500

Hi!

On Thu, Aug 07, 2025 at 03:16:35PM +0530, Madhavan Srinivasan wrote:
> making them eligible for compiler optimization.

You can instead use GCC for this.  __builtin_ffs () exists since 2003,
and has this attribute built-in, as well as tens of other optimisations
that the kernel thing misses.

Of course using existing stuff instead of cobbling together something
half working prevents you from having a lot of fun ;-)

Segher