linux-next: build failure after merge of the drivers-x86 tree

Stephen Rothwell posted 1 patch 3 weeks, 2 days ago
drivers/platform/x86/lenovo/thinkpad_acpi.c | 1 +
1 file changed, 1 insertion(+)
linux-next: build failure after merge of the drivers-x86 tree
Posted by Stephen Rothwell 3 weeks, 2 days ago
Hi all,

After merging the drivers-x86 tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/platform/x86/lenovo/thinkpad_acpi.c: In function 'display_damage':
drivers/platform/x86/lenovo/thinkpad_acpi.c:11134:23: error: implicit declaration of function 'FIELD_GET' [-Wimplicit-function-declaration]
11134 |         port_status = FIELD_GET(PORT_STATUS, dmg_status);
      |                       ^~~~~~~~~

Caused by commits

  f6b6ce566954 ("platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.")
  520448bb6f09 ("platform/x86: thinkpad_acpi: Add sysfs to display details of damaged device.")

and probably exposed by commit

  5523dcfa4f59 ("Fortify: Use C arithmetic not FIELD_xxx() in FORTIFY_REASON defines")

from the kspp tree which removed the include of bitfield.h from
fortify-string.h.  I wonder if this will affect any other (more exotic)
builds?

I have applied the following patch for today, and this (or something
like it) should probably be applied to the drivers-x86 tree.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 15 Jan 2026 14:17:35 +1100
Subject: [PATCH] fix up for "Fortify: Use C arithmetic not FIELD_xxx() in
 FORTIFY_REASON defines"

interacting with commits

  f6b6ce566954 ("platform/x86: thinkpad_acpi: Add support to detect hardware dam
age detection capability.")
  520448bb6f09 ("platform/x86: thinkpad_acpi: Add sysfs to display details of da
maged device.")

from the drivers-x86 tree.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/platform/x86/lenovo/thinkpad_acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index 95755fa1e008..a272f27e6227 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -36,6 +36,7 @@
 
 #include <linux/acpi.h>
 #include <linux/backlight.h>
+#include <linux/bitfield.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/dmi.h>
-- 
2.52.0

-- 
Cheers,
Stephen Rothwell
Re: linux-next: build failure after merge of the drivers-x86 tree
Posted by Ilpo Järvinen 3 weeks, 2 days ago
On Thu, 15 Jan 2026, Stephen Rothwell wrote:

> After merging the drivers-x86 tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/platform/x86/lenovo/thinkpad_acpi.c: In function 'display_damage':
> drivers/platform/x86/lenovo/thinkpad_acpi.c:11134:23: error: implicit declaration of function 'FIELD_GET' [-Wimplicit-function-declaration]
> 11134 |         port_status = FIELD_GET(PORT_STATUS, dmg_status);
>       |                       ^~~~~~~~~
> 
> Caused by commits
> 
>   f6b6ce566954 ("platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.")
>   520448bb6f09 ("platform/x86: thinkpad_acpi: Add sysfs to display details of damaged device.")
> 
> and probably exposed by commit
> 
>   5523dcfa4f59 ("Fortify: Use C arithmetic not FIELD_xxx() in FORTIFY_REASON defines")
> 
> from the kspp tree which removed the include of bitfield.h from
> fortify-string.h.  I wonder if this will affect any other (more exotic)
> builds?
> 
> I have applied the following patch for today, and this (or something
> like it) should probably be applied to the drivers-x86 tree.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 15 Jan 2026 14:17:35 +1100
> Subject: [PATCH] fix up for "Fortify: Use C arithmetic not FIELD_xxx() in
>  FORTIFY_REASON defines"
> 
> interacting with commits
> 
>   f6b6ce566954 ("platform/x86: thinkpad_acpi: Add support to detect hardware dam
> age detection capability.")
>   520448bb6f09 ("platform/x86: thinkpad_acpi: Add sysfs to display details of da
> maged device.")
> 
> from the drivers-x86 tree.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/platform/x86/lenovo/thinkpad_acpi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> index 95755fa1e008..a272f27e6227 100644
> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> @@ -36,6 +36,7 @@
>  
>  #include <linux/acpi.h>
>  #include <linux/backlight.h>
> +#include <linux/bitfield.h>
>  #include <linux/bitops.h>
>  #include <linux/delay.h>
>  #include <linux/dmi.h>

Thanks Stephen.

I've folded this into the original change.

I do try to pay attention to lack of these headers during review in an 
attempt to avoid problems like this but seem to have missed it in this 
case.


-- 
 i.
Re: linux-next: build failure after merge of the drivers-x86 tree
Posted by Kees Cook 3 weeks, 2 days ago
On Thu, Jan 15, 2026 at 02:52:44PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the drivers-x86 tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/platform/x86/lenovo/thinkpad_acpi.c: In function 'display_damage':
> drivers/platform/x86/lenovo/thinkpad_acpi.c:11134:23: error: implicit declaration of function 'FIELD_GET' [-Wimplicit-function-declaration]
> 11134 |         port_status = FIELD_GET(PORT_STATUS, dmg_status);
>       |                       ^~~~~~~~~
> 
> Caused by commits
> 
>   f6b6ce566954 ("platform/x86: thinkpad_acpi: Add support to detect hardware damage detection capability.")
>   520448bb6f09 ("platform/x86: thinkpad_acpi: Add sysfs to display details of damaged device.")
> 
> and probably exposed by commit
> 
>   5523dcfa4f59 ("Fortify: Use C arithmetic not FIELD_xxx() in FORTIFY_REASON defines")
> 
> from the kspp tree which removed the include of bitfield.h from
> fortify-string.h.  I wonder if this will affect any other (more exotic)
> builds?
> 
> I have applied the following patch for today, and this (or something
> like it) should probably be applied to the drivers-x86 tree.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 15 Jan 2026 14:17:35 +1100
> Subject: [PATCH] fix up for "Fortify: Use C arithmetic not FIELD_xxx() in
>  FORTIFY_REASON defines"
> 
> interacting with commits
> 
>   f6b6ce566954 ("platform/x86: thinkpad_acpi: Add support to detect hardware dam
> age detection capability.")
>   520448bb6f09 ("platform/x86: thinkpad_acpi: Add sysfs to display details of da
> maged device.")
> 
> from the drivers-x86 tree.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/platform/x86/lenovo/thinkpad_acpi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> index 95755fa1e008..a272f27e6227 100644
> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> @@ -36,6 +36,7 @@
>  
>  #include <linux/acpi.h>
>  #include <linux/backlight.h>
> +#include <linux/bitfield.h>
>  #include <linux/bitops.h>
>  #include <linux/delay.h>
>  #include <linux/dmi.h>

Ah! Thanks -- this looks correct to me.

I will run some randconfigs to see if anything pops out.

-- 
Kees Cook