History

virtio: uapi: Drop __packed attribute in linux/virtio_pci.h

Commit 92792ac752aa ("virtio-pci: Introduce admin command sending function") added "__packed" structures to UAPI header linux/virtio_pci.h. This triggers build failures in the consumer userspace applications without proper "definition" of __packed (e.g., kvmtool build fails). Moreover, the structures are already packed well, and doesn't need explicit packing, similar to the rest of the structures in all virtio_* headers. Remove the __packed attribute.

Suzuki K Poulose committed 2 years ago

Commit ec6ecb81 parent f6baca21 file · +5 −5Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/virtio_pci.h+5−5
@@ -240,7 +240,7 @@ struct virtio_pci_cfg_cap { · 239 unmodified lines
240240 #define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5
241241 #define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6
242242
243−struct __packed virtio_admin_cmd_hdr {
243+struct virtio_admin_cmd_hdr {
244244 __le16 opcode;
245245 /*
246246 * 1 - SR-IOV
@@ -252,20 +252,20 @@ struct __packed virtio_admin_cmd_hdr { · 5 unmodified lines
252252 __le64 group_member_id;
253253 };
254254
255−struct __packed virtio_admin_cmd_status {
255+struct virtio_admin_cmd_status {
256256 __le16 status;
257257 __le16 status_qualifier;
258258 /* Unused, reserved for future extensions. */
259259 __u8 reserved2[4];
260260 };
261261
262−struct __packed virtio_admin_cmd_legacy_wr_data {
262+struct virtio_admin_cmd_legacy_wr_data {
263263 __u8 offset; /* Starting offset of the register(s) to write. */
264264 __u8 reserved[7];
265265 __u8 registers[];
266266 };
267267
268−struct __packed virtio_admin_cmd_legacy_rd_data {
268+struct virtio_admin_cmd_legacy_rd_data {
269269 __u8 offset; /* Starting offset of the register(s) to read. */
270270 };
271271
@@ -275,7 +275,7 @@ struct __packed virtio_admin_cmd_legacy_rd_data { · 3 unmodified lines
275275
276276 #define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4
277277
278−struct __packed virtio_admin_cmd_notify_info_data {
278+struct virtio_admin_cmd_notify_info_data {
279279 __u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */
280280 __u8 bar; /* BAR of the member or the owner device */
281281 __u8 padding[6];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t