Re: [PATCH iproute2-next v2 5/7] iplink_can: add initial CAN XL interface
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2025-12-02 00:38:19
Also in:
linux-can, lkml
From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2025-12-02 00:38:19
Also in:
linux-can, lkml
On Mon, 01 Dec 2025 23:55:13 +0100 Vincent Mailhol [off-list ref] wrote:
-static void can_print_tdc_opt(struct rtattr *tdc_attr)
+static void can_print_tdc_opt(struct rtattr *tdc_attr, bool is_xl)
{
struct rtattr *tb[IFLA_CAN_TDC_MAX + 1];
parse_rtattr_nested(tb, IFLA_CAN_TDC_MAX, tdc_attr);
if (tb[IFLA_CAN_TDC_TDCV] || tb[IFLA_CAN_TDC_TDCO] ||
tb[IFLA_CAN_TDC_TDCF]) {
- open_json_object("tdc");
+ const char *tdc = is_xl ? "xtdc" : "tdc";
+
+ open_json_object(tdc);
can_print_nl_indent();
if (tb[IFLA_CAN_TDC_TDCV]) {
+ const char *tdcv_fmt = is_xl ? " xtdcv %u" : " tdcv %u";Having a format string as variable can break (future) format checking and some compiler flags.