Thread (6 messages) flat view 6 messages, 3 authors, 2012-07-03

Re: [PATCH net-next v3] em_canid: Ematch rule to match CAN frames according to their identifiers

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2012-07-02 18:03:27
Also in: linux-can

One more simplification:

quoted
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help