iavf: use struct_size() helper
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Fri, 14 Jun 2019 23:23:20 +0000 (16:23 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 28 Jun 2019 22:59:48 +0000 (15:59 -0700)
Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, replace code of the following form:

sizeof(struct virtchnl_ether_addr_list) + (count * sizeof(struct virtchnl_ether_addr))

with:

struct_size(veal, list, count)

and so on...

This code was detected with the help of Coccinelle.

Signed-off-by: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

No differences found