|
4 | 4 | * Copyright (c) 2020 Western Digital Corporation or its affiliates. |
5 | 5 | * |
6 | 6 | * Authors: Keith Busch <[email protected]> |
7 | | - * Chaitanya Kulkarni <[email protected]> |
| 7 | + * Chaitanya Kulkarni <[email protected]> |
8 | 8 | */ |
9 | 9 |
|
10 | 10 | #ifndef _LIBNVME_IOCTL_H |
@@ -99,25 +99,25 @@ struct nvme_passthru_cmd { |
99 | 99 | * @result: Set on completion to the command's CQE DWORD 0-1 controller response |
100 | 100 | */ |
101 | 101 | struct nvme_passthru_cmd64 { |
102 | | - __u8 opcode; |
103 | | - __u8 flags; |
104 | | - __u16 rsvd1; |
105 | | - __u32 nsid; |
106 | | - __u32 cdw2; |
107 | | - __u32 cdw3; |
108 | | - __u64 metadata; |
109 | | - __u64 addr; |
110 | | - __u32 metadata_len; |
111 | | - __u32 data_len; |
112 | | - __u32 cdw10; |
113 | | - __u32 cdw11; |
114 | | - __u32 cdw12; |
115 | | - __u32 cdw13; |
116 | | - __u32 cdw14; |
117 | | - __u32 cdw15; |
118 | | - __u32 timeout_ms; |
119 | | - __u32 rsvd2; |
120 | | - __u64 result; |
| 102 | + __u8 opcode; |
| 103 | + __u8 flags; |
| 104 | + __u16 rsvd1; |
| 105 | + __u32 nsid; |
| 106 | + __u32 cdw2; |
| 107 | + __u32 cdw3; |
| 108 | + __u64 metadata; |
| 109 | + __u64 addr; |
| 110 | + __u32 metadata_len; |
| 111 | + __u32 data_len; |
| 112 | + __u32 cdw10; |
| 113 | + __u32 cdw11; |
| 114 | + __u32 cdw12; |
| 115 | + __u32 cdw13; |
| 116 | + __u32 cdw14; |
| 117 | + __u32 cdw15; |
| 118 | + __u32 timeout_ms; |
| 119 | + __u32 rsvd2; |
| 120 | + __u64 result; |
121 | 121 | }; |
122 | 122 |
|
123 | 123 | /** |
@@ -186,16 +186,16 @@ struct nvme_uring_cmd { |
186 | 186 | * @align: Alignment information |
187 | 187 | */ |
188 | 188 | #define sizeof_args(type, member, align) \ |
189 | | - ({ \ |
190 | | - type s; \ |
191 | | - size_t t = offsetof(type, member) + sizeof(s.member); \ |
192 | | - size_t p = (sizeof(align) - (t % sizeof(align))) % sizeof(align); \ |
193 | | - t + p; \ |
194 | | - }) |
| 189 | +({ \ |
| 190 | + type s; \ |
| 191 | + size_t t = offsetof(type, member) + sizeof(s.member); \ |
| 192 | + size_t p = (sizeof(align) - (t % sizeof(align))) % sizeof(align); \ |
| 193 | + t + p; \ |
| 194 | +}) |
195 | 195 |
|
196 | 196 | /** |
197 | 197 | * nvme_submit_admin_passthru64() - Submit a 64-bit nvme passthrough admin |
198 | | - * command |
| 198 | + * command |
199 | 199 | * @fd: File descriptor of nvme device |
200 | 200 | * @cmd: The nvme admin command to send |
201 | 201 | * @result: Optional field to return the result from the CQE DW0-1 |
@@ -517,7 +517,7 @@ static inline int nvme_identify_ns(int fd, __u32 nsid, struct nvme_id_ns *ns) |
517 | 517 |
|
518 | 518 | /** |
519 | 519 | * nvme_identify_allocated_ns() - Same as nvme_identify_ns, but only for |
520 | | - * allocated namespaces |
| 520 | + * allocated namespaces |
521 | 521 | * @fd: File descriptor of nvme device |
522 | 522 | * @nsid: Namespace to identify |
523 | 523 | * @ns: User space destination address to transfer the data |
@@ -709,7 +709,7 @@ static inline int nvme_identify_nvmset_list(int fd, __u16 nvmsetid, |
709 | 709 |
|
710 | 710 | /** |
711 | 711 | * nvme_identify_primary_ctrl() - Retrieve NVMe Primary Controller |
712 | | - * identification |
| 712 | + * identification |
713 | 713 | * @fd: File descriptor of nvme device |
714 | 714 | * @cntid: Return controllers starting at this identifier |
715 | 715 | * @cap: User space destination buffer address to transfer the data |
@@ -779,7 +779,7 @@ static inline int nvme_identify_secondary_ctrl_list(int fd, __u32 nsid, |
779 | 779 |
|
780 | 780 | /** |
781 | 781 | * nvme_identify_ns_granularity() - Retrieves namespace granularity |
782 | | - * identification |
| 782 | + * identification |
783 | 783 | * @fd: File descriptor of nvme device |
784 | 784 | * @gr_list: User space destination address to transfer the data |
785 | 785 | * |
@@ -886,7 +886,7 @@ static inline int nvme_identify_ctrl_csi(int fd, enum nvme_csi csi, void *data) |
886 | 886 | } |
887 | 887 |
|
888 | 888 | /** |
889 | | - * nvme_identify_active_ns_list_csi() - Active namespace ID list associated with a specified I/O command set |
| 889 | + * nvme_identify_active_ns_list_csi() - Active namespace ID list associated with a specified I/O command set |
890 | 890 | * @fd: File descriptor of nvme device |
891 | 891 | * @nsid: Return namespaces greater than this identifier |
892 | 892 | * @csi: Command Set Identifier |
@@ -1287,8 +1287,8 @@ static inline int nvme_get_log_supported_log_pages(int fd, bool rae, |
1287 | 1287 | * Return: The nvme command status if a response was received (see |
1288 | 1288 | * &enum nvme_status_field) or -1 with errno set otherwise. |
1289 | 1289 | */ |
1290 | | -static inline int nvme_get_log_error(int fd, unsigned nr_entries, bool rae, |
1291 | | - struct nvme_error_log_page *err_log) |
| 1290 | +static inline int nvme_get_log_error(int fd, unsigned int nr_entries, bool rae, |
| 1291 | + struct nvme_error_log_page *err_log) |
1292 | 1292 | { |
1293 | 1293 | return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_ERROR, |
1294 | 1294 | NVME_NSID_ALL, sizeof(*err_log) * nr_entries, |
@@ -1641,7 +1641,7 @@ static inline int nvme_get_log_predictable_lat_event(int fd, bool rae, |
1641 | 1641 | * &enum nvme_status_field) or -1 with errno set otherwise. |
1642 | 1642 | */ |
1643 | 1643 | static inline int nvme_get_log_ana(int fd, enum nvme_log_ana_lsp lsp, bool rae, |
1644 | | - __u64 offset, __u32 len, void *log) |
| 1644 | + __u64 offset, __u32 len, void *log) |
1645 | 1645 | { |
1646 | 1646 | struct nvme_get_log_args args = { |
1647 | 1647 | .lpo = offset, |
@@ -2249,7 +2249,7 @@ int nvme_set_features_auto_pst(int fd, bool apste, bool save, |
2249 | 2249 | * nvme_set_features_timestamp() - Set timestamp feature |
2250 | 2250 | * @fd: File descriptor of nvme device |
2251 | 2251 | * @save: Save value across power states |
2252 | | - * @timestamp: The current timestamp value to assign to this this feature |
| 2252 | + * @timestamp: The current timestamp value to assign to this feature |
2253 | 2253 | * |
2254 | 2254 | * Return: The nvme command status if a response was received (see |
2255 | 2255 | * &enum nvme_status_field) or -1 with errno set otherwise. |
@@ -2310,7 +2310,7 @@ int nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid, bool save, |
2310 | 2310 | */ |
2311 | 2311 | int nvme_set_features_plm_config(int fd, bool enable, __u16 nvmsetid, |
2312 | 2312 | bool save, struct nvme_plm_config *data, |
2313 | | - __u32*result); |
| 2313 | + __u32 *result); |
2314 | 2314 |
|
2315 | 2315 | /** |
2316 | 2316 | * nvme_set_features_plm_window() - Set window select feature |
@@ -3067,7 +3067,7 @@ int nvme_security_send(struct nvme_security_send_args *args); |
3067 | 3067 |
|
3068 | 3068 | /** |
3069 | 3069 | * nvme_security_receive() - Security Receive command |
3070 | | - * @args: &struct nvme_security_recevice argument structure |
| 3070 | + * @args: &struct nvme_security_receive argument structure |
3071 | 3071 | * |
3072 | 3072 | * Return: The nvme command status if a response was received (see |
3073 | 3073 | * &enum nvme_status_field) or -1 with errno set otherwise. |
@@ -3250,7 +3250,7 @@ static inline int nvme_directive_recv_stream_parameters(int fd, __u32 nsid, |
3250 | 3250 | * &enum nvme_status_field) or -1 with errno set otherwise. |
3251 | 3251 | */ |
3252 | 3252 | static inline int nvme_directive_recv_stream_status(int fd, __u32 nsid, |
3253 | | - unsigned nr_entries, |
| 3253 | + unsigned int nr_entries, |
3254 | 3254 | struct nvme_streams_directive_status *id) |
3255 | 3255 | { |
3256 | 3256 | struct nvme_directive_recv_args args = { |
@@ -3409,7 +3409,8 @@ int nvme_virtual_mgmt(struct nvme_virtual_mgmt_args *args); |
3409 | 3409 | * Return: The nvme command status if a response was received (see |
3410 | 3410 | * &enum nvme_status_field) or -1 with errno set otherwise. |
3411 | 3411 | */ |
3412 | | -static inline int nvme_flush(int fd, __u32 nsid) { |
| 3412 | +static inline int nvme_flush(int fd, __u32 nsid) |
| 3413 | +{ |
3413 | 3414 | struct nvme_passthru_cmd cmd = {}; |
3414 | 3415 |
|
3415 | 3416 | cmd.opcode = nvme_cmd_flush; |
|
0 commit comments