[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241112172812.590665-12-mailhol.vincent@wanadoo.fr>
Date: Wed, 13 Nov 2024 02:27:54 +0900
From: Vincent Mailhol <mailhol.vincent@...adoo.fr>
To: netdev@...r.kernel.org,
Stephen Hemminger <stephen@...workplumber.org>,
David Ahern <dsahern@...il.com>,
linux-can@...r.kernel.org,
Marc Kleine-Budde <mkl@...gutronix.de>,
Oliver Hartkopp <socketcan@...tkopp.net>
Cc: Robert Nawrath <mbro1689@...il.com>,
linux-kernel@...r.kernel.org,
Vincent Mailhol <mailhol.vincent@...adoo.fr>
Subject: [PATCH iproute2-next v1 4/6] iplink_can: use invarg() instead of fprintf()
invarg() is specifically designed to print error messages when an
invalid argument is provided. Replace the generic fprintf() by
invarg() in can_parse_opt().
Signed-off-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>
---
ip/iplink_can.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index 6c6fcf61..928d5d79 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -254,10 +254,8 @@ static int can_parse_opt(struct link_util *lu, int argc, char **argv,
cm.mask |= CAN_CTRLMODE_TDC_AUTO |
CAN_CTRLMODE_TDC_MANUAL;
} else {
- fprintf(stderr,
- "Error: argument of \"tdc-mode\" must be \"auto\", \"manual\" or \"off\", not \"%s\"\n",
+ invarg("\"tdc-mode\" must be either of \"auto\", \"manual\" or \"off\"",
*argv);
- exit (-1);
}
} else if (matches(*argv, "restart") == 0) {
__u32 val = 1;
--
2.45.2
Powered by blists - more mailing lists