public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/1] cmd: change the return value when argc error
@ 2022-12-09  9:17 Shenlin Liang
  2022-12-09  9:17 ` [PATCH 1/1] " Shenlin Liang
  0 siblings, 1 reply; 4+ messages in thread
From: Shenlin Liang @ 2022-12-09  9:17 UTC (permalink / raw)
  To: u-boot; +Cc: zhangdongdong, jinyanjiang, zhengyu, zhuwenjun, Shenlin Liang

When the number of parameters is wrong, the return value should be processed in 
the same way as other cmds, return CMD_RET_USAGE so that it can print the information.

Shenlin Liang (1):
  cmd: change the return value when arguments missing

 cmd/mvebu/comphy_rx_training.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.31.1.windows.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] cmd: change the return value when argc error
  2022-12-09  9:17 [PATCH 0/1] cmd: change the return value when argc error Shenlin Liang
@ 2022-12-09  9:17 ` Shenlin Liang
  2022-12-13  5:58   ` Simon Glass
  2023-01-12 15:18   ` Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Shenlin Liang @ 2022-12-09  9:17 UTC (permalink / raw)
  To: u-boot; +Cc: zhangdongdong, jinyanjiang, zhengyu, zhuwenjun, Shenlin Liang

When the number of parameters is wrong, the return value should be processed in 
the same way as other cmds, return CMD_RET_USAGE so that it can print the information.

Signed-off-by: Shenlin Liang <liangshenlin@eswincomputing.com>
---
 cmd/mvebu/comphy_rx_training.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/mvebu/comphy_rx_training.c b/cmd/mvebu/comphy_rx_training.c
index 25a9e153de..4ee8f54ea9 100644
--- a/cmd/mvebu/comphy_rx_training.c
+++ b/cmd/mvebu/comphy_rx_training.c
@@ -22,7 +22,7 @@ int mvebu_comphy_rx_training_cmd(struct cmd_tbl *cmdtp, int flag, int argc,
 
 	if (argc != 3) {
 		printf("missing arguments\n");
-		return -1;
+		return CMD_RET_USAGE;
 	}
 
 	cp_index = hextoul(argv[1], NULL);
-- 
2.31.1.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] cmd: change the return value when argc error
  2022-12-09  9:17 ` [PATCH 1/1] " Shenlin Liang
@ 2022-12-13  5:58   ` Simon Glass
  2023-01-12 15:18   ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Glass @ 2022-12-13  5:58 UTC (permalink / raw)
  To: Shenlin Liang; +Cc: u-boot, zhangdongdong, jinyanjiang, zhengyu, zhuwenjun

On Sat, 10 Dec 2022 at 01:50, Shenlin Liang
<liangshenlin@eswincomputing.com> wrote:
>
> When the number of parameters is wrong, the return value should be processed in
> the same way as other cmds, return CMD_RET_USAGE so that it can print the information.
>
> Signed-off-by: Shenlin Liang <liangshenlin@eswincomputing.com>
> ---
>  cmd/mvebu/comphy_rx_training.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] cmd: change the return value when argc error
  2022-12-09  9:17 ` [PATCH 1/1] " Shenlin Liang
  2022-12-13  5:58   ` Simon Glass
@ 2023-01-12 15:18   ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2023-01-12 15:18 UTC (permalink / raw)
  To: Shenlin Liang; +Cc: u-boot, zhangdongdong, jinyanjiang, zhengyu, zhuwenjun

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

On Fri, Dec 09, 2022 at 05:17:43PM +0800, Shenlin Liang wrote:

> When the number of parameters is wrong, the return value should be processed in 
> the same way as other cmds, return CMD_RET_USAGE so that it can print the information.
> 
> Signed-off-by: Shenlin Liang <liangshenlin@eswincomputing.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-12 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-09  9:17 [PATCH 0/1] cmd: change the return value when argc error Shenlin Liang
2022-12-09  9:17 ` [PATCH 1/1] " Shenlin Liang
2022-12-13  5:58   ` Simon Glass
2023-01-12 15:18   ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox