Let's group all logging related function into one location.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
#include "ioctl.h"
#include "util.h"
-
-static bool nvme_debug;
+#include "log.h"
static int nvme_verify_chr(int fd)
{
(end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec));
}
-void nvme_set_debug(bool debug)
-{
- nvme_debug = debug;
-}
-
-bool nvme_get_debug(void)
-{
- return nvme_debug;
-}
-
static int nvme_submit_passthru(int fd, unsigned long ioctl_cmd,
struct nvme_passthru_cmd *cmd, __u32 *result)
{
*/
int nvme_dim_send(struct nvme_dim_args *args);
-/**
- * nvme_set_debug - Set NVMe command debugging output
- * @debug: true to enable or false to disable
- */
-void nvme_set_debug(bool debug);
-
-/**
- * nvme_get_debug - Get NVMe command debugging output
- *
- * Return: false if disabled or true if enabled.
- */
-bool nvme_get_debug(void);
#endif /* _LIBNVME_IOCTL_H */
#endif
static nvme_root_t root;
+static bool nvme_debug;
void __attribute__((format(printf, 4, 5)))
__nvme_msg(nvme_root_t r, int lvl,
{
root = r;
}
+
+void nvme_set_debug(bool debug)
+{
+ nvme_debug = debug;
+}
+
+bool nvme_get_debug(void)
+{
+ return nvme_debug;
+}
*/
void nvme_set_root(nvme_root_t r);
+/**
+ * nvme_set_debug - Set NVMe command debugging output
+ * @debug: true to enable or false to disable
+ */
+void nvme_set_debug(bool debug);
+
+/**
+ * nvme_get_debug - Get NVMe command debugging output
+ *
+ * Return: false if disabled or true if enabled.
+ */
+bool nvme_get_debug(void);
+
#endif /* _LOG_H */