Skip to content

Commit 4b4bd8c

Browse files
committed
gcc-15: acpi: sprinkle random '__nonstring' crumbles around
This is not great: I'd much rather introduce a typedef that is a "ACPI name byte buffer", and use that to mark these special 4-byte ACPI names that do not use NUL termination. But as noted in the previous commit ("gcc-15: make 'unterminated string initialization' just a warning") gcc doesn't actually seem to support that notion, so instead you have to just mark every single array declaration individually. So this is not pretty, but this gets rid of the bulk of the annoying warnings during an allmodconfig build for me. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d5d45a7 commit 4b4bd8c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

drivers/acpi/acpica/aclocal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state);
293293
* expected_return_btypes - Allowed type(s) for the return value
294294
*/
295295
struct acpi_name_info {
296-
char name[ACPI_NAMESEG_SIZE];
296+
char name[ACPI_NAMESEG_SIZE] __nonstring;
297297
u16 argument_list;
298298
u8 expected_btypes;
299299
};
@@ -370,7 +370,7 @@ typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node *
370370
converted_object);
371371

372372
struct acpi_simple_repair_info {
373-
char name[ACPI_NAMESEG_SIZE];
373+
char name[ACPI_NAMESEG_SIZE] __nonstring;
374374
u32 unexpected_btypes;
375375
u32 package_index;
376376
acpi_object_converter object_converter;

drivers/acpi/acpica/nsrepair2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ acpi_status (*acpi_repair_function) (struct acpi_evaluate_info * info,
2525
return_object_ptr);
2626

2727
typedef struct acpi_repair_info {
28-
char name[ACPI_NAMESEG_SIZE];
28+
char name[ACPI_NAMESEG_SIZE] __nonstring;
2929
acpi_repair_function repair_function;
3030

3131
} acpi_repair_info;

drivers/acpi/tables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static u8 __init acpi_table_checksum(u8 *buffer, u32 length)
396396
}
397397

398398
/* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */
399-
static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst = {
399+
static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst __nonstring = {
400400
ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,
401401
ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,
402402
ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT,

include/acpi/actbl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
******************************************************************************/
6767

6868
struct acpi_table_header {
69-
char signature[ACPI_NAMESEG_SIZE]; /* ASCII table signature */
69+
char signature[ACPI_NAMESEG_SIZE] __nonstring; /* ASCII table signature */
7070
u32 length; /* Length of table in bytes, including this header */
7171
u8 revision; /* ACPI Specification minor version number */
7272
u8 checksum; /* To make sum of entire table == 0 */

0 commit comments

Comments
 (0)