Re: [kbuild] drivers/regulator/bd718x7-regulator.c:531:8: warning: Excessive padding in 'struct bd718xx_regulator_data' (8 padding bytes, where 0 is optimal).

From: Matti Vaittinen
Date: Thu Aug 19 2021 - 01:34:39 EST


Hi,

On Thu, Aug 19, 2021 at 6:26 AM kernel test robot <yujie.liu@xxxxxxxxx> wrote:
> >> drivers/regulator/bd718x7-regulator.c:531:8: warning: Excessive
> padding in 'struct bd718xx_regulator_data' (8 padding bytes, where 0 is
> optimal).
> Optimal fields order:
> dvs,
> additional_inits,
> additional_init_amnt,
> init,
> desc,
> consider reordering the fields or adding explicit padding members
> [clang-analyzer-optin.performance.Padding]
> struct bd718xx_regulator_data {
> ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
> drivers/regulator/bd718x7-regulator.c:531:8: note: Excessive padding
> in 'struct bd718xx_regulator_data' (8 padding bytes, where 0 is
> optimal). Optimal fields order: dvs, additional_inits,
> additional_init_amnt, init, desc, consider reordering the fields or
> adding explicit padding members
> struct bd718xx_regulator_data {
> ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

I don't have a good feeling about these checks. Especially when a
struct is composed of other structs - which may be modified
independently of the code we are looking at here. Any unrelated
addition of a member to any of the structs (well, maybe not the one at
the bottom). I guess fixing all the users of these structs when
something changes would cause quite a churn of changes... What is
expected to be done as a result from these mails?

Best Regards
-- Matti