Skip to content

Commit 6671709

Browse files
keesrafaeljw
authored andcommitted
ACPICA: struct acpi_resource_dma: Replace 1-element array with flexible array
ACPICA commit 8409bb869a1790f6e02391c3f0eaf9c5fa63e33f Similar to "Replace one-element array with flexible-array", replace the 1-element array with a proper flexible array member as defined by C99, but without changing the structure size. This allows the code to operate without tripping compile-time and run- time bounds checkers (e.g. via __builtin_object_size(), -fsanitize=bounds, and/or -fstrict-flex-arrays=3). As with IRQs, leave a single element in a union. No binary changes appear in the .text nor .data sections. Link: acpica/acpica@8409bb86 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 11132ad commit 6671709

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

include/acpi/acrestyp.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ struct acpi_resource_dma {
150150
u8 bus_master;
151151
u8 transfer;
152152
u8 channel_count;
153-
u8 channels[1];
153+
union {
154+
u8 channel;
155+
ACPI_FLEX_ARRAY(u8, channels);
156+
};
154157
};
155158

156159
struct acpi_resource_start_dependent {

0 commit comments

Comments
 (0)