From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Rostislav Lisovy <lisovy@gmail.com>
Cc: netdev@vger.kernel.org, linux-can@vger.kernel.org,
lartc@vger.kernel.org, pisa@cmp.felk.cvut.cz,
sojkam1@fel.cvut.cz
Subject: Re: [PATCH net-next v3] em_canid: Ematch rule to match CAN frames according to their identifiers
Date: Mon, 02 Jul 2012 20:03:27 +0200 [thread overview]
Message-ID: <4FF1E26F.5000106@hartkopp.net> (raw)
In-Reply-To: <4FF1DF65.5080306@hartkopp.net>
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
next prev parent reply other threads:[~2012-07-02 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 15:06 [PATCH net-next v3] em_canid: Ematch rule to match CAN frames according to their identifiers Rostislav Lisovy
2012-07-02 17:04 ` Oliver Hartkopp
2012-07-02 17:50 ` Oliver Hartkopp
2012-07-02 18:03 ` Oliver Hartkopp [this message]
2012-07-03 5:15 ` Awaiting upsteam? - " Oliver Hartkopp
2012-07-03 5:22 ` David Miller
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=4FF1E26F.5000106@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=lartc@vger.kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=lisovy@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pisa@cmp.felk.cvut.cz \
--cc=sojkam1@fel.cvut.cz \
/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.