net/qede: fix link state configuration
[dpdk.git] / drivers / net / sfc / base / efx_mcdi.h
index 74cde50..d199060 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
- * Copyright (c) 2009-2018 Solarflare Communications Inc.
- * All rights reserved.
+ * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2009-2019 Solarflare Communications Inc.
  */
 
 #ifndef _SYS_EFX_MCDI_H
@@ -391,6 +391,11 @@ efx_mcdi_phy_module_get_info(
        (((mask) & (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) ==          \
        (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv))
 
+#define        EFX_MCDI_BUF_SIZE(_in_len, _out_len)                            \
+       EFX_P2ROUNDUP(size_t,                                           \
+               MAX(MAX(_in_len, _out_len), (2 * sizeof (efx_dword_t))),\
+               sizeof (efx_dword_t))
+
 /*
  * The buffer size must be a multiple of dword to ensure that MCDI works
  * properly with Siena based boards (which use on-chip buffer). Also, it
@@ -398,9 +403,7 @@ efx_mcdi_phy_module_get_info(
  * error responses if the request/response buffer sizes are smaller.
  */
 #define EFX_MCDI_DECLARE_BUF(_name, _in_len, _out_len)                 \
-       uint8_t _name[P2ROUNDUP(MAX(MAX(_in_len, _out_len),             \
-                                   (2 * sizeof (efx_dword_t))),        \
-                               sizeof (efx_dword_t))] = {0}
+       uint8_t _name[EFX_MCDI_BUF_SIZE(_in_len, _out_len)] = {0}
 
 typedef enum efx_mcdi_feature_id_e {
        EFX_MCDI_FEATURE_FW_UPDATE = 0,