diff mbox series

[09/31] staging: wfx: replace magic value by WFX_HIF_BUFFER_SIZE

Message ID 20220113085524.1110708-10-Jerome.Pouiller@silabs.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series staging/wfx: apply suggestions from the linux-wireless review | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Jérôme Pouiller Jan. 13, 2022, 8:55 a.m. UTC
From: Jérôme Pouiller <jerome.pouiller@silabs.com>

Magic values are not recommended.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/hwio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c
index a2a37efc51a6..977b9325f496 100644
--- a/drivers/staging/wfx/hwio.c
+++ b/drivers/staging/wfx/hwio.c
@@ -15,6 +15,8 @@ 
 #include "bus.h"
 #include "traces.h"
 
+#define WFX_HIF_BUFFER_SIZE 0x2000
+
 static int read32(struct wfx_dev *wdev, int reg, u32 *val)
 {
 	int ret;
@@ -103,7 +105,7 @@  static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr,
 	u32 cfg;
 	u32 prefetch;
 
-	WARN_ON(len >= 0x2000);
+	WARN_ON(len >= WFX_HIF_BUFFER_SIZE);
 	WARN_ON(reg != WFX_REG_AHB_DPORT && reg != WFX_REG_SRAM_DPORT);
 
 	if (reg == WFX_REG_AHB_DPORT)
@@ -151,7 +153,7 @@  static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr,
 {
 	int ret;
 
-	WARN_ON(len >= 0x2000);
+	WARN_ON(len >= WFX_HIF_BUFFER_SIZE);
 	WARN_ON(reg != WFX_REG_AHB_DPORT && reg != WFX_REG_SRAM_DPORT);
 	ret = write32(wdev, WFX_REG_BASE_ADDR, addr);
 	if (ret < 0)