Subject: Re: [PATCH 9/9] can: pch_can: don't copy data to rx'ed RTR frames

From: Marc Kleine-Budde <[email-masked]>
Date: Sat, 25 Dec 2010 17:25:12 +0100

On 12/25/2010 04:52 PM, Oliver Hartkopp wrote:
> On 25.12.2010 15:40, Marc Kleine-Budde wrote:
>> Signed-off-by: Marc Kleine-Budde <[email-masked]>
>> Cc: Tomoya <tomoya-linux-ECg8zkTtlr0C6LszWs/[email-masked]>
>> ---
>>  drivers/net/can/pch_can.c |   15 ++++++++-------
>>  1 files changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
>> index c42e972..ee488ac 100644
>> --- a/drivers/net/can/pch_can.c
>> +++ b/drivers/net/can/pch_can.c
>> @@ -692,16 +692,17 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 obj_num, int quota)
>>  			cf->can_id = id;
>>  		}
>>  
>> -		if (id2 & PCH_ID2_DIR)
>> -			cf->can_id |= CAN_RTR_FLAG;
>> -
>>  		cf->can_dlc = get_can_dlc((ioread32(&priv->regs->
>>  						    ifregs[0].mcont)) & 0xF);
>>  
>> -		for (i = 0; i < cf->can_dlc; i += 2) {
>> -			data_reg = ioread16(&priv->regs->ifregs[0].data[i / 2]);
>> -			cf->data[i] = data_reg;
>> -			cf->data[i + 1] = data_reg >> 8;
>> +		if (id2 & PCH_ID2_DIR) {
>> +			cf->can_id |= CAN_RTR_FLAG;
>> +
> 
> } else {

doh! Should not write patches after big xmas lunch.
> 
> ???
> 
>> +			for (i = 0; i < cf->can_dlc; i += 2) {
>> +				data_reg = ioread16(&priv->regs->ifregs[0].data[i / 2]);
>> +				cf->data[i] = data_reg;
>> +				cf->data[i + 1] = data_reg >> 8;
>> +			}
>>  		}
>>  
>>  		netif_receive_skb(skb);
> 
> Regards,
> Oliver

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

_______________________________________________
Socketcan-core mailing list
[email-masked]
https://lists.berlios.de/mailman/listinfo/socketcan-core