[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FF1E26F.5000106@hartkopp.net>
Date: Mon, 02 Jul 2012 20:03:27 +0200
From: Oliver Hartkopp <socketcan@...tkopp.net>
To: Rostislav Lisovy <lisovy@...il.com>
CC: netdev@...r.kernel.org, linux-can@...r.kernel.org,
lartc@...r.kernel.org, pisa@....felk.cvut.cz, sojkam1@....cvut.cz
Subject: Re: [PATCH net-next v3] em_canid: Ematch rule to match CAN frames
according to their identifiers
One more simplification:
>> + rulescnt = len / sizeof(struct can_filter);
>> +
>> + cm = kzalloc(sizeof(struct canid_match) + sizeof(struct can_filter) *
>> + rulescnt, GFP_KERNEL);
No need to multiply the value again ... you can take the len value as-is:
cm = kzalloc(sizeof(struct canid_match) + len, GFP_KERNEL);
>
> *cm is no longer a fixed structure as it was in the first patches.
>
> Must be:
>
> m->datalen = sizeof(struct canid_match) + sizeof(struct can_filter) * rulescnt
dito:
m->datalen = sizeof(struct canid_match) + len;
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