Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [RFC] [PATCH v2] can: fix handling of unmodifiable configuration options
Date: Mon, 14 Mar 2016 19:09:35 +0100	[thread overview]
Message-ID: <56E6FE5F.2000500@hartkopp.net> (raw)
In-Reply-To: <SG2PR06MB1038D9B53602CECA8E34C4D4C3880@SG2PR06MB1038.apcprd06.prod.outlook.com>

On 03/14/2016 11:15 AM, Ramesh Shanmugasundaram wrote:

>> Oliver Hartkopp <socketcan@hartkopp.net>
>> Subject: [RFC] [PATCH v2] can: fix handling of unmodifiable configuration
>> options
>
> (...)
>
>>
>> +static inline void can_set_static_ctrlmode(struct can_priv *priv,
>> +					   const u32 static_mode)
>> +{
>> +	priv->ctrlmode = static_mode;
>> +	priv->ctrlmode_static = static_mode;
>> +}
>
> Is it worth taking the ndev as arg and change the MTU as well in this function? This way mode & MTU would be consistent and would reflect the same in a configuration like this
>
> "ip link set can0 up type can bitrate 1000000 dbitrate 1000000"
>
> Would this be an overkill?

My first thought was that setting the MTU in this function smells fishy.

But as can_set_static_ctrlmode() is intended to be used at CAN device 
setup time only it makes sense to override the MTU which is set in 
can_setup() to CAN_MTU by default.

It doesn't make sense to pass the MTU to alloc_candev() as setting the 
MTU to CAN_MTU is always to correct default (even for configurable CAN 
FD devices).

I'll sed an updated patch which overrides the MTU in 
can_set_static_ctrlmode() when CAN_CTRLMODE_FD is set in ctrlmode_static.

Regards,
Oliver


  reply	other threads:[~2016-03-14 18:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-12 18:31 [RFC] [PATCH v2] can: fix handling of unmodifiable configuration options Oliver Hartkopp
2016-03-14 10:15 ` Ramesh Shanmugasundaram
2016-03-14 18:09   ` Oliver Hartkopp [this message]
2016-03-15  7:14     ` Ramesh Shanmugasundaram

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=56E6FE5F.2000500@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox