From: Matthew Sakai <msakai@redhat.com>
To: dm-devel@lists.linux.dev
Cc: Mike Snitzer <snitzer@kernel.org>, Matthew Sakai <msakai@redhat.com>
Subject: [PATCH 4/4] dm vdo logger: remove log level to string conversion code
Date: Fri, 1 Mar 2024 15:47:19 -0500 [thread overview]
Message-ID: <1b15059930ac76c40eee88de5a7a610a4e6d2fa5.1709325896.git.msakai@redhat.com> (raw)
In-Reply-To: <cover.1709325895.git.msakai@redhat.com>
From: Mike Snitzer <snitzer@kernel.org>
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 | 53 --------------------------------------
drivers/md/dm-vdo/logger.h | 4 ---
2 files changed, 57 deletions(-)
diff --git a/drivers/md/dm-vdo/logger.c b/drivers/md/dm-vdo/logger.c
index 5d27cd6483a9..80f1e4c62ac6 100644
--- a/drivers/md/dm-vdo/logger.c
+++ b/drivers/md/dm-vdo/logger.c
@@ -16,39 +16,6 @@
#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())
diff --git a/drivers/md/dm-vdo/logger.h b/drivers/md/dm-vdo/logger.h
index 095532afc9a3..a8cdf46b6fc1 100644
--- a/drivers/md/dm-vdo/logger.h
+++ b/drivers/md/dm-vdo/logger.h
@@ -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);
--
2.42.0
prev parent reply other threads:[~2024-03-01 20:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 20:47 [PATCH 0/4] dm vdo: remove sysfs parameters Matthew Sakai
2024-03-01 20:47 ` [PATCH 1/4] dm vdo: remove all sysfs interfaces Matthew Sakai
2024-03-01 20:47 ` [PATCH 2/4] dm vdo: add 'log_level' module parameter Matthew Sakai
2024-03-01 20:47 ` [PATCH 3/4] dm vdo: document log_level parameter Matthew Sakai
2024-03-01 20:47 ` Matthew Sakai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1b15059930ac76c40eee88de5a7a610a4e6d2fa5.1709325896.git.msakai@redhat.com \
--to=msakai@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=snitzer@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).