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:
Johan Hedberg 2017-11-15 09:35:13 +02:00 committed by Johan Hedberg
commit 329a6628e4

View file

@ -314,12 +314,6 @@ static shell_cmd_function_t get_cb(int module, const char *command)
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)
{
if (!strcmp(command, "help")) {
@ -379,7 +373,8 @@ int shell_exec(char *line)
if (app_cmd_handler != NULL) {
cb = app_cmd_handler;
} else {
print_cmd_unknown(argv[0]);
printk("Unrecognized command: %s\n", argv[0]);
printk("Type 'help' for list of available commands\n");
return -EINVAL;
}
}