All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, "Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Oliver Hartkopp" <socketcan@hartkopp.net>,
	"David Ahern" <dsahern@kernel.org>,
	"Rakuram Eswaran" <rakuram.e96@gmail.com>,
	"Stéphane Grosjean" <stephane.grosjean@free.fr>,
	linux-kernel@vger.kernel.org, linux-can@vger.kernel.org
Subject: Re: [PATCH iproute2-next v2 5/7] iplink_can: add initial CAN XL interface
Date: Tue, 2 Dec 2025 23:30:41 +0100	[thread overview]
Message-ID: <8acb6a32-bc4a-4f9f-adb2-f8b20dd0d5c9@kernel.org> (raw)
In-Reply-To: <20251201163810.3246dc49@phoenix.local>

On 02/12/2025 at 01:38, Stephen Hemminger wrote:
> On Mon, 01 Dec 2025 23:55:13 +0100
> Vincent Mailhol <mailhol@kernel.org> 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.

Ack. I now see that this would raise some -Wformat-nonliteral warnings. I was
not aware of that flag before reading your comment. This will be addressed in v3.


Yours sincerely,
Vincent Mailhol


  reply	other threads:[~2025-12-02 22:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 22:55 [PATCH iproute2-next v2 0/7] iplink_can: add CAN XL support Vincent Mailhol
2025-12-01 22:55 ` [PATCH iproute2-next v2 1/7] iplink_can: print_usage: fix the text indentation Vincent Mailhol
2025-12-01 22:55 ` [PATCH iproute2-next v2 2/7] iplink_can: print_usage: change unit for minimum time quanta to mtq Vincent Mailhol
2025-12-01 22:55 ` [PATCH iproute2-next v2 3/7] iplink_can: print_usage: describe the CAN bittiming units Vincent Mailhol
2025-12-01 22:55 ` [PATCH iproute2-next v2 4/7] iplink_can: add the "restricted" option Vincent Mailhol
2025-12-01 22:55 ` [PATCH iproute2-next v2 5/7] iplink_can: add initial CAN XL interface Vincent Mailhol
2025-12-02  0:38   ` Stephen Hemminger
2025-12-02 22:30     ` Vincent Mailhol [this message]
2025-12-01 22:55 ` [PATCH iproute2-next v2 6/7] iplink_can: add CAN XL's "tms" option Vincent Mailhol
2025-12-01 22:55 ` [PATCH iproute2-next v2 7/7] iplink_can: add CAN XL's PWM interface Vincent Mailhol
2025-12-02  9:33 ` [PATCH iproute2-next v2 0/7] iplink_can: add CAN XL support Oliver Hartkopp
2025-12-02 22:50   ` Vincent Mailhol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8acb6a32-bc4a-4f9f-adb2-f8b20dd0d5c9@kernel.org \
    --to=mailhol@kernel.org \
    --cc=dsahern@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=rakuram.e96@gmail.com \
    --cc=socketcan@hartkopp.net \
    --cc=stephane.grosjean@free.fr \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.