Skip to content

Commit e041a99

Browse files
committed
cleanup: rename _cleanup_nvme_transport_handle_ to __cleanup_nvme_transport_handle
Follow the new naming pattern of the compiler attributes which is just __NAME. This is what the kernel is using as well. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 5f3827f commit e041a99

43 files changed

Lines changed: 307 additions & 307 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

nvme-rpmb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ int rpmb_cmd_option(int argc, char **argv, struct command *acmd, struct plugin *
872872
__cleanup_free unsigned char *key_buf = NULL;
873873
__cleanup_free unsigned char *msg_buf = NULL;
874874
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
875-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
875+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
876876
unsigned int write_cntr = 0;
877877
unsigned int msg_size = 0;
878878
unsigned int key_size = 0;

nvme.c

Lines changed: 94 additions & 94 deletions
Large diffs are not rendered by default.

nvme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int parse_and_open(struct libnvme_global_ctx **ctx,
117117
// TODO: unsure if we need a double ptr here
118118
static inline DEFINE_CLEANUP_FUNC(
119119
cleanup_nvme_transport_handle, struct libnvme_transport_handle *, libnvme_close)
120-
#define _cleanup_nvme_transport_handle_ __cleanup(cleanup_nvme_transport_handle)
120+
#define __cleanup_nvme_transport_handle __cleanup(cleanup_nvme_transport_handle)
121121

122122
extern const char *uuid_index;
123123
extern const char *namespace_id_desired;

plugins/amzn/amzn-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ static int get_stats(int argc, char **argv, struct command *acmd,
561561
struct plugin *plugin)
562562
{
563563
const char *desc = "display command latency statistics";
564-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
564+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
565565
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
566566
struct amzn_latency_log_page log = { 0 };
567567
nvme_print_flags_t flags = 0;

plugins/dapustor/dapustor-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static int dapustor_additional_smart_log(int argc, char **argv, struct command *
511511
const char *json = "Dump output in json format";
512512
#endif /* CONFIG_JSONC */
513513

514-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
514+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
515515
struct nvme_extended_additional_smart_log ext_smart_log;
516516
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
517517
struct nvme_additional_smart_log smart_log;

plugins/dera/dera-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int nvme_dera_get_device_status(struct libnvme_transport_handle *hdl, enu
117117

118118
static int get_status(int argc, char **argv, struct command *acmd, struct plugin *plugin)
119119
{
120-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
120+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
121121
enum dera_device_status state = DEVICE_STATUS_FATAL_ERROR;
122122
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
123123
char *desc = "Get the Dera device status";

plugins/fdp/fdp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static int fdp_configs(int argc, char **argv, struct command *acmd,
2828
const char *raw = "use binary output";
2929

3030
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
31-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
31+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
3232
__cleanup_free void *log = NULL;
3333
struct nvme_fdp_config_log hdr;
3434
nvme_print_flags_t flags;
@@ -98,7 +98,7 @@ static int fdp_usage(int argc, char **argv, struct command *acmd, struct plugin
9898
const char *raw = "use binary output";
9999

100100
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
101-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
101+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
102102
__cleanup_free void *log = NULL;
103103
struct nvme_fdp_ruhu_log hdr;
104104
nvme_print_flags_t flags;
@@ -162,7 +162,7 @@ static int fdp_stats(int argc, char **argv, struct command *acmd, struct plugin
162162
const char *raw = "use binary output";
163163

164164
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
165-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
165+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
166166
struct nvme_fdp_stats_log stats;
167167
nvme_print_flags_t flags;
168168
int err;
@@ -220,7 +220,7 @@ static int fdp_events(int argc, char **argv, struct command *acmd, struct plugin
220220
const char *raw = "use binary output";
221221

222222
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
223-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
223+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
224224
struct nvme_fdp_events_log events;
225225
nvme_print_flags_t flags;
226226
int err;
@@ -278,7 +278,7 @@ static int fdp_status(int argc, char **argv, struct command *acmd, struct plugin
278278
const char *namespace_id = "Namespace identifier";
279279
const char *raw = "use binary output";
280280

281-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
281+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
282282
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
283283
__cleanup_free void *buf = NULL;
284284
struct nvme_fdp_ruh_status hdr;
@@ -351,7 +351,7 @@ static int fdp_update(int argc, char **argv, struct command *acmd, struct plugin
351351
const char *namespace_id = "Namespace identifier";
352352
const char *_pids = "Comma-separated list of placement identifiers to update";
353353

354-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
354+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
355355
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
356356
struct libnvme_passthru_cmd cmd;
357357
unsigned short pids[256];
@@ -418,7 +418,7 @@ static int fdp_set_events(int argc, char **argv, struct command *acmd, struct pl
418418
const char *sv = "specifies that the controller shall save the attribute";
419419

420420
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
421-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
421+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
422422
unsigned short evts[255];
423423
__u8 buf[255];
424424
int err = -1;
@@ -496,7 +496,7 @@ static int fdp_feature(int argc, char **argv, struct command *acmd, struct plugi
496496
const char *disable = "Disable current FDP configuration";
497497

498498
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
499-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
499+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
500500
bool enabling_conf_idx = false;
501501
__u64 result;
502502
int err = -1;

plugins/feat/feat-nvme.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int feat_power_mgmt(int argc, char **argv, struct command *acmd, struct p
140140
const __u8 fid = NVME_FEAT_FID_POWER_MGMT;
141141

142142
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
143-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
143+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
144144
int err;
145145

146146
struct config {
@@ -235,7 +235,7 @@ static int feat_perfc(int argc, char **argv, struct command *acmd, struct plugin
235235
const char *vs_data = "vendor specific data";
236236

237237
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
238-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
238+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
239239
int err;
240240
__u8 fid = NVME_FEAT_FID_PERF_CHARACTERISTICS;
241241
__u32 cdw11;
@@ -299,7 +299,7 @@ static int feat_hctm(int argc, char **argv, struct command *acmd, struct plugin
299299
const __u8 fid = NVME_FEAT_FID_HCTM;
300300

301301
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
302-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
302+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
303303
int err;
304304

305305
struct config {
@@ -362,7 +362,7 @@ static int feat_timestamp(int argc, char **argv, struct command *acmd, struct pl
362362
const char *tstmp = "timestamp";
363363

364364
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
365-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
365+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
366366
int err;
367367

368368
struct config {
@@ -446,7 +446,7 @@ static int feat_temp_thresh(int argc, char **argv, struct command *acmd, struct
446446
const char *tmpthh = "temperature threshold hysteresis";
447447

448448
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
449-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
449+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
450450
int err;
451451

452452
struct temp_thresh_config cfg = { 0 };
@@ -534,7 +534,7 @@ static int feat_arbitration(int argc, char **argv, struct command *acmd, struct
534534
const char *hpw = "high priority weight";
535535

536536
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
537-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
537+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
538538
int err;
539539

540540
struct arbitration_config cfg = { 0 };
@@ -586,7 +586,7 @@ static int feat_volatile_wc(int argc, char **argv, struct command *acmd, struct
586586
const char *wce = "volatile write cache enable";
587587

588588
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
589-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
589+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
590590
int err;
591591

592592
struct config {
@@ -646,7 +646,7 @@ static int feat_power_limit(int argc, char **argv, struct command *acmd,
646646

647647
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
648648

649-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
649+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl =
650650
NULL;
651651
int err;
652652

@@ -718,7 +718,7 @@ static int feat_power_thresh(int argc, char **argv, struct command *acmd,
718718

719719
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
720720

721-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
721+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl =
722722
NULL;
723723
int err;
724724

@@ -795,7 +795,7 @@ static int feat_power_meas(int argc, char **argv, struct command *cmd,
795795

796796
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
797797

798-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
798+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl =
799799
NULL;
800800
int err;
801801

@@ -860,7 +860,7 @@ static int err_recovery_set(struct libnvme_transport_handle *hdl, const __u8 fid
860860
static int feat_err_recovery(int argc, char **argv, struct command *acmd,
861861
struct plugin *plugin)
862862
{
863-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
863+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl =
864864
NULL;
865865
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
866866

@@ -945,7 +945,7 @@ static int num_queues_set(struct libnvme_transport_handle *hdl, const __u8 fid,
945945
static int feat_num_queues(int argc, char **argv, struct command *acmd,
946946
struct plugin *plugin)
947947
{
948-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl =
948+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl =
949949
NULL;
950950
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
951951

plugins/huawei/huawei-nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static int huawei_list(int argc, char **argv, struct command *acmd,
331331
}
332332

333333
for (i = 0; i < n; i++) {
334-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
334+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
335335

336336
snprintf(path, sizeof(path), "/dev/%s", devices[i]->d_name);
337337
ret = libnvme_open(ctx, path, &hdl);

plugins/ibm/ibm-nvme.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int get_ibm_addi_smart_log(int argc, char **argv, struct command *cmd, st
226226
const char *raw = "Dump output in binary format";
227227

228228
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
229-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
229+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
230230
struct nvme_ibm_additional_smart_log smart_log;
231231
int err;
232232

@@ -353,7 +353,7 @@ static void show_ibm_vpd_log(struct nvme_ibm_vpd_log *vpd, const char *devname)
353353
static int get_ibm_vpd_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)
354354
{
355355
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
356-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
356+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
357357
struct nvme_ibm_vpd_log vpd_log;
358358
int err;
359359

@@ -526,7 +526,7 @@ static int get_ibm_persistent_event_log(int argc, char **argv,
526526
"processing this persistent log page command.";
527527
const char *log_len = "number of bytes to retrieve";
528528
__cleanup_nvme_global_ctx struct libnvme_global_ctx *ctx = NULL;
529-
_cleanup_nvme_transport_handle_ struct libnvme_transport_handle *hdl = NULL;
529+
__cleanup_nvme_transport_handle struct libnvme_transport_handle *hdl = NULL;
530530
struct nvme_persistent_event_log pevent_log;
531531
void *pevent_log_info = NULL;
532532
enum nvme_print_flags flags;

0 commit comments

Comments
 (0)