Re: [PATCH] net/switchdev: use struct_size over open coded arithmetic

From: Andrew Lunn
Date: Fri Jan 28 2022 - 13:19:39 EST


On Fri, Jan 28, 2022 at 07:57:29AM +0000, cgel.zte@xxxxxxxxx wrote:
> From: "Minghao Chi (CGEL ZTE)" <chi.minghao@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>

Please could you train your bot to zealously compile test patches
before submitting them?

At the moment you seem to have more patches which fail to build then
actually build. So you are wasting peoples time, which is not going to
make Maintainers happy.

Andrew