[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <16988d95-bee6-f4da-fb1b-21c8a498dcd7@intel.com>
Date: Fri, 6 May 2022 08:28:39 -0700
From: Jesse Brandeburg <jesse.brandeburg@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <alexandr.lobakin@...el.com>
Subject: Re: [PATCH net v1] dim: initialize all struct fields
On 5/5/2022 6:40 PM, Jakub Kicinski wrote:
>> #define NET_DIM_RX_EQE_PROFILES { \
>> - {1, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
>> - {8, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
>> - {64, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
>> - {128, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
>> - {256, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
>> + DIM_CQ_MODER(1, NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE, 0, 0), \
>> + DIM_CQ_MODER(8, NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE, 0, 0), \
>> + DIM_CQ_MODER(64, NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE, 0, 0), \
>> + DIM_CQ_MODER(128, NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE, 0, 0), \
>> + DIM_CQ_MODER(256, NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE, 0, 0) \
>> }
>
> That may give people the false impression that we always have
> to initialize all the fields to appease W=2. The most common
> way of fixing this warning is to tell the compiler that we know
> what we're doing and add a comma after the last member:
>
> - {2, 256}, \
> + {2, 256,}, \
>
> The commit message needs to at least discuss why this direction
> was not taken. My preference would actually be to do it, tho.
Ok, I'll make that change, thanks for the feedback.
>
> Also please CC maintainers and authors of patches under Fixes:.
Yeah, my mistake and I'll fix that on the v2!
Jesse
Powered by blists - more mailing lists