Skip to content

Commit 70662db

Browse files
X0RW3LLrafaeljw
authored andcommitted
ACPICA: Apply ACPI_NONSTRING in more places
ACPICA commit 1035a3d453f7dd49a235a59ee84ebda9d2d2f41b Add ACPI_NONSTRING for destination char arrays without a terminating NUL character. This is a follow-up to commit 35ad99236f3a ("ACPICA: Apply ACPI_NONSTRING") where not all instances received the same treatment, in preparation for replacing strncpy() calls with memcpy() Link: acpica/acpica@1035a3d4 Signed-off-by: Ahmed Salem <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 64b9dfd commit 70662db

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

drivers/acpi/acpica/acdebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct acpi_db_argument_info {
3737
struct acpi_db_execute_walk {
3838
u32 count;
3939
u32 max_count;
40-
char name_seg[ACPI_NAMESEG_SIZE + 1];
40+
char name_seg[ACPI_NAMESEG_SIZE + 1] ACPI_NONSTRING;
4141
};
4242

4343
#define PARAM_LIST(pl) pl

include/acpi/actbl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
******************************************************************************/
6767

6868
struct acpi_table_header {
69-
char signature[ACPI_NAMESEG_SIZE] __nonstring; /* ASCII table signature */
69+
char signature[ACPI_NAMESEG_SIZE] ACPI_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 */
73-
char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
74-
char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
73+
char oem_id[ACPI_OEM_ID_SIZE] ACPI_NONSTRING; /* ASCII OEM identification */
74+
char oem_table_id[ACPI_OEM_TABLE_ID_SIZE] ACPI_NONSTRING; /* ASCII OEM table identification */
7575
u32 oem_revision; /* OEM revision number */
7676
char asl_compiler_id[ACPI_NAMESEG_SIZE]; /* ASCII ASL compiler vendor ID */
7777
u32 asl_compiler_revision; /* ASL compiler version */

tools/power/acpi/os_specific/service_layers/oslinuxtbl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ACPI_MODULE_NAME("oslinuxtbl")
1919
typedef struct osl_table_info {
2020
struct osl_table_info *next;
2121
u32 instance;
22-
char signature[ACPI_NAMESEG_SIZE];
22+
char signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
2323

2424
} osl_table_info;
2525

tools/power/acpi/tools/acpidump/apfiles.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int ap_open_output_file(char *pathname)
103103

104104
int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
105105
{
106-
char filename[ACPI_NAMESEG_SIZE + 16];
106+
char filename[ACPI_NAMESEG_SIZE + 16] ACPI_NONSTRING;
107107
char instance_str[16];
108108
ACPI_FILE file;
109109
acpi_size actual;

0 commit comments

Comments
 (0)