diff options
author | Michael Kelley <mhklinux@outlook.com> | 2025-05-13 21:44:40 -0700 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2025-05-23 16:30:56 +0000 |
commit | dd1af0c4c56d7c60eaf7f30f9d816ed1befbd7d7 (patch) | |
tree | 3e3dcdf72e02da793771b40e1b832556fcd66c46 /scripts/lib/kdoc/kdoc_output.py | |
parent | cd1769e1fef9ab8fbdfafb67b2c327418867afb6 (diff) |
PCI: hv: Remove unnecessary flex array in struct pci_packet
struct pci_packet contains a "message" field that is a flex array
of struct pci_message. struct pci_packet is usually followed by a
second struct in a containing struct that is defined locally in
individual functions in pci-hyperv.c. As such, the compiler
flag -Wflex-array-member-not-at-end (introduced in gcc-14) generates
multiple warnings such as:
drivers/pci/controller/pci-hyperv.c:3809:35: warning: structure
containing a flexible array member is not at the end of another
structure [-Wflex-array-member-not-at-end]
The Linux kernel intends to introduce this compiler flag in standard
builds, so the current code is problematic in generating these warnings.
The "message" field is used only to locate the start of the second
struct, and not as an array. Because the second struct can be
addressed directly, the "message" field is not really necessary.
Rather than try to fix its usage to meet the requirements of
-Wflex-array-member-not-at-end, just eliminate the field and
either directly reference the second struct, or use "pkt + 1"
when "pkt" is dynamically allocated.
Reported-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/20250514044440.48924-1-mhklinux@outlook.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250514044440.48924-1-mhklinux@outlook.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_output.py')
0 files changed, 0 insertions, 0 deletions