dm vdo logger: remove log level to string conversion code
authorMike Snitzer <snitzer@kernel.org>
Wed, 14 Feb 2024 14:53:29 +0000 (08:53 -0600)
committerMike Snitzer <snitzer@kernel.org>
Mon, 4 Mar 2024 20:07:57 +0000 (15:07 -0500)
Was only used by sysfs code, can be reinstated if/when needed.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Ken Raeburn <raeburn@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
drivers/md/dm-vdo/logger.c
drivers/md/dm-vdo/logger.h

index 5d27cd6483a9c0ed9b42b70378878d3529072ad4..80f1e4c62ac6b917a76f878427dff3bd193b1ca5 100644 (file)
 #include "thread-device.h"
 #include "thread-utils.h"
 
-struct priority_name {
-       const char *name;
-       const int priority;
-};
-
-static const struct priority_name PRIORITIES[] = {
-       { "ALERT", UDS_LOG_ALERT },
-       { "CRITICAL", UDS_LOG_CRIT },
-       { "CRIT", UDS_LOG_CRIT },
-       { "DEBUG", UDS_LOG_DEBUG },
-       { "EMERGENCY", UDS_LOG_EMERG },
-       { "EMERG", UDS_LOG_EMERG },
-       { "ERROR", UDS_LOG_ERR },
-       { "ERR", UDS_LOG_ERR },
-       { "INFO", UDS_LOG_INFO },
-       { "NOTICE", UDS_LOG_NOTICE },
-       { "PANIC", UDS_LOG_EMERG },
-       { "WARN", UDS_LOG_WARNING },
-       { "WARNING", UDS_LOG_WARNING },
-       { NULL, -1 },
-};
-
-static const char *const PRIORITY_STRINGS[] = {
-       "EMERGENCY",
-       "ALERT",
-       "CRITICAL",
-       "ERROR",
-       "WARN",
-       "NOTICE",
-       "INFO",
-       "DEBUG",
-};
-
 int vdo_log_level = UDS_LOG_DEFAULT;
 
 int uds_get_log_level(void)
@@ -62,26 +29,6 @@ int uds_get_log_level(void)
        return log_level_latch;
 }
 
-int uds_log_string_to_priority(const char *string)
-{
-       int i;
-
-       for (i = 0; PRIORITIES[i].name != NULL; i++) {
-               if (strcasecmp(string, PRIORITIES[i].name) == 0)
-                       return PRIORITIES[i].priority;
-       }
-
-       return UDS_LOG_INFO;
-}
-
-const char *uds_log_priority_to_string(int priority)
-{
-       if ((priority < 0) || (priority >= (int) ARRAY_SIZE(PRIORITY_STRINGS)))
-               return "unknown";
-
-       return PRIORITY_STRINGS[priority];
-}
-
 static const char *get_current_interrupt_type(void)
 {
        if (in_nmi())
index 095532afc9a385017a12bc7547c4673dab95791e..a8cdf46b6fc1db103a30bcf3911411ab3d0f0bf0 100644 (file)
@@ -45,10 +45,6 @@ extern int vdo_log_level;
 
 int uds_get_log_level(void);
 
-int uds_log_string_to_priority(const char *string);
-
-const char *uds_log_priority_to_string(int priority);
-
 void uds_log_embedded_message(int priority, const char *module, const char *prefix,
                              const char *fmt1, va_list args1, const char *fmt2, ...)
        __printf(4, 0) __printf(6, 7);