drivers/staging/rtl8723bs/include/hal_pg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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 value -2 is the
intended default offset; expressing it as -2 directly instead of
0xFE avoids relying on implicit truncation of an unsigned-looking
hex literal into a signed field.
No functional change.
Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
---
v2: express the value as -2 directly instead of casting 0xFE to s8,
per Dan Carpenter's suggestion
---
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..83bf5f117e2d 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 -2
/* RTL8723BS */
#define EEPROM_MAC_ADDR_8723BS 0x11A
--
2.55.0
On Mon, Aug 17, 2026 at 03:05:07PM -0600, Ivy Lopez wrote: > 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 value -2 is the > intended default offset; expressing it as -2 directly instead of > 0xFE avoids relying on implicit truncation of an unsigned-looking > hex literal into a signed field. > > No functional change. > > Signed-off-by: Ivy Lopez <skunkolee@gmail.com> > --- > v2: express the value as -2 directly instead of casting 0xFE to s8, > per Dan Carpenter's suggestion > --- > 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..83bf5f117e2d 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 -2 > > /* RTL8723BS */ > #define EEPROM_MAC_ADDR_8723BS 0x11A > -- > 2.55.0 > > Does not apply against the staging-testing branch, please rebase and resend. thanks, greg k-h
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 value -2 is the
intended default offset; expressing it as -2 directly instead of
0xFE avoids relying on implicit truncation of an unsigned-looking
hex literal into a signed field.
No functional change.
Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
---
v2: express the value as -2 directly instead of casting 0xFE to s8,
per Dan Carpenter's suggestion
v3: rebase against staging-testing
---
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 32e66fe451b0..6f8c8307eaa7 100644
--- a/drivers/staging/rtl8723bs/include/hal_pg.h
+++ b/drivers/staging/rtl8723bs/include/hal_pg.h
@@ -38,7 +38,7 @@
#define EEPROM_RF_BOARD_OPTION_8723B 0xC1
#define EEPROM_RF_BT_SETTING_8723B 0xC3
-#define EEPROM_DEFAULT_DIFF 0XFE
+#define EEPROM_DEFAULT_DIFF -2
/* RTL8723BS */
#define EEPROM_MAC_ADDR_8723BS 0x11A
--
2.55.0
© 2016 - 2026 Red Hat, Inc.