Thread (52 messages) read the whole thread 52 messages, 7 authors, 2023-01-24

Re: [PATCH net-next 2/7] sfc: enumerate mports in ef100

From: Jacob Keller <jacob.e.keller@intel.com>
Date: 2023-01-19 23:49:24


On 1/19/2023 3:31 AM, alejandro.lucero-palau@amd.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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help