linux/net/switchdev
Minghao Chi (CGEL ZTE) d8c2858181 net/switchdev: use struct_size over open coded arithmetic
Replace zero-length array with flexible-array member and make use
of the struct_size() helper in kmalloc(). For example:

struct switchdev_deferred_item {
    ...
    unsigned long data[];
};

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-02-10 15:37:47 +00:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile net: switchdev: use obj-$(CONFIG_NET_SWITCHDEV) form in net/Makefile 2021-01-27 17:03:52 -08:00
switchdev.c net/switchdev: use struct_size over open coded arithmetic 2022-02-10 15:37:47 +00:00