Files
linux/net
Gustavo A. R. Silva 5bec1fb866 Bluetooth: Use struct_size() helper
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct foo {
    int stuff;
    struct boo entry[];
};

size = sizeof(struct foo) + count * sizeof(struct boo);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

size = struct_size(instance, entry, count);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2019-04-23 19:31:05 +02:00
..
2019-04-19 14:07:40 -07:00
2019-04-21 10:37:26 -07:00
2019-04-10 12:20:46 -07:00
2019-04-19 14:07:40 -07:00
2019-04-22 21:47:25 -07:00
2019-04-22 21:47:25 -07:00
2019-02-21 16:23:56 -08:00
2019-04-19 14:07:40 -07:00
2019-04-19 14:07:40 -07:00