Re: linux-next: build failure after merge of the battery tree

Chris Morgan <[email protected]> Tue, 21 Jul 2026 12:15:32 -0500
Newsgroups org.kernel.vger.linux-next,org.kernel.vger.linux-kernel
Message-ID <PH0PR19MB997338AD35728E948A41A7A05AA5C22@PH0PR19MB997338.namprd19.prod.outlook.com>
On Tue, Jul 21, 2026 at 03:50:58PM +0100, Mark Brown wrote:
> Hi all,
> 
> After merging the battery tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> /tmp/next/build/drivers/power/supply/sgm41542_charger.c:209:12: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>   209 |         reg_val = FIELD_PREP(SGM4154X_PRECHRG_CUR_MASK, reg_val);
>       |                   ^
> /tmp/next/build/drivers/power/supply/sgm41542_charger.c:249:8: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>   249 |         val = FIELD_GET(SGM4154X_ICHRG_CUR_MASK, reg);
>       |               ^
> /tmp/next/build/drivers/power/supply/sgm41542_charger.c:271:12: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>   271 |         reg_val = FIELD_PREP(SGM4154X_VREG_V_MASK, reg_val);
>       |                   ^
> /tmp/next/build/drivers/power/supply/sgm41542_charger.c:293:8: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>   293 |         val = FIELD_GET(SGM4154X_VREG_V_MASK, reg);
>       |               ^
> /tmp/next/build/drivers/power/supply/sgm41542_charger.c:452:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>   452 |         time = FIELD_PREP(SGM4154X_WDT_TIMER_MASK, time);
>       |                ^
> 5 errors generated.
> 
> 
> Caused by commit
> 
>    ac55d04627d41 (power: supply: sgm41542: Add SG Micro sgm41542 charger)
> 
> I have used the version from next-20260720 instead.
> 

Sorry, I wasn't aware this was getting pulled for Linux next or I
would have noted that in the last revision I just sent. I suspect
I'm just missing a header here, which I am also missing in V8 just
submitted. I'll add an include for linux/bitfield.h in revision 9
which I'll send just as soon in the next day or two once I can get
a code review from a human and from the sashiko.dev code bot.

Thank you,
Chris