Gustavo A. R. Silva 8adeac3be0 dm stripe: use struct_size() in kmalloc()
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 stripe_c {
        ...
        struct stripe stripe[0];
};

In this case alloc_context() and dm_array_too_big() are removed and
replaced by the direct use of the struct_size() helper in kmalloc().

Notice that open-coded form is prone to type mistakes.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2019-11-05 14:09:59 -05:00
..
2019-09-22 09:30:30 -07:00
2019-10-15 12:19:08 -07:00
2019-09-18 11:14:31 -07:00
2019-10-21 14:05:26 +02:00
2019-10-23 06:14:29 -04:00
2019-10-29 17:43:33 +01:00
2019-10-04 11:13:09 -07:00
2019-09-23 19:37:49 -07:00