From: Larry Finger Date: Wed, 4 Sep 2013 20:56:06 +0000 (-0500) Subject: staging: r8188eu: Fix smatch warnings in odm_HWConfig.c X-Git-Tag: v3.13-rc1~170^2~712 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdbdc54e186da6b8e8ea98c173f55198b0d337eb;p=kernel%2Fkernel-generic.git staging: r8188eu: Fix smatch warnings in odm_HWConfig.c Smatch reports the following warnings: drivers/staging/rtl8188eu/hal/odm_HWConfig.c:302 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyInfo->RxPwr' 2 <= 2 drivers/staging/rtl8188eu/hal/odm_HWConfig.c:319 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyInfo->RxMIMOSignalStrength' 2 <= 2 drivers/staging/rtl8188eu/hal/odm_HWConfig.c:322 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyStaRpt->path_rxsnr' 2 <= 2 drivers/staging/rtl8188eu/hal/odm_HWConfig.c:322 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyInfo->RxSNR' 2 <= 2 drivers/staging/rtl8188eu/hal/odm_HWConfig.c:323 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'pPhyStaRpt->path_rxsnr' 2 <= 2 drivers/staging/rtl8188eu/hal/odm_HWConfig.c:323 odm_RxPhyStatus92CSeries_Parsing() error: buffer overflow 'dm_odm->PhyDbgInfo.RxSNRdB' 2 <= 2 These warnings are again due to the number of radio patchs being increased to 3 without adjustments to the array sizes. A duplicate and redundant definition was also removed. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/include/odm.h b/drivers/staging/rtl8188eu/include/odm.h index e3b40f8..300ca78 100644 --- a/drivers/staging/rtl8188eu/include/odm.h +++ b/drivers/staging/rtl8188eu/include/odm.h @@ -283,8 +283,6 @@ struct odm_rate_adapt { /* Declare for common info */ -#define MAX_PATH_NUM_92CS 2 - struct odm_phy_status_info { u8 RxPWDBAll; u8 SignalQuality; /* in 0-100 index. */ diff --git a/drivers/staging/rtl8188eu/include/odm_HWConfig.h b/drivers/staging/rtl8188eu/include/odm_HWConfig.h index 63779f5..df52722 100644 --- a/drivers/staging/rtl8188eu/include/odm_HWConfig.h +++ b/drivers/staging/rtl8188eu/include/odm_HWConfig.h @@ -69,7 +69,7 @@ struct phy_rx_agc_info { }; struct phy_status_rpt { - struct phy_rx_agc_info path_agc[2]; + struct phy_rx_agc_info path_agc[3]; u8 ch_corr[2]; u8 cck_sig_qual_ofdm_pwdb_all; u8 cck_agc_rpt_ofdm_cfosho_a; @@ -79,7 +79,7 @@ struct phy_status_rpt { u8 path_cfotail[2]; u8 pcts_mask[2]; s8 stream_rxevm[2]; - u8 path_rxsnr[2]; + u8 path_rxsnr[3]; u8 noise_power_db_lsb; u8 rsvd_2[3]; u8 stream_csi[2]; diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index bae8885..be9c30c 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -83,7 +83,7 @@ struct signal_stat { u32 total_num; /* num of valid elements */ u32 total_val; /* sum of valid elements */ }; -#define MAX_PATH_NUM_92CS 2 +#define MAX_PATH_NUM_92CS 3 struct phy_info { u8 RxPWDBAll; u8 SignalQuality; /* in 0-100 index. */