Messages in this thread | | | Subject | Re: [patch net v3] net: fec: fix compile with CONFIG_M5272 | From | Nikita Yushchenko <> | Date | Mon, 5 Dec 2016 21:06:41 +0300 |
| |
> +#define FEC_STATS_SIZE (ARRAY_SIZE(fec_stats) * sizeof(u64)) > > > Do I take it right this actually translates to (sizeof(fec_stats) / > sizeof(u64) * sizeof(u64))?
No.
fec_stats is an array of structs, each struct has car arrsy and integer, and size of that is definitely not bytes.
ARRAY_SIZE(fec_stats) is number of stats, i.e. it is returned from fec_enet_get_sset_count()
Each stat in blob is u64. Thus (ARRAY_SIZE(fec_stats) * sizeof(u64)) is size of stats blob.
| |