Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cmd.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _CMD_H
#define _CMD_H
#pragma once

#undef PLUGIN
#define PLUGIN(n, c)

#undef COMMAND_LIST
#define COMMAND_LIST(args...)

#endif
4 changes: 1 addition & 3 deletions common.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _COMMON_H
#define _COMMON_H
#pragma once

#include <string.h>
#include <stdbool.h>
Expand Down Expand Up @@ -118,4 +117,3 @@ static inline void mmio_write64(void *addr, uint64_t value, bool write32)

__raw_writeq(addr, cpu_to_le64(value));
}
#endif
6 changes: 1 addition & 5 deletions fabrics.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _FABRICS_H
#define _FABRICS_H
#pragma once

int fabrics_discovery(const char *desc, int argc, char **argv, bool connect);
int fabrics_connect(const char *desc, int argc, char **argv);
int fabrics_disconnect(const char *desc, int argc, char **argv);
int fabrics_disconnect_all(const char *desc, int argc, char **argv);
int fabrics_config(const char *desc, int argc, char **argv);
int fabrics_dim(const char *desc, int argc, char **argv);


#endif
6 changes: 1 addition & 5 deletions libnvme/src/libnvme-mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
*
* Authors: Jeremy Kerr <jk@codeconstruct.com.au>
*/

#ifndef _LIBNVME_MI_H
#define _LIBNVME_MI_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -21,5 +19,3 @@ extern "C" {
#ifdef __cplusplus
}
#endif

#endif /* _LIBNVME_MI_H */
6 changes: 1 addition & 5 deletions libnvme/src/libnvme.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
* Authors: Keith Busch <keith.busch@wdc.com>
* Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
*/

#ifndef _LIBNVME_H
#define _LIBNVME_H
#pragma once

#ifdef __cplusplus
extern "C" {
Expand All @@ -31,5 +29,3 @@ extern "C" {
#ifdef __cplusplus
}
#endif

#endif /* _LIBNVME_H */
5 changes: 1 addition & 4 deletions libnvme/src/nvme/cleanup.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef __CLEANUP_H
#define __CLEANUP_H
#pragma once

#include <stdlib.h>

Expand Down Expand Up @@ -29,5 +28,3 @@ static inline void libnvme_freep(void *p)
libnvme_free(*(void **)p);
}
#define __cleanup_libnvme_free __cleanup(libnvme_freep)

#endif
5 changes: 1 addition & 4 deletions libnvme/src/nvme/fabrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
* Authors: Keith Busch <keith.busch@wdc.com>
* Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
*/
#ifndef _LIBNVME_FABRICS_H
#define _LIBNVME_FABRICS_H
#pragma once

#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -561,5 +560,3 @@ int libnvmf_nbft_read_files(struct libnvme_global_ctx *ctx, char *path,
*/
void libnvmf_nbft_free(struct libnvme_global_ctx *ctx,
struct nbft_file_entry *head);

#endif /* _LIBNVME_FABRICS_H */
6 changes: 1 addition & 5 deletions libnvme/src/nvme/filters.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
*
* Authors: Keith Busch <keith.busch@wdc.com>
*/

#ifndef _LIBNVME_FILTERS_H
#define _LIBNVME_FILTERS_H
#pragma once

#include <dirent.h>

Expand Down Expand Up @@ -104,5 +102,3 @@ int libnvme_scan_ctrl_namespaces(libnvme_ctrl_t c, struct dirent ***ns);
* Return: number of entries in @ents or a negative error code
*/
int libnvme_scan_ns_head_paths(libnvme_ns_head_t head, struct dirent ***paths);

#endif /* _LIBNVME_FILTERS_H */
6 changes: 1 addition & 5 deletions libnvme/src/nvme/mi-mctp-compat.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */

#ifndef _MI_MCTP_COMPAT_H
#define _MI_MCTP_COMPAT_H
#pragma once

#include <nvme/types.h>

Expand Down Expand Up @@ -36,5 +34,3 @@ struct sockaddr_mctp {

#define MCTP_TAG_MASK 0x07
#define MCTP_TAG_OWNER 0x08

#endif /* _MI_MCTP_COMPAT_H */
6 changes: 1 addition & 5 deletions libnvme/test/ioctl/mock.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */

#ifndef _LIBNVME_TEST_IOCTL_MOCK_H
#define _LIBNVME_TEST_IOCTL_MOCK_H
#pragma once

#include <stddef.h>
#include <stdint.h>
Expand Down Expand Up @@ -103,5 +101,3 @@ void set_mock_io_cmds(const struct mock_cmd *cmds, size_t len);
* Checks that all mock ioctl() invocations were performed.
*/
void end_mock_cmds(void);

#endif /* #ifndef _LIBNVME_TEST_IOCTL_MOCK_H */
6 changes: 1 addition & 5 deletions libnvme/test/ioctl/util.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */

#ifndef _LIBNVME_TEST_IOCTL_UTIL_H
#define _LIBNVME_TEST_IOCTL_UTIL_H
#pragma once

#include <stddef.h>
#include <stdlib.h>
Expand All @@ -24,5 +22,3 @@ static inline void freep(void *p)
free(*(void **)p);
}
#define __cleanup_free __cleanup(freep)

#endif /* #ifndef _LIBNVME_TEST_IOCTL_UTIL_H */
7 changes: 1 addition & 6 deletions libnvme/test/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
* Common test utilities for libnvme tests. These have quite strict error
* handling, so the general pattern is to abort/exit on error.
*/

#ifndef _TEST_UTILS_H
#define _TEST_UTILS_H
#pragma once

#include <stdio.h>

FILE *test_setup_log(void);
void test_print_log_buf(FILE *logfd);
void test_close_log(FILE *fd);

#endif /* _TEST_UTILS_H */

6 changes: 1 addition & 5 deletions logging.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */

#ifndef DEBUG_H_
#define DEBUG_H_
#pragma once

#include <stdbool.h>

Expand Down Expand Up @@ -33,5 +31,3 @@ bool nvme_decide_retry(struct libnvme_transport_handle *hdl,

bool is_printable_at_level(int level);
int map_log_level(int verbose, bool quiet);

#endif // DEBUG_H_
7 changes: 1 addition & 6 deletions nvme-cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
* Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
* Daniel Wagner <dwagner@suse.de>
*/

#ifndef NVME_CMDS
#define NVME_CMDS
#pragma once

#include <nvme/ioctl.h>
#include <nvme/nvme-cmds.h>
Expand Down Expand Up @@ -1770,6 +1768,3 @@ int nvme_namespace_attach_ctrls(struct libnvme_transport_handle *hdl, bool ish,
*/
int nvme_namespace_detach_ctrls(struct libnvme_transport_handle *hdl, bool ish,
__u32 nsid, __u16 num_ctrls, __u16 *ctrlist);


#endif /* NVME_CMDS */
5 changes: 1 addition & 4 deletions nvme-models.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef NVME_MODEL_H
#define NVME_MODEL_H
#pragma once

char *nvme_product_name(const char *devname);

#endif
4 changes: 1 addition & 3 deletions nvme-print.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef NVME_PRINT_H
#define NVME_PRINT_H
#pragma once

#include <inttypes.h>

Expand Down Expand Up @@ -461,4 +460,3 @@ void nvme_json_pel_vendor_specific_event(void *pevent_log_info, __u32 offset,
struct json_object *valid_attrs);

extern char *alloc_error;
#endif /* NVME_PRINT_H */
5 changes: 1 addition & 4 deletions nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*/

#ifndef _NVME_H
#define _NVME_H
#pragma once

#include <dirent.h>
#include <stdbool.h>
Expand Down Expand Up @@ -174,4 +172,3 @@ static inline int nvme_get_nsid_log(struct libnvme_transport_handle *hdl,

return libnvme_get_log(hdl, &cmd, rae, NVME_LOG_PAGE_PDU_SIZE);
}
#endif /* _NVME_H */
5 changes: 1 addition & 4 deletions plugin.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef PLUGIN_H
#define PLUGIN_H
#pragma once

#include <stdbool.h>

Expand Down Expand Up @@ -33,5 +32,3 @@ struct command {

void general_help(struct plugin *plugin, char *str);
int handle_plugin(int argc, char **argv, struct plugin *plugin);

#endif
5 changes: 1 addition & 4 deletions plugins/inspur/inspur-utils.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __INSPUR_UTILS_H__
#define __INSPUR_UTILS_H__
#pragma once

#define BYTE_OF_64K 65536UL
#define BYTE_OF_32K 32768UL
Expand Down Expand Up @@ -171,5 +170,3 @@ typedef struct r1_vendor_log_s {
__u8 rsvlkm[176];
} r1_cli_vendor_log_t;
#pragma pack(pop)

#endif // __INSPUR_UTILS_H__
4 changes: 1 addition & 3 deletions plugins/lm/lm-print.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef LM_PRINT_H
#define LM_PRINT_H
#pragma once

#include <libnvme.h>

Expand Down Expand Up @@ -29,4 +28,3 @@ void lm_show_controller_state_data(struct nvme_lm_controller_state_data *data, s
__u32 offset, nvme_print_flags_t flags);
void lm_show_controller_data_queue(struct nvme_lm_ctrl_data_queue_fid_data *data,
nvme_print_flags_t flags);
#endif /* LM_PRINT_H */
5 changes: 1 addition & 4 deletions plugins/memblaze/memblaze-utils.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __MEMBLAZE_UTILS_H__
#define __MEMBLAZE_UTILS_H__
#pragma once

#define SMART_INFO_OLD_SIZE 512
#define SMART_INFO_NEW_SIZE 4096
Expand Down Expand Up @@ -213,5 +212,3 @@ struct nvme_p4_smart_log
if (print) \
printf(format, value); \
} while (0)

#endif // __MEMBLAZE_UTILS_H__
6 changes: 2 additions & 4 deletions plugins/ocp/ocp-fw-activation-history.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
*
* Authors: karl.dedow@solidigm.com
*/
#pragma once

#include <libnvme.h>

#include "common.h"

#ifndef OCP_FIRMWARE_ACTIVATION_HISTORY_H
#define OCP_FIRMWARE_ACTIVATION_HISTORY_H

struct command;
struct plugin;

Expand Down Expand Up @@ -43,4 +42,3 @@ struct __packed fw_activation_history {
int ocp_fw_activation_history_log(int argc, char **argv, struct command *acmd,
struct plugin *plugin);

#endif
7 changes: 2 additions & 5 deletions plugins/ocp/ocp-hardware-component-log.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
/*
* Copyright (c) 2024
*/
#pragma once

#include "cmd.h"
#include "common.h"
#include "ocp-nvme.h"

#ifndef OCP_HARDWARE_COMPONENT_LOG_H
#define OCP_HARDWARE_COMPONENT_LOG_H

#define HWCOMP_RSVD2_LEN 14
#define HWCOMP_SIZE_LEN 16
#define HWCOMP_RSVD48_LEN 16
Expand Down Expand Up @@ -60,5 +59,3 @@ enum hwcomp_id {

int ocp_hwcomp_log(int argc, char **argv, struct command *acmd, struct plugin *plugin);
const char *hwcomp_id_to_string(__u32 id);

#endif /* OCP_HARDWARE_COMPONENT_LOG_H */
4 changes: 1 addition & 3 deletions plugins/ocp/ocp-print.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef OCP_PRINT_H
#define OCP_PRINT_H
#pragma once

#include "ocp-hardware-component-log.h"
#include "ocp-fw-activation-history.h"
Expand Down Expand Up @@ -54,4 +53,3 @@ void ocp_c9_log(struct telemetry_str_log_format *log_data, __u8 *log_data_buf,
int total_log_page_size, nvme_print_flags_t flags);
void ocp_c7_log(struct libnvme_transport_handle *hdl, struct tcg_configuration_log *log_data,
nvme_print_flags_t flags);
#endif /* OCP_PRINT_H */
7 changes: 1 addition & 6 deletions plugins/ocp/ocp-smart-extended-log.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
* Wei Zhang <wzhang@fb.com>,
* Venkat Ramesh <venkatraghavan@fb.com>
*/
#pragma once

#include <nvme/types.h>

#include "common.h"

#ifndef OCP_SMART_EXTENDED_LOG_H
#define OCP_SMART_EXTENDED_LOG_H

struct command;
struct plugin;

Expand Down Expand Up @@ -156,5 +153,3 @@ struct ocp_smart_extended_log {

int ocp_smart_add_log(int argc, char **argv, struct command *acmd,
struct plugin *plugin);

#endif
Loading
Loading