All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: cast EEPROM_DEFAULT_DIFF to s8
@ 2026-08-15 19:10 Ivy Lopez
  0 siblings, 0 replies; only message in thread
From: Ivy Lopez @ 2026-08-15 19:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel, Ivy Lopez

EEPROM_DEFAULT_DIFF is defined as the bare integer literal 0xFE
(254) but is only ever assigned into s8 (signed char) fields used
to store signed TX power calibration offsets. The implicit
truncation to -2 is intentional. BW20/BW40/CCK/OFDM_Diff fields
elsewhere in the same file already sign-extend 4-bit values into
8-bit signed offsets by hand, so -2 is consistent with that
existing pattern but the untyped macro doesn't communicate this,
and triggers -Wconversion at every one of its 8 use sites in
rtl8723b_hal_init.c.

Cast the macro to s8 at its definition so the sign truncation is
explicit and documented in one place instead of relying on implicit
conversion at each call site.

No functional change.

Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
---
 drivers/staging/rtl8723bs/include/hal_pg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/include/hal_pg.h b/drivers/staging/rtl8723bs/include/hal_pg.h
index 7cb9c441fc01..7f1f004ab817 100644
--- a/drivers/staging/rtl8723bs/include/hal_pg.h
+++ b/drivers/staging/rtl8723bs/include/hal_pg.h
@@ -40,7 +40,7 @@
 #define	EEPROM_RF_BT_SETTING_8723B		0xC3
 #define	EEPROM_VERSION_8723B			0xC4
 #define	EEPROM_CustomID_8723B			0xC5
-#define EEPROM_DEFAULT_DIFF			0XFE
+#define EEPROM_DEFAULT_DIFF			((s8)0XFE)
 
 /* RTL8723BS */
 #define	EEPROM_MAC_ADDR_8723BS			0x11A
-- 
2.55.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-15 19:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-15 19:10 [PATCH] staging: rtl8723bs: cast EEPROM_DEFAULT_DIFF to s8 Ivy Lopez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.