Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/802: 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 garp_attr { struct rb_node node; enum garp_applicant_state state; u8 type; u8 dlen; unsigned char 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>
- Loading branch information