[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f6f38dc9-cea4-d328-3657-c48ce7feabb1@intel.com>
Date: Thu, 19 Jan 2023 15:48:39 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: <alejandro.lucero-palau@....com>, <netdev@...r.kernel.org>,
<linux-net-drivers@....com>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
<edumazet@...gle.com>, <habetsm@...il.com>,
<ecree.xilinx@...il.com>
Subject: Re: [PATCH net-next 2/7] sfc: enumerate mports in ef100
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...
> + 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