Skip to content

Commit b289574

Browse files
committed
ioctl: Rearrange members in nvme_fw_commit_args
Avoid any holes in the struct by rearranging the members. Also add the attribute packed to struct definition to reduce ABI breakage. struct nvme_fw_commit_args { int args_size; /* 0 4 */ int fd; /* 4 4 */ __u32 * result; /* 8 8 */ __u32 timeout; /* 16 4 */ enum nvme_fw_commit_ca action; /* 20 4 */ __u8 slot; /* 24 1 */ _Bool bpid; /* 25 1 */ /* size: 32, cachelines: 1, members: 7 */ /* padding: 6 */ /* last cacheline: 32 bytes */ } __attribute__((__aligned__(8))); Signed-off-by: Daniel Wagner <[email protected]>
1 parent 46a2473 commit b289574

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/nvme/ioctl.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,21 +2892,21 @@ int nvme_fw_download(struct nvme_fw_download_args *args);
28922892
/**
28932893
* nvme_fw_commit_args - Arguments for the NVMe Firmware Commit command
28942894
* @fd: File descriptor of nvme device
2895-
* @slot: Firmware slot to commit the downloaded image
28962895
* @action: Action to use for the firmware image, see &enum nvme_fw_commit_ca
2897-
* @bpid: Set to true to select the boot partition id
28982896
* @timeout: Timeout in ms
28992897
* @result: The command completion result from CQE dword0
2898+
* @slot: Firmware slot to commit the downloaded image
2899+
* @bpid: Set to true to select the boot partition id
29002900
*/
29012901
struct nvme_fw_commit_args {
29022902
int args_size;
29032903
int fd;
2904-
__u8 slot;
2904+
__u32 *result;
2905+
__u32 timeout;
29052906
enum nvme_fw_commit_ca action;
2907+
__u8 slot;
29062908
bool bpid;
2907-
__u32 timeout;
2908-
__u32 *result;
2909-
};
2909+
} __attribute__((packed, aligned(__alignof__(__u32*))));
29102910

29112911
/**
29122912
* nvme_fw_commit() - Commit firmware using the specified action

0 commit comments

Comments
 (0)