Skip to content

Commit 7979d90

Browse files
author
Mike Snitzer
committed
dm vdo logger: remove log level to string conversion code
Was only used by sysfs code, can be reinstated if/when needed. Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Ken Raeburn <[email protected]> Signed-off-by: Matthew Sakai <[email protected]>
1 parent fd5b92b commit 7979d90

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

drivers/md/dm-vdo/logger.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,6 @@
1616
#include "thread-device.h"
1717
#include "thread-utils.h"
1818

19-
struct priority_name {
20-
const char *name;
21-
const int priority;
22-
};
23-
24-
static const struct priority_name PRIORITIES[] = {
25-
{ "ALERT", UDS_LOG_ALERT },
26-
{ "CRITICAL", UDS_LOG_CRIT },
27-
{ "CRIT", UDS_LOG_CRIT },
28-
{ "DEBUG", UDS_LOG_DEBUG },
29-
{ "EMERGENCY", UDS_LOG_EMERG },
30-
{ "EMERG", UDS_LOG_EMERG },
31-
{ "ERROR", UDS_LOG_ERR },
32-
{ "ERR", UDS_LOG_ERR },
33-
{ "INFO", UDS_LOG_INFO },
34-
{ "NOTICE", UDS_LOG_NOTICE },
35-
{ "PANIC", UDS_LOG_EMERG },
36-
{ "WARN", UDS_LOG_WARNING },
37-
{ "WARNING", UDS_LOG_WARNING },
38-
{ NULL, -1 },
39-
};
40-
41-
static const char *const PRIORITY_STRINGS[] = {
42-
"EMERGENCY",
43-
"ALERT",
44-
"CRITICAL",
45-
"ERROR",
46-
"WARN",
47-
"NOTICE",
48-
"INFO",
49-
"DEBUG",
50-
};
51-
5219
int vdo_log_level = UDS_LOG_DEFAULT;
5320

5421
int uds_get_log_level(void)
@@ -62,26 +29,6 @@ int uds_get_log_level(void)
6229
return log_level_latch;
6330
}
6431

65-
int uds_log_string_to_priority(const char *string)
66-
{
67-
int i;
68-
69-
for (i = 0; PRIORITIES[i].name != NULL; i++) {
70-
if (strcasecmp(string, PRIORITIES[i].name) == 0)
71-
return PRIORITIES[i].priority;
72-
}
73-
74-
return UDS_LOG_INFO;
75-
}
76-
77-
const char *uds_log_priority_to_string(int priority)
78-
{
79-
if ((priority < 0) || (priority >= (int) ARRAY_SIZE(PRIORITY_STRINGS)))
80-
return "unknown";
81-
82-
return PRIORITY_STRINGS[priority];
83-
}
84-
8532
static const char *get_current_interrupt_type(void)
8633
{
8734
if (in_nmi())

drivers/md/dm-vdo/logger.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ extern int vdo_log_level;
4545

4646
int uds_get_log_level(void);
4747

48-
int uds_log_string_to_priority(const char *string);
49-
50-
const char *uds_log_priority_to_string(int priority);
51-
5248
void uds_log_embedded_message(int priority, const char *module, const char *prefix,
5349
const char *fmt1, va_list args1, const char *fmt2, ...)
5450
__printf(4, 0) __printf(6, 7);

0 commit comments

Comments
 (0)