[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00dbd8c6-bcc4-87a7-bbfe-82613b4491e5@amd.com>
Date: Fri, 20 Jan 2023 14:13:53 +0000
From: "Lucero Palau, Alejandro" <alejandro.lucero-palau@....com>
To: Jacob Keller <jacob.e.keller@...el.com>,
"Lucero Palau, Alejandro" <alejandro.lucero-palau@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-net-drivers (AMD-Xilinx)" <linux-net-drivers@....com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"ecree.xilinx@...il.com" <ecree.xilinx@...il.com>
Subject: Re: [PATCH net-next 2/7] sfc: enumerate mports in ef100
On 1/19/23 23:48, Jacob Keller wrote:
>
> On 1/19/2023 3:31 AM, alejandro.lucero-palau@....com wrote:
>> +
>> +int efx_mae_enumerate_mports(struct efx_nic *efx)
>> +{
>> +#define MCDI_MPORT_JOURNAL_LEN \
>> + sizeof(efx_dword_t[DIV_ROUND_UP(MC_CMD_MAE_MPORT_READ_JOURNAL_OUT_LENMAX_MCDI2, 4)])
> Please keep #define like this outside the function block. This is really
> hard to read. It's also not clear to me what exactly this define is
> doing.. you're accessing an array and using a DIV_ROUND_UP...
Thank you for pointing this out. It does not make sense at all.
I'll fix this in the next version.
>> + efx_dword_t *outbuf = kzalloc(MCDI_MPORT_JOURNAL_LEN, GFP_KERNEL);
>> + MCDI_DECLARE_BUF(inbuf, MC_CMD_MAE_MPORT_READ_JOURNAL_IN_LEN);
>> + MCDI_DECLARE_STRUCT_PTR(desc);
>> + size_t outlen, stride, count;
>> + int rc = 0, i;
Powered by blists - more mailing lists