[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E8D528D.8020607@hartkopp.net>
Date: Thu, 06 Oct 2011 09:02:37 +0200
From: Oliver Hartkopp <socketcan@...tkopp.net>
To: Wolfram Sang <w.sang@...gutronix.de>
CC: Wolfgang Grandegger <wg@...ndegger.com>,
Linux Netdev List <netdev@...r.kernel.org>,
Andre Naujoks <nautsch@...il.com>
Subject: Re: [PATCH net] mscan: zero accidentally copied register content
On 10/05/11 18:10, Oliver Hartkopp wrote:
> On 10/05/11 17:51, Wolfram Sang wrote:
>>> + /* zero accidentally copied register content at odd DLCs */
>>> + if (frame->can_dlc & 1)
>>> + frame->data[frame->can_dlc] = 0;
>>> }
>>>
>>> out_8(®s->canrflg, MSCAN_RXF);
>>
>> Nice catch, but wouldn't it be more elegant to never have an invalid byte
>> in the first place?
>>
>> if (can_dlc & 1)
>> *payload = in_be16() & mask;
>>
>
>
> Hm, then i would rather think about changing the for() statement and to read
> byte-by-byte instead of the current in_be16() usage with the 16bit access
> drawbacks ...
>
I think if one would like to rework the 16bit register access (which is used
in the rx path /and/ in the tx path also) this should go via net-next after
some discussion and testing.
IMHO this fix is small and clear and especially not risky. I wonder if
reworking the 16 bit register access is worth the effort?
Regards,
Oliver
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists