mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 19:57:31 +00:00
hv:change shell_puts to void type
Change this function to void type Remove some parameters check, add these checks as preconditions Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
parent
4cab8b9cc5
commit
2d03706dd5
@ -170,7 +170,7 @@ uint8_t shell_getc_serial(struct shell *p_shell);
|
|||||||
void shell_special_serial(struct shell *p_shell, uint8_t ch);
|
void shell_special_serial(struct shell *p_shell, uint8_t ch);
|
||||||
void kick_shell(struct shell *p_shell);
|
void kick_shell(struct shell *p_shell);
|
||||||
|
|
||||||
int shell_puts(struct shell *p_shell, const char *str_ptr);
|
void shell_puts(struct shell *p_shell, const char *str_ptr);
|
||||||
int shell_set_name(struct shell *p_shell, const char *name);
|
int shell_set_name(struct shell *p_shell, const char *name);
|
||||||
int shell_trigger_crash(struct shell *p_shell, int argc, char **argv);
|
int shell_trigger_crash(struct shell *p_shell, int argc, char **argv);
|
||||||
|
|
||||||
|
@ -159,23 +159,16 @@ int shell_init(void)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
int shell_puts(struct shell *p_shell, const char *str_ptr)
|
/**
|
||||||
|
* @pre p_shell != NULL
|
||||||
|
* @pre p_shell->session_io.io_puts != NULL
|
||||||
|
* @pre str_ptr != NULL
|
||||||
|
*/
|
||||||
|
void shell_puts(struct shell *p_shell, const char *str_ptr)
|
||||||
{
|
{
|
||||||
int status;
|
/* Transmit data using this shell session's 'puts' function */
|
||||||
|
p_shell->session_io.io_puts(p_shell, str_ptr);
|
||||||
|
|
||||||
if ((p_shell != NULL) && (p_shell->session_io.io_puts != NULL) &&
|
|
||||||
(str_ptr != NULL)) {
|
|
||||||
/* Transmit data using this shell session's 'puts' function */
|
|
||||||
p_shell->session_io.io_puts(p_shell, str_ptr);
|
|
||||||
|
|
||||||
status = 0;
|
|
||||||
} else {
|
|
||||||
/* Error: Invalid request */
|
|
||||||
status = -EINVAL;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int shell_set_name(struct shell *p_shell, const char *name)
|
int shell_set_name(struct shell *p_shell, const char *name)
|
||||||
|
Loading…
Reference in New Issue
Block a user