Commit f352a9ee authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging/rtl8192u: use s8 instead of char

Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of
incorrect code that results from 'char' being unsigned here, e.g.

staging/rtl8192u/r8192U_core.c:4150:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
staging/rtl8192u/r8192U_dm.c:646:50: error: comparison is always false due to limited range of data type [-Werror=type-limits]

This patch changes all uses of 'char' in this driver that refer to
8-bit integers to use 's8' instead, which is signed on all architectures.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a0693e22
...@@ -746,7 +746,7 @@ struct ieee80211_rx_stats { ...@@ -746,7 +746,7 @@ struct ieee80211_rx_stats {
bool bisrxaggrsubframe; bool bisrxaggrsubframe;
bool bPacketBeacon; //cosa add for rssi bool bPacketBeacon; //cosa add for rssi
bool bToSelfBA; //cosa add for rssi bool bToSelfBA; //cosa add for rssi
char cck_adc_pwdb[4]; //cosa add for rx path selection s8 cck_adc_pwdb[4]; //cosa add for rx path selection
u16 Seq_Num; u16 Seq_Num;
}; };
...@@ -1814,7 +1814,7 @@ struct ieee80211_device { ...@@ -1814,7 +1814,7 @@ struct ieee80211_device {
u32 wpax_type_notify; //{added by David, 2006.9.26} u32 wpax_type_notify; //{added by David, 2006.9.26}
/* QoS related flag */ /* QoS related flag */
char init_wmmparam_flag; s8 init_wmmparam_flag;
/* set on initialization */ /* set on initialization */
u8 qos_support; u8 qos_support;
......
...@@ -533,7 +533,7 @@ typedef struct _rt_9x_tx_rate_history { ...@@ -533,7 +533,7 @@ typedef struct _rt_9x_tx_rate_history {
u32 ht_mcs[4][16]; u32 ht_mcs[4][16];
} rt_tx_rahis_t, *prt_tx_rahis_t; } rt_tx_rahis_t, *prt_tx_rahis_t;
typedef struct _RT_SMOOTH_DATA_4RF { typedef struct _RT_SMOOTH_DATA_4RF {
char elements[4][100]; /* array to store values */ s8 elements[4][100]; /* array to store values */
u32 index; /* index to current array to store */ u32 index; /* index to current array to store */
u32 TotalNum; /* num of valid elements */ u32 TotalNum; /* num of valid elements */
u32 TotalVal[4]; /* sum of valid elements */ u32 TotalVal[4]; /* sum of valid elements */
...@@ -1031,7 +1031,7 @@ typedef struct r8192_priv { ...@@ -1031,7 +1031,7 @@ typedef struct r8192_priv {
s8 cck_present_attentuation; s8 cck_present_attentuation;
u8 cck_present_attentuation_20Mdefault; u8 cck_present_attentuation_20Mdefault;
u8 cck_present_attentuation_40Mdefault; u8 cck_present_attentuation_40Mdefault;
char cck_present_attentuation_difference; s8 cck_present_attentuation_difference;
bool btxpower_tracking; bool btxpower_tracking;
bool bcck_in_ch14; bool bcck_in_ch14;
bool btxpowerdata_readfromEEPORM; bool btxpowerdata_readfromEEPORM;
......
...@@ -4206,7 +4206,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, ...@@ -4206,7 +4206,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
* *
* Return: 0-100 percentage * Return: 0-100 percentage
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
static u8 rtl819x_query_rxpwrpercentage(char antpower) static u8 rtl819x_query_rxpwrpercentage(s8 antpower)
{ {
if ((antpower <= -100) || (antpower >= 20)) if ((antpower <= -100) || (antpower >= 20))
return 0; return 0;
...@@ -4217,9 +4217,9 @@ static u8 rtl819x_query_rxpwrpercentage(char antpower) ...@@ -4217,9 +4217,9 @@ static u8 rtl819x_query_rxpwrpercentage(char antpower)
} /* QueryRxPwrPercentage */ } /* QueryRxPwrPercentage */
static u8 rtl819x_evm_dbtopercentage(char value) static u8 rtl819x_evm_dbtopercentage(s8 value)
{ {
char ret_val; s8 ret_val;
ret_val = value; ret_val = value;
...@@ -4294,8 +4294,8 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, ...@@ -4294,8 +4294,8 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv,
phy_ofdm_rx_status_rxsc_sgien_exintfflag *prxsc; phy_ofdm_rx_status_rxsc_sgien_exintfflag *prxsc;
u8 *prxpkt; u8 *prxpkt;
u8 i, max_spatial_stream, tmp_rxsnr, tmp_rxevm, rxsc_sgien_exflg; u8 i, max_spatial_stream, tmp_rxsnr, tmp_rxevm, rxsc_sgien_exflg;
char rx_pwr[4], rx_pwr_all = 0; s8 rx_pwr[4], rx_pwr_all = 0;
char rx_snrX, rx_evmX; s8 rx_snrX, rx_evmX;
u8 evm, pwdb_all; u8 evm, pwdb_all;
u32 RSSI, total_rssi = 0; u32 RSSI, total_rssi = 0;
u8 is_cck_rate = 0; u8 is_cck_rate = 0;
...@@ -4420,7 +4420,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, ...@@ -4420,7 +4420,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv,
/* Get Rx snr value in DB */ /* Get Rx snr value in DB */
tmp_rxsnr = pofdm_buf->rxsnr_X[i]; tmp_rxsnr = pofdm_buf->rxsnr_X[i];
rx_snrX = (char)(tmp_rxsnr); rx_snrX = (s8)(tmp_rxsnr);
rx_snrX /= 2; rx_snrX /= 2;
priv->stats.rxSNRdB[i] = (long)rx_snrX; priv->stats.rxSNRdB[i] = (long)rx_snrX;
...@@ -4454,7 +4454,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, ...@@ -4454,7 +4454,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv,
for (i = 0; i < max_spatial_stream; i++) { for (i = 0; i < max_spatial_stream; i++) {
tmp_rxevm = pofdm_buf->rxevm_X[i]; tmp_rxevm = pofdm_buf->rxevm_X[i];
rx_evmX = (char)(tmp_rxevm); rx_evmX = (s8)(tmp_rxevm);
/* Do not use shift operation like "rx_evmX >>= 1" /* Do not use shift operation like "rx_evmX >>= 1"
* because the compiler of free build environment will * because the compiler of free build environment will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment