[PATCH v1 16/30] ACPICA: fix: build error with gcc 16: unused-but-set-variable
From: Pawel Chmielewski
Date: Tue Oct 20 2026 - 10:51:53 EST
From: purofle <yuguo.or@xxxxxxxxxxxxxxxx>
Since GCC 16, -Wunused-but-set-* warning options have been extended to
have multiple levels controlling what kinds of uses disable the warnings
for variables which are otherwise unused. Older versions of GCC only
implemented what has become -Wunused-but-set-variable=1 or
-Wunused-but-set-parameter=1, while the new default for
-Wunused-but-set-variable or -Wunused-but-set-parameter is =3 (the new
defaults are also used when these warnings are enabled by -Wall or
-Wextra, respectively). =2 ignores pre/post inc/decrements on the
variable, =3 also ignores compound assignments if the LHS variable is
not also used on the RHS.
Use ACPI_UNUSED_VAR on the NumCarats variable. This variable causes the
unused warning because its use is only compiled if ACPI_DEBUG_OUTPUT is
defined.
Link: https://github.com/acpica/acpica/commit/24aa4f85589b
Signed-off-by: purofle <yuguo.or@xxxxxxxxxxxxxxxx>
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
Signed-off-by: Pawel Chmielewski <pawel.chmielewski@xxxxxxxxx>
---
drivers/acpi/acpica/nsaccess.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index a0c1a665dfc1..1e7945ccff84 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -292,7 +292,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
struct acpi_namespace_node *current_node = NULL;
struct acpi_namespace_node *this_node = NULL;
u32 num_segments;
- u32 num_carats;
+ u32 ACPI_UNUSED_VAR num_carats;
acpi_name simple_name;
acpi_object_type type_to_check_for;
acpi_object_type this_search_type;
--
2.50.1