shell: device_service: fix MISRA 5.7 violation
Changes in device_service have triggered MISRA 5.7 violation CI error (Tag name should be unique). Renamed shell to sh, same as some other modules. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
751f685043
commit
e5eade32e2
1 changed files with 23 additions and 23 deletions
|
@ -60,7 +60,7 @@ static const char *get_device_name(const struct device *dev,
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool device_get_config_level(const struct shell *shell,
|
static bool device_get_config_level(const struct shell *sh,
|
||||||
enum init_level level)
|
enum init_level level)
|
||||||
{
|
{
|
||||||
const struct device *dev;
|
const struct device *dev;
|
||||||
|
@ -71,49 +71,49 @@ static bool device_get_config_level(const struct shell *shell,
|
||||||
if (device_is_ready(dev)) {
|
if (device_is_ready(dev)) {
|
||||||
devices = true;
|
devices = true;
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- %s\n",
|
shell_fprintf(sh, SHELL_NORMAL, "- %s\n",
|
||||||
get_device_name(dev, buf, sizeof(buf)));
|
get_device_name(dev, buf, sizeof(buf)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return devices;
|
return devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_device_levels(const struct shell *shell,
|
static int cmd_device_levels(const struct shell *sh,
|
||||||
size_t argc, char **argv)
|
size_t argc, char **argv)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 1:\n");
|
shell_fprintf(sh, SHELL_NORMAL, "PRE KERNEL 1:\n");
|
||||||
ret = device_get_config_level(shell, INIT_LEVEL_PRE_KERNEL_1);
|
ret = device_get_config_level(sh, INIT_LEVEL_PRE_KERNEL_1);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
shell_fprintf(sh, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "PRE KERNEL 2:\n");
|
shell_fprintf(sh, SHELL_NORMAL, "PRE KERNEL 2:\n");
|
||||||
ret = device_get_config_level(shell, INIT_LEVEL_PRE_KERNEL_2);
|
ret = device_get_config_level(sh, INIT_LEVEL_PRE_KERNEL_2);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
shell_fprintf(sh, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "POST_KERNEL:\n");
|
shell_fprintf(sh, SHELL_NORMAL, "POST_KERNEL:\n");
|
||||||
ret = device_get_config_level(shell, INIT_LEVEL_POST_KERNEL);
|
ret = device_get_config_level(sh, INIT_LEVEL_POST_KERNEL);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
shell_fprintf(sh, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "APPLICATION:\n");
|
shell_fprintf(sh, SHELL_NORMAL, "APPLICATION:\n");
|
||||||
ret = device_get_config_level(shell, INIT_LEVEL_APPLICATION);
|
ret = device_get_config_level(sh, INIT_LEVEL_APPLICATION);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
shell_fprintf(sh, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "SMP:\n");
|
shell_fprintf(sh, SHELL_NORMAL, "SMP:\n");
|
||||||
ret = device_get_config_level(shell, INIT_LEVEL_SMP);
|
ret = device_get_config_level(sh, INIT_LEVEL_SMP);
|
||||||
if (ret == false) {
|
if (ret == false) {
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- None\n");
|
shell_fprintf(sh, SHELL_NORMAL, "- None\n");
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ static int cmd_device_list_visitor(const struct device *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmd_device_list(const struct shell *shell,
|
static int cmd_device_list(const struct shell *sh,
|
||||||
size_t argc, char **argv)
|
size_t argc, char **argv)
|
||||||
{
|
{
|
||||||
const struct device *devlist;
|
const struct device *devlist;
|
||||||
|
@ -147,14 +147,14 @@ static int cmd_device_list(const struct shell *shell,
|
||||||
ARG_UNUSED(argc);
|
ARG_UNUSED(argc);
|
||||||
ARG_UNUSED(argv);
|
ARG_UNUSED(argv);
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "devices:\n");
|
shell_fprintf(sh, SHELL_NORMAL, "devices:\n");
|
||||||
|
|
||||||
for (dev = devlist; dev < devlist_end; dev++) {
|
for (dev = devlist; dev < devlist_end; dev++) {
|
||||||
char buf[20];
|
char buf[20];
|
||||||
const char *name = get_device_name(dev, buf, sizeof(buf));
|
const char *name = get_device_name(dev, buf, sizeof(buf));
|
||||||
const char *state = "READY";
|
const char *state = "READY";
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, "- %s", name);
|
shell_fprintf(sh, SHELL_NORMAL, "- %s", name);
|
||||||
if (!device_is_ready(dev)) {
|
if (!device_is_ready(dev)) {
|
||||||
state = "DISABLED";
|
state = "DISABLED";
|
||||||
} else {
|
} else {
|
||||||
|
@ -168,10 +168,10 @@ static int cmd_device_list(const struct shell *shell,
|
||||||
#endif /* CONFIG_PM_DEVICE */
|
#endif /* CONFIG_PM_DEVICE */
|
||||||
}
|
}
|
||||||
|
|
||||||
shell_fprintf(shell, SHELL_NORMAL, " (%s)\n", state);
|
shell_fprintf(sh, SHELL_NORMAL, " (%s)\n", state);
|
||||||
if (!k_is_user_context()) {
|
if (!k_is_user_context()) {
|
||||||
struct cmd_device_list_visitor_context ctx = {
|
struct cmd_device_list_visitor_context ctx = {
|
||||||
.shell = shell,
|
.shell = sh,
|
||||||
.buf = buf,
|
.buf = buf,
|
||||||
.buf_size = sizeof(buf),
|
.buf_size = sizeof(buf),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue