From patchwork Tue Jul 19 15:33:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9237735 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C931160574 for ; Tue, 19 Jul 2016 15:36:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA2BA275A2 for ; Tue, 19 Jul 2016 15:36:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF0392793B; Tue, 19 Jul 2016 15:36:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22D14275A2 for ; Tue, 19 Jul 2016 15:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753766AbcGSPg3 (ORCPT ); Tue, 19 Jul 2016 11:36:29 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:52286 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753415AbcGSPg1 (ORCPT ); Tue, 19 Jul 2016 11:36:27 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MYNd3-1buaZO3QH3-00VAcb; Tue, 19 Jul 2016 17:36:03 +0200 From: Arnd Bergmann To: linux-wireless@vger.kernel.org Cc: Kalle Valo , Larry Finger , netdev@vger.kernel.org, Jes Sorensen , Arnd Bergmann , Greg Kroah-Hartman , =?UTF-8?q?Rapha=C3=ABl=20Beamonte?= , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] staging/rtl8192u: use s8 instead of char Date: Tue, 19 Jul 2016 17:33:02 +0200 Message-Id: <20160719153403.2967812-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160719153403.2967812-1-arnd@arndb.de> References: <20160719153403.2967812-1-arnd@arndb.de> X-Provags-ID: V03:K0:FPNtitn7QbmrocH9n1IEzwssydo+4ZpfsoJF2J03MqF9Z3e1JxI Ba7Oe/5PCtUhpNCi4QT1qVyUYQmvjKL4dM8JlOGy88yywI2gv1MhYjhIQwq5Ft/bCn9BMLw JCHkB3upeEV4j/kmADcFXy1g9neU08oGNHvZC4Re27Mvs0GtnqmrbmkvqRAg0NPgeenx/gN yPbnYkRdSzZRabWkllQNQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:RhJc5ZNdaVo=:QLmq6w4acdgik2/9C1JRpU mA5Yw5NICvUJGOu9MKlx339RF+PuHLyMEhW7EfPZlfZzUMi6QsBZfCYDZ5MjubdNelIDEOzyV +OSnByPONL65kH7JU1u8wNMQWSv/d8R3H98UQVlc3wd9nMsMwgMIQuQO7ghPG41MrJ4CT6pjy /XU5LRvdR9j6jvLiUXQLemlHUik2tlIxrLzOqccQhk02p70wHCNCjL9XJvUempX75RFHPkLEF pP0PrlS8zDKjK8iQPrzGdvxLYl0FcX320DRTvyBRTND515cDn/q7NMysVNTGxcTFJleVlkbm6 03V1ZwaiopdnEdEUagY4YlIgpfqh8iYo4ZWWUKtuPx9eKSJXINmo+8SNe0tx1/5yvDud4eMWn TcpHeqakHCqwp2me3+5Cilj8Us4zxlRWI3g0uDHsTHbOICvIEXT9t1REZhUB6lmDT5UxmLNwP NxAvQ+Lv8sv+BKbs4VL+DmIYpMCx6LJFVf4cKEE/WyTKz2craBo5akvCu3nEwppDKnxObAfwW QbobywRZYnavuQGvUbwExTTeBf99GI7OUvOID3UF6ykPcx2Q/v3xZUqcLpTh7+/pXOVBtCCc9 CCwyoslvRC7GXIurpALX51+VEGNHvfXQaTcZ9iJd3xx3VXsyHunP/DWYBtr43CU5QaJlzBJOt vAySSuoDYEABZI0CRSp3rGjM21v3Ct9xYVudHl1HLQZ70tNopq9fwGN9f4xx4Zr89E/0= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Arnd Bergmann Acked-by: Jes Sorensen --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++-- drivers/staging/rtl8192u/r8192U.h | 4 ++-- drivers/staging/rtl8192u/r8192U_core.c | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 09e9499b7f9d..077ea13eb1e7 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -746,7 +746,7 @@ struct ieee80211_rx_stats { bool bisrxaggrsubframe; bool bPacketBeacon; //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; }; @@ -1814,7 +1814,7 @@ struct ieee80211_device { u32 wpax_type_notify; //{added by David, 2006.9.26} /* QoS related flag */ - char init_wmmparam_flag; + s8 init_wmmparam_flag; /* set on initialization */ u8 qos_support; diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index 5dba6a28dd9b..b28bc7812caa 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -533,7 +533,7 @@ typedef struct _rt_9x_tx_rate_history { u32 ht_mcs[4][16]; } rt_tx_rahis_t, *prt_tx_rahis_t; 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 TotalNum; /* num of valid elements */ u32 TotalVal[4]; /* sum of valid elements */ @@ -1031,7 +1031,7 @@ typedef struct r8192_priv { s8 cck_present_attentuation; u8 cck_present_attentuation_20Mdefault; u8 cck_present_attentuation_40Mdefault; - char cck_present_attentuation_difference; + s8 cck_present_attentuation_difference; bool btxpower_tracking; bool bcck_in_ch14; bool btxpowerdata_readfromEEPORM; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index dd0970facdf5..f36b2d3b1ee9 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -4209,7 +4209,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, * * Return: 0-100 percentage *---------------------------------------------------------------------------*/ -static u8 rtl819x_query_rxpwrpercentage(char antpower) +static u8 rtl819x_query_rxpwrpercentage(s8 antpower) { if ((antpower <= -100) || (antpower >= 20)) return 0; @@ -4220,9 +4220,9 @@ static u8 rtl819x_query_rxpwrpercentage(char antpower) } /* QueryRxPwrPercentage */ -static u8 rtl819x_evm_dbtopercentage(char value) +static u8 rtl819x_evm_dbtopercentage(s8 value) { - char ret_val; + s8 ret_val; ret_val = value; @@ -4297,8 +4297,8 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, phy_ofdm_rx_status_rxsc_sgien_exintfflag *prxsc; u8 *prxpkt; u8 i, max_spatial_stream, tmp_rxsnr, tmp_rxevm, rxsc_sgien_exflg; - char rx_pwr[4], rx_pwr_all = 0; - char rx_snrX, rx_evmX; + s8 rx_pwr[4], rx_pwr_all = 0; + s8 rx_snrX, rx_evmX; u8 evm, pwdb_all; u32 RSSI, total_rssi = 0; u8 is_cck_rate = 0; @@ -4423,7 +4423,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, /* Get Rx snr value in DB */ tmp_rxsnr = pofdm_buf->rxsnr_X[i]; - rx_snrX = (char)(tmp_rxsnr); + rx_snrX = (s8)(tmp_rxsnr); rx_snrX /= 2; priv->stats.rxSNRdB[i] = (long)rx_snrX; @@ -4457,7 +4457,7 @@ static void rtl8192_query_rxphystatus(struct r8192_priv *priv, for (i = 0; i < max_spatial_stream; 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" * because the compiler of free build environment will