shell: Remove unnecessary function
The print_cmd_unknown() is just a two-liner and only called from a single place, so just do the printk calls inline. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
f9e30ed582
commit
329a6628e4
1 changed files with 2 additions and 7 deletions
|
@ -314,12 +314,6 @@ static shell_cmd_function_t get_cb(int module, const char *command)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void print_cmd_unknown(char *argv)
|
|
||||||
{
|
|
||||||
printk("Unrecognized command: %s\n", argv);
|
|
||||||
printk("Type 'help' for list of available commands\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
static shell_cmd_function_t get_internal(const char *command)
|
static shell_cmd_function_t get_internal(const char *command)
|
||||||
{
|
{
|
||||||
if (!strcmp(command, "help")) {
|
if (!strcmp(command, "help")) {
|
||||||
|
@ -379,7 +373,8 @@ int shell_exec(char *line)
|
||||||
if (app_cmd_handler != NULL) {
|
if (app_cmd_handler != NULL) {
|
||||||
cb = app_cmd_handler;
|
cb = app_cmd_handler;
|
||||||
} else {
|
} else {
|
||||||
print_cmd_unknown(argv[0]);
|
printk("Unrecognized command: %s\n", argv[0]);
|
||||||
|
printk("Type 'help' for list of available commands\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue