[v2,08/17] net/sfc: make MCDI logging helper macros local
diff mbox series

Message ID 1600324483-23153-9-git-send-email-arybchenko@solarflare.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • net/sfc: factor out common driver library
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Sept. 17, 2020, 6:34 a.m. UTC
Prepare to move MCDI helpers to drivers/common.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_log.h  | 11 -----------
 drivers/net/sfc/sfc_mcdi.c | 21 ++++++++++++++++-----
 2 files changed, 16 insertions(+), 16 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/sfc/sfc_log.h b/drivers/net/sfc/sfc_log.h
index 5383091c76..4bf44b1f15 100644
--- a/drivers/net/sfc/sfc_log.h
+++ b/drivers/net/sfc/sfc_log.h
@@ -28,9 +28,6 @@  extern uint32_t sfc_logtype_driver;
 /** Device MCDI log type name prefix */
 #define SFC_LOGTYPE_MCDI_STR	SFC_LOGTYPE_PREFIX "mcdi"
 
-/** Level value used by MCDI log statements */
-#define SFC_LOG_LEVEL_MCDI	RTE_LOG_INFO
-
 /* Log PMD message, automatically add prefix and \n */
 #define SFC_LOG(sas, level, type, ...) \
 	do {								\
@@ -92,13 +89,5 @@  extern uint32_t sfc_logtype_driver;
 				RTE_FMT_TAIL(__VA_ARGS__ ,)));		\
 	} while (0)
 
-#define sfc_log_mcdi(sa, ...) \
-	do {								\
-		const struct sfc_adapter *_sa = (sa);			\
-									\
-		SFC_LOG(_sa->priv.shared, SFC_LOG_LEVEL_MCDI,		\
-			_sa->mcdi.logtype, __VA_ARGS__);		\
-	} while (0)
-
 
 #endif /* _SFC_LOG_H_ */
diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c
index c97a33d558..c716caabdf 100644
--- a/drivers/net/sfc/sfc_mcdi.c
+++ b/drivers/net/sfc/sfc_mcdi.c
@@ -23,6 +23,17 @@ 
 #define SFC_EFX_MCDI_POLL_INTERVAL_MAX_US	(US_PER_S / 10)	/* 100ms */
 #define SFC_EFX_MCDI_WATCHDOG_INTERVAL_US	(10 * US_PER_S)	/* 10s */
 
+/** Level value used by MCDI log statements */
+#define SFC_EFX_LOG_LEVEL_MCDI	RTE_LOG_INFO
+
+#define sfc_efx_log_mcdi(sa, ...) \
+	do {								\
+		const struct sfc_adapter *_sa = (sa);			\
+									\
+		SFC_LOG(_sa->priv.shared, SFC_EFX_LOG_LEVEL_MCDI,	\
+			_sa->mcdi.logtype, __VA_ARGS__);		\
+	} while (0)
+
 static void
 sfc_efx_mcdi_timeout(struct sfc_adapter *sa)
 {
@@ -178,7 +189,7 @@  sfc_efx_mcdi_do_log(const struct sfc_adapter *sa,
 			 * at the end which is required by netlogdecode.
 			 */
 			buffer[position] = '\0';
-			sfc_log_mcdi(sa, "%s \\", buffer);
+			sfc_efx_log_mcdi(sa, "%s \\", buffer);
 			/* Preserve prefix for the next log message */
 			position = pfxsize;
 		}
@@ -207,11 +218,11 @@  sfc_efx_mcdi_logger(void *arg, efx_log_msg_t type,
 	 *
 	 * To avoid wasting time, the actual level is examined in advance.
 	 */
-	if (rte_log_get_level(sa->mcdi.logtype) < (int)SFC_LOG_LEVEL_MCDI)
+	if (rte_log_get_level(sa->mcdi.logtype) < (int)SFC_EFX_LOG_LEVEL_MCDI)
 		return;
 
-	/* The format including prefix added by sfc_log_mcdi() is the format
-	 * consumed by the Solarflare netlogdecode tool.
+	/* The format including prefix added by sfc_efx_log_mcdi() is the
+	 * format consumed by the Solarflare netlogdecode tool.
 	 */
 	pfxsize = snprintf(buffer, sizeof(buffer), "MCDI RPC %s:",
 			   type == EFX_LOG_MCDI_REQUEST ? "REQ" :
@@ -222,7 +233,7 @@  sfc_efx_mcdi_logger(void *arg, efx_log_msg_t type,
 				    pfxsize, start);
 	if (start != pfxsize) {
 		buffer[start] = '\0';
-		sfc_log_mcdi(sa, "%s", buffer);
+		sfc_efx_log_mcdi(sa, "%s", buffer);
 	}
 }