at 8:25 PM, Saeed Mahameed <sa...@kernel.org> wrote:
I don't have any strong feeling against disabling compiler warnings, but maybe the right thing to do here is to initialize the gaps to the invalid value instead of pre-initializing the whole thing first and then setting up the valid values on the 2nd pass. I don't think there are too many gaps to fill, it is doable, so maybe add this as a comment to this driver maintainer so they could pickup the work from here.
The problem is that filling in the gaps creates a maintenance hazard. As another example, the kernel does exactly this kind of thing to initialize the system call table. Using the override in this way is the clearest, easiest to maintain way of expressing this.
Disabling the warning not only gets rid of the warning, but should also be seen as a "something special is happening here" flag in the code. With the warning disabled, there is a hazard of now missing the possible introduction of an override here, but I think that risk is less than the risk of failing to fill a gap when changes are made.
I completely support doing this in exactly this way. -- Mark Rustad, Ethernet Products Group, Intel Corporation
signature.asc
Description: Message signed with OpenPGP