Skip to content

Commit 74d696f

Browse files
committed
nvme: More whitespace cleanup reported by checkpatch
While checkpatch can be very noise, it finds a lot of style inconsistency. Let's cleanup most of them in the public headers. Signed-off-by: Daniel Wagner <[email protected]>
1 parent bf22c1d commit 74d696f

5 files changed

Lines changed: 224 additions & 230 deletions

File tree

src/nvme/ioctl.h

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,25 @@ struct nvme_passthru_cmd {
9999
* @result: Set on completion to the command's CQE DWORD 0-1 controller response
100100
*/
101101
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;
121121
};
122122

123123
/**
@@ -186,12 +186,12 @@ struct nvme_uring_cmd {
186186
* @align: Alignment information
187187
*/
188188
#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+
})
195195

196196
/**
197197
* nvme_submit_admin_passthru64() - Submit a 64-bit nvme passthrough admin
@@ -1287,8 +1287,8 @@ static inline int nvme_get_log_supported_log_pages(int fd, bool rae,
12871287
* Return: The nvme command status if a response was received (see
12881288
* &enum nvme_status_field) or -1 with errno set otherwise.
12891289
*/
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)
12921292
{
12931293
return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_ERROR,
12941294
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,
16411641
* &enum nvme_status_field) or -1 with errno set otherwise.
16421642
*/
16431643
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)
16451645
{
16461646
struct nvme_get_log_args args = {
16471647
.lpo = offset,
@@ -2249,7 +2249,7 @@ int nvme_set_features_auto_pst(int fd, bool apste, bool save,
22492249
* nvme_set_features_timestamp() - Set timestamp feature
22502250
* @fd: File descriptor of nvme device
22512251
* @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
22532253
*
22542254
* Return: The nvme command status if a response was received (see
22552255
* &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,
23102310
*/
23112311
int nvme_set_features_plm_config(int fd, bool enable, __u16 nvmsetid,
23122312
bool save, struct nvme_plm_config *data,
2313-
__u32*result);
2313+
__u32 *result);
23142314

23152315
/**
23162316
* nvme_set_features_plm_window() - Set window select feature
@@ -3250,7 +3250,7 @@ static inline int nvme_directive_recv_stream_parameters(int fd, __u32 nsid,
32503250
* &enum nvme_status_field) or -1 with errno set otherwise.
32513251
*/
32523252
static inline int nvme_directive_recv_stream_status(int fd, __u32 nsid,
3253-
unsigned nr_entries,
3253+
unsigned int nr_entries,
32543254
struct nvme_streams_directive_status *id)
32553255
{
32563256
struct nvme_directive_recv_args args = {
@@ -3409,7 +3409,8 @@ int nvme_virtual_mgmt(struct nvme_virtual_mgmt_args *args);
34093409
* Return: The nvme command status if a response was received (see
34103410
* &enum nvme_status_field) or -1 with errno set otherwise.
34113411
*/
3412-
static inline int nvme_flush(int fd, __u32 nsid) {
3412+
static inline int nvme_flush(int fd, __u32 nsid)
3413+
{
34133414
struct nvme_passthru_cmd cmd = {};
34143415

34153416
cmd.opcode = nvme_cmd_flush;

src/nvme/linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int nvme_get_logical_block_size(int fd, __u32 nsid, int *blksize);
134134
* @fd: File descriptor of the nvme device
135135
* @rae: Retain asynchronous events
136136
* @log: On success, set to the value of the allocated and retrieved log.
137-
*
137+
*
138138
* Return: The nvme command status if a response was received (see
139139
* &enum nvme_status_field) or -1 with errno set otherwise.
140140
*/

src/nvme/tree.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
304304
#define nvme_for_each_host_safe(r, h, _h) \
305305
for (h = nvme_first_host(r), \
306306
_h = nvme_next_host(r, h); \
307-
h != NULL; \
307+
h != NULL; \
308308
h = _h, _h = nvme_next_host(r, h))
309309

310310
/**
@@ -324,8 +324,8 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
324324
*/
325325
#define nvme_for_each_subsystem_safe(h, s, _s) \
326326
for (s = nvme_first_subsystem(h), \
327-
_s = nvme_next_subsystem(h, s); \
328-
s != NULL; \
327+
_s = nvme_next_subsystem(h, s); \
328+
s != NULL; \
329329
s = _s, _s = nvme_next_subsystem(h, s))
330330

331331
/**
@@ -345,8 +345,8 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
345345
*/
346346
#define nvme_subsystem_for_each_ctrl_safe(s, c, _c) \
347347
for (c = nvme_subsystem_first_ctrl(s), \
348-
_c = nvme_subsystem_next_ctrl(s, c); \
349-
c != NULL; \
348+
_c = nvme_subsystem_next_ctrl(s, c); \
349+
c != NULL; \
350350
c = _c, _c = nvme_subsystem_next_ctrl(s, c))
351351

352352
/**
@@ -366,8 +366,8 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
366366
*/
367367
#define nvme_ctrl_for_each_ns_safe(c, n, _n) \
368368
for (n = nvme_ctrl_first_ns(c), \
369-
_n = nvme_ctrl_next_ns(c, n); \
370-
n != NULL; \
369+
_n = nvme_ctrl_next_ns(c, n); \
370+
n != NULL; \
371371
n = _n, _n = nvme_ctrl_next_ns(c, n))
372372

373373
/**
@@ -387,8 +387,8 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
387387
*/
388388
#define nvme_ctrl_for_each_path_safe(c, p, _p) \
389389
for (p = nvme_ctrl_first_path(c), \
390-
_p = nvme_ctrl_next_path(c, p); \
391-
p != NULL; \
390+
_p = nvme_ctrl_next_path(c, p); \
391+
p != NULL; \
392392
p = _p, _p = nvme_ctrl_next_path(c, p))
393393

394394
/**
@@ -408,8 +408,8 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
408408
*/
409409
#define nvme_subsystem_for_each_ns_safe(s, n, _n) \
410410
for (n = nvme_subsystem_first_ns(s), \
411-
_n = nvme_subsystem_next_ns(s, n); \
412-
n != NULL; \
411+
_n = nvme_subsystem_next_ns(s, n); \
412+
n != NULL; \
413413
n = _n, _n = nvme_subsystem_next_ns(s, n))
414414

415415
/**
@@ -430,7 +430,7 @@ nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
430430
#define nvme_namespace_for_each_path_safe(n, p, _p) \
431431
for (p = nvme_namespace_first_path(n), \
432432
_p = nvme_namespace_next_path(n, p); \
433-
p != NULL; \
433+
p != NULL; \
434434
p = _p, _p = nvme_namespace_next_path(n, p))
435435

436436
/**

0 commit comments

Comments
 (0)