Re: [PATCH 3/20] staging: rtl8192u: Prefer using the BIT macro
Ok, I will send this patch again with the proper label. But do I have to send all the patches again of this patch series? Thanks, Simran Singhal ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/15] staging: rtl8192u: fixing white space issue
Fix the following checkpatch.pl error and warnings: WARNING: please, no space before tabs Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h index 873969c..a54dfad 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h @@ -30,7 +30,7 @@ typedef struct _TX_TS_RECORD{ u16 TxCurSeq; BA_RECORD TxPendingBARecord; /* For BA Originator */ BA_RECORD TxAdmittedBARecord; /* For BA Originator */ -/* QOS_DL_RECORD DLRecord; */ +/* QOS_DL_RECORD DLRecord; */ u8 bAddBaReqInProgress; u8 bAddBaReqDelayed; u8 bUsingBa; @@ -48,7 +48,7 @@ typedef struct _RX_TS_RECORD { u16 RxLastSeqNum; u8 RxLastFragNum; u8 num; -/* QOS_DL_RECORD DLRecord; */ +/* QOS_DL_RECORDLRecord; */ } RX_TS_RECORD, *PRX_TS_RECORD; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/15] staging: rtl8192u: Adding space after struct definition
Fixes checkpatch.pl warning: WARNING: missing space after struct definition Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h index a54dfad..7c4959a 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h @@ -14,7 +14,7 @@ typedef enum _TR_SELECT { RX_DIR = 1, } TR_SELECT, *PTR_SELECT; -typedef struct _TS_COMMON_INFO{ +typedef struct _TS_COMMON_INFO { struct list_headList; struct timer_list SetupTimer; struct timer_list InactTimer; @@ -25,7 +25,7 @@ typedef struct _TS_COMMON_INFO{ u8 TClasNum; } TS_COMMON_INFO, *PTS_COMMON_INFO; -typedef struct _TX_TS_RECORD{ +typedef struct _TX_TS_RECORD { TS_COMMON_INFO TsCommonInfo; u16 TxCurSeq; BA_RECORD TxPendingBARecord; /* For BA Originator */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/15] staging: rtl8192u: Adding space after enum and struct definition
Fixes checkpatch.pl warning: WARNING: missing space after struct definition WARNING: missing space after enum definition Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 38 - 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index c3aabba..5f54d93 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -35,7 +35,7 @@ #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP -typedef enum _HT_MCS_RATE{ +typedef enum _HT_MCS_RATE { HT_MCS0 = 0x0001, HT_MCS1 = 0x0002, HT_MCS2 = 0x0004, @@ -58,7 +58,7 @@ typedef enum _HT_MCS_RATE{ // // Represent Channel Width in HT Capabilities // -typedef enum _HT_CHANNEL_WIDTH{ +typedef enum _HT_CHANNEL_WIDTH { HT_CHANNEL_WIDTH_20 = 0, HT_CHANNEL_WIDTH_20_40 = 1, }HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH; @@ -67,14 +67,14 @@ typedef enum _HT_CHANNEL_WIDTH{ // Represent Extension Channel Offset in HT Capabilities // This is available only in 40Mhz mode. // -typedef enum _HT_EXTCHNL_OFFSET{ +typedef enum _HT_EXTCHNL_OFFSET { HT_EXTCHNL_OFFSET_NO_EXT = 0, HT_EXTCHNL_OFFSET_UPPER = 1, HT_EXTCHNL_OFFSET_NO_DEF = 2, HT_EXTCHNL_OFFSET_LOWER = 3, }HT_EXTCHNL_OFFSET, *PHT_EXTCHNL_OFFSET; -typedef enum _CHNLOP{ +typedef enum _CHNLOP { CHNLOP_NONE = 0, // No Action now CHNLOP_SCAN = 1, // Scan in progress CHNLOP_SWBW = 2, // Bandwidth switching in progress @@ -119,7 +119,7 @@ typedef union _HT_CAPABILITY_MACPARA{ }HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA; */ -typedef enum _HT_ACTION{ +typedef enum _HT_ACTION { ACT_RECOMMAND_WIDTH = 0, ACT_MIMO_PWR_SAVE = 1, ACT_PSMP= 2, @@ -134,14 +134,14 @@ typedef enum _HT_ACTION{ /* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */ -typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier{ +typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier { SC_MODE_DUPLICATE = 0, SC_MODE_LOWER = 1, SC_MODE_UPPER = 2, SC_MODE_FULL40MHZ = 3, }HT_BW40_SC_E; -typedefstruct _HT_CAPABILITY_ELE{ +typedefstruct _HT_CAPABILITY_ELE { //HT capability info u8 AdvCoding:1; @@ -184,7 +184,7 @@ typedef struct _HT_CAPABILITY_ELE{ // Only AP is required to include this element // -typedef struct _HT_INFORMATION_ELE{ +typedef struct _HT_INFORMATION_ELE { u8 ControlChl; u8 ExtChlOffset:2; @@ -215,18 +215,18 @@ typedef struct _HT_INFORMATION_ELE{ // MIMO Power Save control field. // This is appear in MIMO Power Save Action Frame // -typedef struct _MIMOPS_CTRL{ +typedef struct _MIMOPS_CTRL { u8 MimoPsEnable:1; u8 MimoPsMode:1; u8 Reserved:6; } MIMOPS_CTRL, *PMIMOPS_CTRL; -typedef enum _HT_SPEC_VER{ +typedef enum _HT_SPEC_VER { HT_SPEC_VER_IEEE = 0, HT_SPEC_VER_EWC = 1, }HT_SPEC_VER, *PHT_SPEC_VER; -typedef enum _HT_AGGRE_MODE_E{ +typedef enum _HT_AGGRE_MODE_E { HT_AGG_AUTO = 0, HT_AGG_FORCE_ENABLE = 1, HT_AGG_FORCE_DISABLE = 2, @@ -238,7 +238,7 @@ typedef enum _HT_AGGRE_MODE_E{ // to default value in HTInitializeHTInfo() // -typedef struct _RT_HIGH_THROUGHPUT{ +typedef struct _RT_HIGH_THROUGHPUT { u8 bEnableHT; u8 bCurrentHTSupport; @@ -347,7 +347,7 @@ typedef struct _RT_HIGH_THROUGHPUT{ // when card is configured as "AP mode" // -typedef struct _RT_HTINFO_STA_ENTRY{ +typedef struct _RT_HTINFO_STA_ENTRY { u8 bEnableHT; u8 bSupportCck; @@ -377,7 +377,7 @@ typedef struct _RT_HTINFO_STA_ENTRY{ // when card is configured as "STA mode" // -typedef struct _BSS_HT{ +typedef struct _BSS_HT { u8 bdSupportHT; @@ -395,7 +395,7 @@ typedef struct _BSS_HT{ u8 bdRT2RTLongSlotTime; } __attribute__ ((packed)) BSS_HT, *PBSS_HT; -typedef struct _MIMO_RSSI{ +typedef struct _MIMO_RSSI { u32 EnableAntenna; u32 AntennaA; u32 AntennaB; @@ -404,12 +404,12 @@ typedef struct _MIMO_RSSI{ u32 Average; }MIMO_RSSI, *PMIMO_RSSI; -typedef struct _MIMO_EVM{ +typedef struct _MIMO_EVM { u32 EVM1; u32EVM2; }MIMO_EVM, *PMIMO_EVM; -typedef struct _FALSE_ALARM_
[PATCH 04/15] staging: rtl8192u: blank lines aren't necessary before a close brace '}'
Fix checkpatch issues: "CHECK: Blank lines aren't necessary before a close brace '}'". Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 814ab5a..2481c21 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -623,7 +623,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, goto done; } *crypt = new_crypt; - } if (ext->key_len > 0 && (*crypt)->ops->set_key && @@ -725,7 +724,6 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, (ext->alg == IW_ENCODE_ALG_TKIP || ext->alg == IW_ENCODE_ALG_CCMP)) ext->ext_flags |= IW_ENCODE_EXT_TX_SEQ_VALID; - } return 0; @@ -839,6 +837,5 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len) ieee->wpa_ie_len = 0; } return 0; - } EXPORT_SYMBOL(ieee80211_wx_set_gen_ie); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/15] staging: rtl8192u: Use min_t instead of min
Use min_t instead of min function in ieee80211/ieee80211_wx.c fixed warning: WARNING: min() should probably be min_t(u8, network->ssid_len, 32) Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 2481c21..fff2020 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -80,7 +80,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.data.length = sizeof(""); start = iwe_stream_add_point(info, start, stop, &iwe, ""); } else { - iwe.u.data.length = min(network->ssid_len, (u8)32); + iwe.u.data.length = min_t(u8, network->ssid_len, 32); start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); } /* Add the protocol name */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/15] staging: rtl8192u: Fixing coding style issues
fixed errors and warnings: ERROR: spaces required around that '=' ERROR: spaces required around that '<' ERROR: space required before the open parenthesis '(' CHECK: spaces preferred around that '&' CHECK: spaces preferred around that '<<' ERROR: space required after that ',' ERROR: spaces required around that '+=' WARNING: Missing a blank line after declarations CHECK: spaces required around that '?' CHECK: spaces required around that ':' Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index fff2020..c846223 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -85,10 +85,10 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, } /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; - for(i=0; imode&(1<mode & (1 << i)) { + sprintf(pname, ieee80211_modes[i].mode_string, ieee80211_modes[i].mode_size); + pname += ieee80211_modes[i].mode_size; } } *pname = '\0'; @@ -150,14 +150,15 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, PHT_CAPABILITY_ELE ht_cap = NULL; bool is40M = false, isShortGI = false; u8 max_mcs = 0; + if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4)) ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[4]; else ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[0]; - is40M = (ht_cap->ChlWidth)?1:0; - isShortGI = (ht_cap->ChlWidth)? - ((ht_cap->ShortGI40Mhz)?1:0): - ((ht_cap->ShortGI20Mhz)?1:0); + is40M = (ht_cap->ChlWidth) ? 1 : 0; + isShortGI = (ht_cap->ChlWidth) ? + ((ht_cap->ShortGI40Mhz) ? 1 : 0) : + ((ht_cap->ShortGI20Mhz) ? 1 : 0); max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL); rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs&0x7f]; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/15] staging: rtl8192u: Fixing style issues in r8180_93cx6.c
Fixing the following checkpatch.pl errors and warning: WARNING: Block comments use * on subsequent lines CHECK: Please don't use multiple blank lines CHECK: Alignment should match open parenthesis CHECK: spaces preferred around that '<<' CHECK: spaces preferred around that '-' CHECK: Alignment should match open parenthesis Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8180_93cx6.c | 71 -- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c index f35defc..6a293e3 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.c +++ b/drivers/staging/rtl8192u/r8180_93cx6.c @@ -1,22 +1,22 @@ /* - This files contains card eeprom (93c46 or 93c56) programming routines, - memory is addressed by 16 bits words. - - This is part of rtl8180 OpenSource driver. - Copyright (C) Andrea Merello 2004 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part of the - official realtek driver. - - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon. - - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. - - We want to thank the Authors of those projects and the Ndiswrapper - project Authors. -*/ + * This files contains card eeprom (93c46 or 93c56) programming routines, + * memory is addressed by 16 bits words. + * + * This is part of rtl8180 OpenSource driver. + * Copyright (C) Andrea Merello 2004 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part of the + * official realtek driver. + * + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon. + * + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. + * + * We want to thank the Authors of those projects and the Ndiswrapper + * project Authors. + */ #include "r8180_93cx6.h" @@ -39,7 +39,6 @@ static void eprom_cs(struct net_device *dev, short bit) udelay(EPROM_DELAY); } - static void eprom_ck_cycle(struct net_device *dev) { u8 cmdreg; @@ -58,7 +57,6 @@ static void eprom_ck_cycle(struct net_device *dev) udelay(EPROM_DELAY); } - static void eprom_w(struct net_device *dev, short bit) { u8 cmdreg; @@ -76,7 +74,6 @@ static void eprom_w(struct net_device *dev, short bit) udelay(EPROM_DELAY); } - static short eprom_r(struct net_device *dev) { u8 bit; @@ -94,7 +91,6 @@ static short eprom_r(struct net_device *dev) return 0; } - static void eprom_send_bits_string(struct net_device *dev, short b[], int len) { int i; @@ -105,7 +101,6 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len) } } - int eprom_read(struct net_device *dev, u32 addr) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -119,27 +114,27 @@ int eprom_read(struct net_device *dev, u32 addr) ret = 0; /* enable EPROM programming */ write_nic_byte_E(dev, EPROM_CMD, - (EPROM_CMD_PROGRAM<epromtype == EPROM_93c56) { addr_str[7] = addr & 1; - addr_str[6] = addr & (1<<1); - addr_str[5] = addr & (1<<2); - addr_str[4] = addr & (1<<3); - addr_str[3] = addr & (1<<4); - addr_str[2] = addr & (1<<5); - addr_str[1] = addr & (1<<6); - addr_str[0] = addr & (1<<7); + addr_str[6] = addr & (1 << 1); + addr_str[5] = addr & (1 << 2); + addr_str[4] = addr & (1 << 3); + addr_str[3] = addr & (1 << 4); + addr_str[2] = addr & (1 << 5); + addr_str[1] = addr & (1 << 6); + addr_str[0] = addr & (1 << 7); addr_len = 8; } else { addr_str[5] = addr & 1; - addr_str[4] = addr & (1<<1); - addr_str[3] = addr & (1<<2); - addr_str[2] = addr & (1<<3); - addr_str[1] = addr & (1<<4); - addr_str[0] = addr & (1<<5); + addr_str[4] = addr & (1 << 1); + addr_str[3] = addr & (1 << 2); + addr_str[2] = addr & (1 << 3); + addr_str[1] = addr & (1 << 4); + addr_str[0] = addr & (1 << 5); addr_len = 6; } eprom_cs(dev, 1); @@ -162,7 +157,7 @@ int eprom_read(struct net_device *dev, u32 addr) if (err < 0)
[PATCH 08/15] staging: rtl8192u: Fixing style issues in r8180_93cx6.h
Fixing the following checkpatch.pl errors and warning: WARNING: Block comments use * on subsequent lines CHECK: Please don't use multiple blank lines Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8180_93cx6.h | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h b/drivers/staging/rtl8192u/r8180_93cx6.h index 9cf7f58..643d465 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.h +++ b/drivers/staging/rtl8192u/r8180_93cx6.h @@ -1,17 +1,17 @@ /* - This is part of rtl8187 OpenSource driver - Copyright (C) Andrea Merello 2004-2005 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part of the - official realtek driver - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver - - We want to thank the Authors of such projects and the Ndiswrapper - project Authors. -*/ + * This is part of rtl8187 OpenSource driver + * Copyright (C) Andrea Merello 2004-2005 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part of the + * official realtek driver + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver + * + * We want to thank the Authors of such projects and the Ndiswrapper + * project Authors. + */ /*This files contains card eeprom (93c46 or 93c56) programming routines*/ /*memory is addressed by WORDS*/ @@ -39,5 +39,4 @@ #define EPROM_TXPW2 0x1b #define EPROM_TXPW1 0x3d - int eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/15] staging: rtl8192u: fixing block comments use * on subsequent lines
Fixed checkpatch.pl warning: WARNING: Block comments use * on subsequent lines Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8190_rtl8256.h | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.h b/drivers/staging/rtl8192u/r8190_rtl8256.h index 1ba4f83..5878f42 100644 --- a/drivers/staging/rtl8192u/r8190_rtl8256.h +++ b/drivers/staging/rtl8192u/r8190_rtl8256.h @@ -1,14 +1,13 @@ /* - This is part of the rtl8180-sa2400 driver - released under the GPL (See file COPYING for details). - Copyright (c) 2005 Andrea Merello - - This files contains programming code for the rtl8256 - radio frontend. - - *Many* thanks to Realtek Corp. for their great support! - -*/ + * This is part of the rtl8180-sa2400 driver + * released under the GPL (See file COPYING for details). + * Copyright (c) 2005 Andrea Merello + * + * This files contains programming code for the rtl8256 + * radio frontend. + * + * Many* thanks to Realtek Corp. for their great support! + */ #ifndef RTL8225H #define RTL8225H -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/15] staging: rtl8192u: fixing white space issue
While resending them ...do I have to mention v2. On Tue, Feb 14, 2017 at 10:54 PM, Greg KH wrote: > On Tue, Feb 14, 2017 at 02:33:34AM +0530, simran singhal wrote: >> Fix the following checkpatch.pl error and warnings: >> WARNING: please, no space before tabs >> >> Signed-off-by: simran singhal >> --- >> drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) > > You said this is a 15 patch patch series, yet I only received 9 of them. > > Please fix and resend all of them, properly threaded (hint, git > send-email will do this for you automatically, or you can do it by hand > with a good email client like mutt), so that I know I get them all and > can review and apply them. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/9] staging: rtl8192u: fixing white space issue
Fix the following checkpatch.pl error and warnings: WARNING: please, no space before tabs Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h index 873969c..a54dfad 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h @@ -30,7 +30,7 @@ typedef struct _TX_TS_RECORD{ u16 TxCurSeq; BA_RECORD TxPendingBARecord; /* For BA Originator */ BA_RECORD TxAdmittedBARecord; /* For BA Originator */ -/* QOS_DL_RECORD DLRecord; */ +/* QOS_DL_RECORD DLRecord; */ u8 bAddBaReqInProgress; u8 bAddBaReqDelayed; u8 bUsingBa; @@ -48,7 +48,7 @@ typedef struct _RX_TS_RECORD { u16 RxLastSeqNum; u8 RxLastFragNum; u8 num; -/* QOS_DL_RECORD DLRecord; */ +/* QOS_DL_RECORDLRecord; */ } RX_TS_RECORD, *PRX_TS_RECORD; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/9] staging: rtl8192u: Adding space after struct definition
Fixes checkpatch.pl warning: WARNING: missing space after struct definition Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h index a54dfad..7c4959a 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h @@ -14,7 +14,7 @@ typedef enum _TR_SELECT { RX_DIR = 1, } TR_SELECT, *PTR_SELECT; -typedef struct _TS_COMMON_INFO{ +typedef struct _TS_COMMON_INFO { struct list_headList; struct timer_list SetupTimer; struct timer_list InactTimer; @@ -25,7 +25,7 @@ typedef struct _TS_COMMON_INFO{ u8 TClasNum; } TS_COMMON_INFO, *PTS_COMMON_INFO; -typedef struct _TX_TS_RECORD{ +typedef struct _TX_TS_RECORD { TS_COMMON_INFO TsCommonInfo; u16 TxCurSeq; BA_RECORD TxPendingBARecord; /* For BA Originator */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/9] staging: rtl8192u: Adding space after enum and struct definition
Fixes checkpatch.pl warning: WARNING: missing space after struct definition WARNING: missing space after enum definition Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 38 - 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index c3aabba..5f54d93 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -35,7 +35,7 @@ #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP -typedef enum _HT_MCS_RATE{ +typedef enum _HT_MCS_RATE { HT_MCS0 = 0x0001, HT_MCS1 = 0x0002, HT_MCS2 = 0x0004, @@ -58,7 +58,7 @@ typedef enum _HT_MCS_RATE{ // // Represent Channel Width in HT Capabilities // -typedef enum _HT_CHANNEL_WIDTH{ +typedef enum _HT_CHANNEL_WIDTH { HT_CHANNEL_WIDTH_20 = 0, HT_CHANNEL_WIDTH_20_40 = 1, }HT_CHANNEL_WIDTH, *PHT_CHANNEL_WIDTH; @@ -67,14 +67,14 @@ typedef enum _HT_CHANNEL_WIDTH{ // Represent Extension Channel Offset in HT Capabilities // This is available only in 40Mhz mode. // -typedef enum _HT_EXTCHNL_OFFSET{ +typedef enum _HT_EXTCHNL_OFFSET { HT_EXTCHNL_OFFSET_NO_EXT = 0, HT_EXTCHNL_OFFSET_UPPER = 1, HT_EXTCHNL_OFFSET_NO_DEF = 2, HT_EXTCHNL_OFFSET_LOWER = 3, }HT_EXTCHNL_OFFSET, *PHT_EXTCHNL_OFFSET; -typedef enum _CHNLOP{ +typedef enum _CHNLOP { CHNLOP_NONE = 0, // No Action now CHNLOP_SCAN = 1, // Scan in progress CHNLOP_SWBW = 2, // Bandwidth switching in progress @@ -119,7 +119,7 @@ typedef union _HT_CAPABILITY_MACPARA{ }HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA; */ -typedef enum _HT_ACTION{ +typedef enum _HT_ACTION { ACT_RECOMMAND_WIDTH = 0, ACT_MIMO_PWR_SAVE = 1, ACT_PSMP= 2, @@ -134,14 +134,14 @@ typedef enum _HT_ACTION{ /* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */ -typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier{ +typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier { SC_MODE_DUPLICATE = 0, SC_MODE_LOWER = 1, SC_MODE_UPPER = 2, SC_MODE_FULL40MHZ = 3, }HT_BW40_SC_E; -typedefstruct _HT_CAPABILITY_ELE{ +typedefstruct _HT_CAPABILITY_ELE { //HT capability info u8 AdvCoding:1; @@ -184,7 +184,7 @@ typedef struct _HT_CAPABILITY_ELE{ // Only AP is required to include this element // -typedef struct _HT_INFORMATION_ELE{ +typedef struct _HT_INFORMATION_ELE { u8 ControlChl; u8 ExtChlOffset:2; @@ -215,18 +215,18 @@ typedef struct _HT_INFORMATION_ELE{ // MIMO Power Save control field. // This is appear in MIMO Power Save Action Frame // -typedef struct _MIMOPS_CTRL{ +typedef struct _MIMOPS_CTRL { u8 MimoPsEnable:1; u8 MimoPsMode:1; u8 Reserved:6; } MIMOPS_CTRL, *PMIMOPS_CTRL; -typedef enum _HT_SPEC_VER{ +typedef enum _HT_SPEC_VER { HT_SPEC_VER_IEEE = 0, HT_SPEC_VER_EWC = 1, }HT_SPEC_VER, *PHT_SPEC_VER; -typedef enum _HT_AGGRE_MODE_E{ +typedef enum _HT_AGGRE_MODE_E { HT_AGG_AUTO = 0, HT_AGG_FORCE_ENABLE = 1, HT_AGG_FORCE_DISABLE = 2, @@ -238,7 +238,7 @@ typedef enum _HT_AGGRE_MODE_E{ // to default value in HTInitializeHTInfo() // -typedef struct _RT_HIGH_THROUGHPUT{ +typedef struct _RT_HIGH_THROUGHPUT { u8 bEnableHT; u8 bCurrentHTSupport; @@ -347,7 +347,7 @@ typedef struct _RT_HIGH_THROUGHPUT{ // when card is configured as "AP mode" // -typedef struct _RT_HTINFO_STA_ENTRY{ +typedef struct _RT_HTINFO_STA_ENTRY { u8 bEnableHT; u8 bSupportCck; @@ -377,7 +377,7 @@ typedef struct _RT_HTINFO_STA_ENTRY{ // when card is configured as "STA mode" // -typedef struct _BSS_HT{ +typedef struct _BSS_HT { u8 bdSupportHT; @@ -395,7 +395,7 @@ typedef struct _BSS_HT{ u8 bdRT2RTLongSlotTime; } __attribute__ ((packed)) BSS_HT, *PBSS_HT; -typedef struct _MIMO_RSSI{ +typedef struct _MIMO_RSSI { u32 EnableAntenna; u32 AntennaA; u32 AntennaB; @@ -404,12 +404,12 @@ typedef struct _MIMO_RSSI{ u32 Average; }MIMO_RSSI, *PMIMO_RSSI; -typedef struct _MIMO_EVM{ +typedef struct _MIMO_EVM { u32 EVM1; u32EVM2; }MIMO_EVM, *PMIMO_EVM; -typedef struct _FALSE_ALARM_
[PATCH v2 4/9] staging: rtl8192u: blank lines aren't necessary before a close brace '}'
Fix checkpatch issues: "CHECK: Blank lines aren't necessary before a close brace '}'". Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 814ab5a..2481c21 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -623,7 +623,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, goto done; } *crypt = new_crypt; - } if (ext->key_len > 0 && (*crypt)->ops->set_key && @@ -725,7 +724,6 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, (ext->alg == IW_ENCODE_ALG_TKIP || ext->alg == IW_ENCODE_ALG_CCMP)) ext->ext_flags |= IW_ENCODE_EXT_TX_SEQ_VALID; - } return 0; @@ -839,6 +837,5 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len) ieee->wpa_ie_len = 0; } return 0; - } EXPORT_SYMBOL(ieee80211_wx_set_gen_ie); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 5/9] staging: rtl8192u: Use min_t instead of min
Use min_t instead of min function in ieee80211/ieee80211_wx.c fixed warning: WARNING: min() should probably be min_t(u8, network->ssid_len, 32) Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 2481c21..fff2020 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -80,7 +80,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.data.length = sizeof(""); start = iwe_stream_add_point(info, start, stop, &iwe, ""); } else { - iwe.u.data.length = min(network->ssid_len, (u8)32); + iwe.u.data.length = min_t(u8, network->ssid_len, 32); start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); } /* Add the protocol name */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 6/9] staging: rtl8192u: Fixing coding style issues
fixed errors and warnings: ERROR: spaces required around that '=' ERROR: spaces required around that '<' ERROR: space required before the open parenthesis '(' CHECK: spaces preferred around that '&' CHECK: spaces preferred around that '<<' ERROR: space required after that ',' ERROR: spaces required around that '+=' WARNING: Missing a blank line after declarations CHECK: spaces required around that '?' CHECK: spaces required around that ':' Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index fff2020..c846223 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -85,10 +85,10 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, } /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; - for(i=0; imode&(1<mode & (1 << i)) { + sprintf(pname, ieee80211_modes[i].mode_string, ieee80211_modes[i].mode_size); + pname += ieee80211_modes[i].mode_size; } } *pname = '\0'; @@ -150,14 +150,15 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, PHT_CAPABILITY_ELE ht_cap = NULL; bool is40M = false, isShortGI = false; u8 max_mcs = 0; + if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4)) ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[4]; else ht_cap = (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[0]; - is40M = (ht_cap->ChlWidth)?1:0; - isShortGI = (ht_cap->ChlWidth)? - ((ht_cap->ShortGI40Mhz)?1:0): - ((ht_cap->ShortGI20Mhz)?1:0); + is40M = (ht_cap->ChlWidth) ? 1 : 0; + isShortGI = (ht_cap->ChlWidth) ? + ((ht_cap->ShortGI40Mhz) ? 1 : 0) : + ((ht_cap->ShortGI20Mhz) ? 1 : 0); max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL); rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs&0x7f]; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 7/9] staging: rtl8192u: Fixing style issues in r8180_93cx6.c
Fixing the following checkpatch.pl errors and warning: WARNING: Block comments use * on subsequent lines CHECK: Please don't use multiple blank lines CHECK: Alignment should match open parenthesis CHECK: spaces preferred around that '<<' CHECK: spaces preferred around that '-' CHECK: Alignment should match open parenthesis Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8180_93cx6.c | 71 -- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c index f35defc..6a293e3 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.c +++ b/drivers/staging/rtl8192u/r8180_93cx6.c @@ -1,22 +1,22 @@ /* - This files contains card eeprom (93c46 or 93c56) programming routines, - memory is addressed by 16 bits words. - - This is part of rtl8180 OpenSource driver. - Copyright (C) Andrea Merello 2004 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part of the - official realtek driver. - - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon. - - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. - - We want to thank the Authors of those projects and the Ndiswrapper - project Authors. -*/ + * This files contains card eeprom (93c46 or 93c56) programming routines, + * memory is addressed by 16 bits words. + * + * This is part of rtl8180 OpenSource driver. + * Copyright (C) Andrea Merello 2004 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part of the + * official realtek driver. + * + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon. + * + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. + * + * We want to thank the Authors of those projects and the Ndiswrapper + * project Authors. + */ #include "r8180_93cx6.h" @@ -39,7 +39,6 @@ static void eprom_cs(struct net_device *dev, short bit) udelay(EPROM_DELAY); } - static void eprom_ck_cycle(struct net_device *dev) { u8 cmdreg; @@ -58,7 +57,6 @@ static void eprom_ck_cycle(struct net_device *dev) udelay(EPROM_DELAY); } - static void eprom_w(struct net_device *dev, short bit) { u8 cmdreg; @@ -76,7 +74,6 @@ static void eprom_w(struct net_device *dev, short bit) udelay(EPROM_DELAY); } - static short eprom_r(struct net_device *dev) { u8 bit; @@ -94,7 +91,6 @@ static short eprom_r(struct net_device *dev) return 0; } - static void eprom_send_bits_string(struct net_device *dev, short b[], int len) { int i; @@ -105,7 +101,6 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len) } } - int eprom_read(struct net_device *dev, u32 addr) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -119,27 +114,27 @@ int eprom_read(struct net_device *dev, u32 addr) ret = 0; /* enable EPROM programming */ write_nic_byte_E(dev, EPROM_CMD, - (EPROM_CMD_PROGRAM<epromtype == EPROM_93c56) { addr_str[7] = addr & 1; - addr_str[6] = addr & (1<<1); - addr_str[5] = addr & (1<<2); - addr_str[4] = addr & (1<<3); - addr_str[3] = addr & (1<<4); - addr_str[2] = addr & (1<<5); - addr_str[1] = addr & (1<<6); - addr_str[0] = addr & (1<<7); + addr_str[6] = addr & (1 << 1); + addr_str[5] = addr & (1 << 2); + addr_str[4] = addr & (1 << 3); + addr_str[3] = addr & (1 << 4); + addr_str[2] = addr & (1 << 5); + addr_str[1] = addr & (1 << 6); + addr_str[0] = addr & (1 << 7); addr_len = 8; } else { addr_str[5] = addr & 1; - addr_str[4] = addr & (1<<1); - addr_str[3] = addr & (1<<2); - addr_str[2] = addr & (1<<3); - addr_str[1] = addr & (1<<4); - addr_str[0] = addr & (1<<5); + addr_str[4] = addr & (1 << 1); + addr_str[3] = addr & (1 << 2); + addr_str[2] = addr & (1 << 3); + addr_str[1] = addr & (1 << 4); + addr_str[0] = addr & (1 << 5); addr_len = 6; } eprom_cs(dev, 1); @@ -162,7 +157,7 @@ int eprom_read(struct net_device *dev, u32 addr) if (err < 0)
[PATCH v2 9/9] staging: rtl8192u: fixing block comments use * on subsequent lines
Fixed checkpatch.pl warning: WARNING: Block comments use * on subsequent lines Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8190_rtl8256.h | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.h b/drivers/staging/rtl8192u/r8190_rtl8256.h index 1ba4f83..5878f42 100644 --- a/drivers/staging/rtl8192u/r8190_rtl8256.h +++ b/drivers/staging/rtl8192u/r8190_rtl8256.h @@ -1,14 +1,13 @@ /* - This is part of the rtl8180-sa2400 driver - released under the GPL (See file COPYING for details). - Copyright (c) 2005 Andrea Merello - - This files contains programming code for the rtl8256 - radio frontend. - - *Many* thanks to Realtek Corp. for their great support! - -*/ + * This is part of the rtl8180-sa2400 driver + * released under the GPL (See file COPYING for details). + * Copyright (c) 2005 Andrea Merello + * + * This files contains programming code for the rtl8256 + * radio frontend. + * + * Many* thanks to Realtek Corp. for their great support! + */ #ifndef RTL8225H #define RTL8225H -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 8/9] staging: rtl8192u: Fixing style issues in r8180_93cx6.h
Fixing the following checkpatch.pl errors and warning: WARNING: Block comments use * on subsequent lines CHECK: Please don't use multiple blank lines Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8180_93cx6.h | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h b/drivers/staging/rtl8192u/r8180_93cx6.h index 9cf7f58..643d465 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.h +++ b/drivers/staging/rtl8192u/r8180_93cx6.h @@ -1,17 +1,17 @@ /* - This is part of rtl8187 OpenSource driver - Copyright (C) Andrea Merello 2004-2005 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part of the - official realtek driver - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver - - We want to thank the Authors of such projects and the Ndiswrapper - project Authors. -*/ + * This is part of rtl8187 OpenSource driver + * Copyright (C) Andrea Merello 2004-2005 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part of the + * official realtek driver + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver + * + * We want to thank the Authors of such projects and the Ndiswrapper + * project Authors. + */ /*This files contains card eeprom (93c46 or 93c56) programming routines*/ /*memory is addressed by WORDS*/ @@ -39,5 +39,4 @@ #define EPROM_TXPW2 0x1b #define EPROM_TXPW1 0x3d - int eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 6/9] staging: rtl8192u: Fixing coding style issues
Yes, I totally agree with joe. But as there is no coding style issue in this patch. So, do I have to resend the complete patch series again? On Wed, Feb 15, 2017 at 1:53 AM, Joe Perches wrote: > On Wed, 2017-02-15 at 01:44 +0530, simran singhal wrote: > [] >> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c >> b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c > [] >> @@ -150,14 +150,15 @@ static inline char *rtl819x_translate_scan(struct >> ieee80211_device *ieee, >> PHT_CAPABILITY_ELE ht_cap = NULL; >> bool is40M = false, isShortGI = false; >> u8 max_mcs = 0; >> + >> if (!memcmp(network->bssht.bdHTCapBuf, EWC11NHTCap, 4)) >> ht_cap = >> (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[4]; >> else >> ht_cap = >> (PHT_CAPABILITY_ELE)&network->bssht.bdHTCapBuf[0]; >> - is40M = (ht_cap->ChlWidth)?1:0; >> - isShortGI = (ht_cap->ChlWidth)? >> - ((ht_cap->ShortGI40Mhz)?1:0): >> - ((ht_cap->ShortGI20Mhz)?1:0); >> + is40M = (ht_cap->ChlWidth) ? 1 : 0; >> + isShortGI = (ht_cap->ChlWidth) ? >> + ((ht_cap->ShortGI40Mhz) ? 1 : >> 0) : >> + ((ht_cap->ShortGI20Mhz) ? 1 : >> 0); > > You have a brain, checkpatch is brainless. > Please remember to do more than just shut-up checkpatch. > > This could be simplified by removing parentheses and ternaries to > > isShortGI = ht_cap->Ch1Width ? ht_cap->ShortGI40Mhz > : ht_cap->ShortGI20Mhz; > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 6/9] staging: rtl8192u: Fixing coding style issues
On Wed, Feb 15, 2017 at 9:01 AM, Joe Perches wrote: > On Wed, 2017-02-15 at 08:52 +0530, SIMRAN SINGHAL wrote: >> Yes, I totally agree with joe. >> >> But as there is no coding style issue in this patch. > > Style is more than just checkpatch conformity. > >> So, do I have to resend the complete patch series again? > > I'm not applying any of these so that's entirely up > to Greg. > > Perhaps he might apply the first 5 patches and reject > this one, maybe he might apply all the patches. > > In any case, do strive to develop some reasonable > semblance of style and do more than just checkpatch > suggested patches and find and fix some actual defect > somewhere. Joe, I am new to Linux kernel and just have basic knowledge of C and C++. For doing more than checkpatches I need to explore Linux kernel more, so please suggest me some tasks that help me in exploring Linux kernel, which helps me in building the better understanding of codes, which I am finding difficult to understand so that I can do more than just checkpatch. Thanks, Simran ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 9/9] staging: rtl8192u: fixing block comments use * on subsequent lines
Then which tree it applies to. Thanks, Simran On Fri, Feb 17, 2017 at 12:05 AM, Greg KH wrote: > On Wed, Feb 15, 2017 at 01:46:27AM +0530, simran singhal wrote: >> Fixed checkpatch.pl warning: >> WARNING: Block comments use * on subsequent lines >> >> Signed-off-by: simran singhal >> --- >> drivers/staging/rtl8192u/r8190_rtl8256.h | 19 +-- >> 1 file changed, 9 insertions(+), 10 deletions(-) > > Does not apply to my tree :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 6/9] staging: rtl8192u: Fixing coding style issues
I didn't mean what you get. I just want to say I am a beginner and like to contribute to Linux kernel. But at present, I am in learning mode. I never mean that I am doing this for learning C or C++ but yes for contributing to Linux kernel in every possible way. And, would be very happy if you guide me so that I can improve. On Fri, Feb 17, 2017 at 12:02 AM, Greg KH wrote: > On Wed, Feb 15, 2017 at 01:48:13PM +0530, SIMRAN SINGHAL wrote: >> On Wed, Feb 15, 2017 at 9:01 AM, Joe Perches wrote: >> > On Wed, 2017-02-15 at 08:52 +0530, SIMRAN SINGHAL wrote: >> >> Yes, I totally agree with joe. >> >> >> >> But as there is no coding style issue in this patch. >> > >> > Style is more than just checkpatch conformity. >> > >> >> So, do I have to resend the complete patch series again? >> > >> > I'm not applying any of these so that's entirely up >> > to Greg. >> > >> > Perhaps he might apply the first 5 patches and reject >> > this one, maybe he might apply all the patches. >> > >> > In any case, do strive to develop some reasonable >> > semblance of style and do more than just checkpatch >> > suggested patches and find and fix some actual defect >> > somewhere. >> >> Joe, I am new to Linux kernel and just have basic knowledge of >> C and C++. > > As Joe said, the kernel is _not_ the project to learn C with. Please > get some more experience with userspace programs in C first, before > working on the kernel. It will be much easier for you. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 9/9] staging: rtl8192u: fixing block comments use * on subsequent lines
I am attaching the screenshot of what I am getting from the script get_maintainer.pl. Thanks, Simran On Fri, Feb 17, 2017 at 12:23 AM, Greg KH wrote: > On Fri, Feb 17, 2017 at 12:20:22AM +0530, SIMRAN SINGHAL wrote: >> Then which tree it applies to. > > I have no idea, you wrote it, not me :) > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[no subject]
linux-ker...@vger.kernel.org Bcc: Subject: [PATCH 1/3] staging: rtl8192u: Replace symbolic permissions with octal permissions Reply-To: WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. This warning is detected by checkpatch.pl Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index a9a92d8..2ebc320 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -283,7 +283,7 @@ int __init ieee80211_debug_init(void) " proc directory\n"); return -EIO; } - e = proc_create("debug_level", S_IRUGO | S_IWUSR, + e = proc_create("debug_level", 0644, ieee80211_proc, &fops); if (!e) { remove_proc_entry(DRV_NAME, init_net.proc_net); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: rtl8192u: Replace symbolic permissions with octal permissions
WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. This warning is detected by checkpatch.pl Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index a9a92d8..2ebc320 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -283,7 +283,7 @@ int __init ieee80211_debug_init(void) " proc directory\n"); return -EIO; } - e = proc_create("debug_level", S_IRUGO | S_IWUSR, + e = proc_create("debug_level", 0644, ieee80211_proc, &fops); if (!e) { remove_proc_entry(DRV_NAME, init_net.proc_net); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: rtl8192u: Replace symbolic permissions with octal permissions
Octal permissions should be used instead of symbolic ones for easier reading. WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'. This warning is detected by checkpatch.pl Signed-off-by: simran singhal --- v2: -Added more information about patch -Reworked for putting proc_create() in one line drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index a9a92d8..503ba7f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -283,8 +283,7 @@ int __init ieee80211_debug_init(void) " proc directory\n"); return -EIO; } - e = proc_create("debug_level", S_IRUGO | S_IWUSR, - ieee80211_proc, &fops); + e = proc_create("debug_level", 0644, ieee80211_proc, &fops); if (!e) { remove_proc_entry(DRV_NAME, init_net.proc_net); ieee80211_proc = NULL; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 9/9] staging: rtl8192u: fixing block comments use * on subsequent lines
Sorry for replying properly. On Fri, Feb 17, 2017 at 1:16 AM, Greg KH wrote: > On Fri, Feb 17, 2017 at 12:49:54AM +0530, SIMRAN SINGHAL wrote: >> I am attaching the screenshot of what I am getting from the >> script get_maintainer.pl. > > I can't read images from a text email client. ok, will keep this in mind. > > I totally don't understand this conversation at all, what is the > question? What is this concerning? Why are you not properly quoting > things so that we can determine this? I want to say that after executing script get_maintainer.pl on the patch, I got your name and email id that's why I send that patch to you. I know only one source that is get_maintainer.pl through which I find out to whom I am suppose to send the patch and the mailing lists I have to cc, and this is what is mentioned in tutorial also. > > confused, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: rtl8192u: Fixed 'tabstop' coding style warnings
Replace a mix of tabs and spaces indentation by tabs only. Fixed checkpatch warning "Statements should start on a tabstop" in rtl8192u module. Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 563d7fe..814ab5a 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -666,7 +666,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, if (ieee->set_security) ieee->set_security(ieee->dev, &sec); -if (ieee->reset_on_keychange && + if (ieee->reset_on_keychange && ieee->iw_mode != IW_MODE_INFRA && ieee->reset_port && ieee->reset_port(dev)) { IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: rtl8192u: Prefer using the BIT macro
This is a nonfunctional change, declare register bit values with BIT() helper macro. Fix the checkpatch.pl issue: CHECK: Prefer using the BIT macro replacing bit shifting on 1 with the BIT(x) macro. The BIT() macro will make all the constants explicitly 'unsigned', which helps to avoid the warning. Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 140 - 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index a020e04..648806b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -502,28 +502,28 @@ do { if (ieee80211_debug_level & (level)) \ * */ -#define IEEE80211_DL_INFO (1<<0) -#define IEEE80211_DL_WX(1<<1) -#define IEEE80211_DL_SCAN (1<<2) -#define IEEE80211_DL_STATE (1<<3) -#define IEEE80211_DL_MGMT (1<<4) -#define IEEE80211_DL_FRAG (1<<5) -#define IEEE80211_DL_EAP (1<<6) -#define IEEE80211_DL_DROP (1<<7) - -#define IEEE80211_DL_TX(1<<8) -#define IEEE80211_DL_RX(1<<9) - -#define IEEE80211_DL_HT (1<<10) //HT -#define IEEE80211_DL_BA (1<<11) //ba -#define IEEE80211_DL_TS (1<<12) //TS -#define IEEE80211_DL_QOS (1<<13) -#define IEEE80211_DL_REORDER (1<<14) -#define IEEE80211_DL_IOT (1<<15) -#define IEEE80211_DL_IPS (1<<16) -#define IEEE80211_DL_TRACE(1<<29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen -#define IEEE80211_DL_DATA (1<<30) //use this flag to control whether print data buf out. -#define IEEE80211_DL_ERR (1<<31) //always open +#define IEEE80211_DL_INFO BIT(0) +#define IEEE80211_DL_WXBIT(1) +#define IEEE80211_DL_SCAN BIT(2) +#define IEEE80211_DL_STATE BIT(3) +#define IEEE80211_DL_MGMT BIT(4) +#define IEEE80211_DL_FRAG BIT(5) +#define IEEE80211_DL_EAP BIT(6) +#define IEEE80211_DL_DROP BIT(7) + +#define IEEE80211_DL_TXBIT(8) +#define IEEE80211_DL_RXBIT(9) + +#define IEEE80211_DL_HT BIT(10) //HT +#define IEEE80211_DL_BA BIT(11) //ba +#define IEEE80211_DL_TS BIT(12) //TS +#define IEEE80211_DL_QOS BIT(13) +#define IEEE80211_DL_REORDER BIT(14) +#define IEEE80211_DL_IOT BIT(15) +#define IEEE80211_DL_IPS BIT(16) +#define IEEE80211_DL_TRACEBIT(29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen +#define IEEE80211_DL_DATA BIT(30) //use this flag to control whether print data buf out. +#define IEEE80211_DL_ERR BIT(31) //always open #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) #define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a) @@ -625,18 +625,18 @@ struct ieee80211_snap_hdr { #define IEEE80211_OFDM_RATE_54MB 0x6C #define IEEE80211_BASIC_RATE_MASK 0x80 -#define IEEE80211_CCK_RATE_1MB_MASK(1<<0) -#define IEEE80211_CCK_RATE_2MB_MASK(1<<1) -#define IEEE80211_CCK_RATE_5MB_MASK(1<<2) -#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) -#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) -#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) -#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) -#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) -#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) -#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) -#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) -#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) +#define IEEE80211_CCK_RATE_1MB_MASKBIT(0) +#define IEEE80211_CCK_RATE_2MB_MASKBIT(1) +#define IEEE80211_CCK_RATE_5MB_MASKBIT(2) +#define IEEE80211_CCK_RATE_11MB_MASK BIT(3) +#define IEEE80211_OFDM_RATE_6MB_MASK BIT(4) +#define IEEE80211_OFDM_RATE_9MB_MASK BIT(5) +#define IEEE80211_OFDM_RATE_12MB_MASK BIT(6) +#define IEEE80211_OFDM_RATE_18MB_MASK BIT(7) +#define IEEE80211_OFDM_RATE_24MB_MASK BIT(8) +#define IEEE80211_OFDM_RATE_36MB_MASK BIT(9) +#define IEEE80211_OFDM_RATE_48MB_MASK BIT(10) +#define IEEE80211_OFDM_RATE_54MB_MASK BIT(11) #define IEEE80211_CCK_RATES_MASK 0x000F #define IEEE80211_CCK_BASIC
[PATCH v2 2/3] staging: rtl8192u: Fixed 'tabstop' coding style warning
Replace a mix of tabs and spaces indentation by tabs only. Fixed checkpatch warning "Statements should start on a tabstop" in rtl8192u module. Signed-off-by: simran singhal --- v2: -Modified "warnings" to "warning" in the patch Subject. drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 563d7fe..814ab5a 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -666,7 +666,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, if (ieee->set_security) ieee->set_security(ieee->dev, &sec); -if (ieee->reset_on_keychange && + if (ieee->reset_on_keychange && ieee->iw_mode != IW_MODE_INFRA && ieee->reset_port && ieee->reset_port(dev)) { IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: rtl8192u: Prefer using the BIT macro
Replaces left shift operation (1 << d) by BIT(x) macro. Fix the checkpatch.pl issue: CHECK: Prefer using the BIT macro replacing Signed-off-by: simran singhal --- V2: -modified patch message. drivers/staging/rtl8192u/ieee80211/ieee80211.h | 140 - 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index a020e04..648806b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -502,28 +502,28 @@ do { if (ieee80211_debug_level & (level)) \ * */ -#define IEEE80211_DL_INFO (1<<0) -#define IEEE80211_DL_WX(1<<1) -#define IEEE80211_DL_SCAN (1<<2) -#define IEEE80211_DL_STATE (1<<3) -#define IEEE80211_DL_MGMT (1<<4) -#define IEEE80211_DL_FRAG (1<<5) -#define IEEE80211_DL_EAP (1<<6) -#define IEEE80211_DL_DROP (1<<7) - -#define IEEE80211_DL_TX(1<<8) -#define IEEE80211_DL_RX(1<<9) - -#define IEEE80211_DL_HT (1<<10) //HT -#define IEEE80211_DL_BA (1<<11) //ba -#define IEEE80211_DL_TS (1<<12) //TS -#define IEEE80211_DL_QOS (1<<13) -#define IEEE80211_DL_REORDER (1<<14) -#define IEEE80211_DL_IOT (1<<15) -#define IEEE80211_DL_IPS (1<<16) -#define IEEE80211_DL_TRACE(1<<29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen -#define IEEE80211_DL_DATA (1<<30) //use this flag to control whether print data buf out. -#define IEEE80211_DL_ERR (1<<31) //always open +#define IEEE80211_DL_INFO BIT(0) +#define IEEE80211_DL_WXBIT(1) +#define IEEE80211_DL_SCAN BIT(2) +#define IEEE80211_DL_STATE BIT(3) +#define IEEE80211_DL_MGMT BIT(4) +#define IEEE80211_DL_FRAG BIT(5) +#define IEEE80211_DL_EAP BIT(6) +#define IEEE80211_DL_DROP BIT(7) + +#define IEEE80211_DL_TXBIT(8) +#define IEEE80211_DL_RXBIT(9) + +#define IEEE80211_DL_HT BIT(10) //HT +#define IEEE80211_DL_BA BIT(11) //ba +#define IEEE80211_DL_TS BIT(12) //TS +#define IEEE80211_DL_QOS BIT(13) +#define IEEE80211_DL_REORDER BIT(14) +#define IEEE80211_DL_IOT BIT(15) +#define IEEE80211_DL_IPS BIT(16) +#define IEEE80211_DL_TRACEBIT(29) //trace function, need to user net_ratelimit() together in order not to print too much to the screen +#define IEEE80211_DL_DATA BIT(30) //use this flag to control whether print data buf out. +#define IEEE80211_DL_ERR BIT(31) //always open #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) #define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a) @@ -625,18 +625,18 @@ struct ieee80211_snap_hdr { #define IEEE80211_OFDM_RATE_54MB 0x6C #define IEEE80211_BASIC_RATE_MASK 0x80 -#define IEEE80211_CCK_RATE_1MB_MASK(1<<0) -#define IEEE80211_CCK_RATE_2MB_MASK(1<<1) -#define IEEE80211_CCK_RATE_5MB_MASK(1<<2) -#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) -#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) -#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) -#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) -#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) -#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) -#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) -#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) -#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) +#define IEEE80211_CCK_RATE_1MB_MASKBIT(0) +#define IEEE80211_CCK_RATE_2MB_MASKBIT(1) +#define IEEE80211_CCK_RATE_5MB_MASKBIT(2) +#define IEEE80211_CCK_RATE_11MB_MASK BIT(3) +#define IEEE80211_OFDM_RATE_6MB_MASK BIT(4) +#define IEEE80211_OFDM_RATE_9MB_MASK BIT(5) +#define IEEE80211_OFDM_RATE_12MB_MASK BIT(6) +#define IEEE80211_OFDM_RATE_18MB_MASK BIT(7) +#define IEEE80211_OFDM_RATE_24MB_MASK BIT(8) +#define IEEE80211_OFDM_RATE_36MB_MASK BIT(9) +#define IEEE80211_OFDM_RATE_48MB_MASK BIT(10) +#define IEEE80211_OFDM_RATE_54MB_MASK BIT(11) #define IEEE80211_CCK_RATES_MASK 0x000F #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ @@ -794,16 +794,16 @@ struct ieee80211_device; #include "ieee80211_crypt.h" -#de
[PATCH 1/6] staging: rtl8192e: Replaced comparison to NULL statements
This patch corrects check generated by checkpatch.pl by replacing comparison to null statements with equivalent statements in the form of "!x". Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_BAProc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 20260af..bdbd21c 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -83,12 +83,12 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, netdev_dbg(ieee->dev, "%s(): frame(%d) sentd to: %pM, ieee->dev:%p\n", __func__, type, Dst, ieee->dev); - if (pBA == NULL) { + if (!pBA) { netdev_warn(ieee->dev, "pBA is NULL\n"); return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) + if (!skb) return NULL; memset(skb->data, 0, sizeof(struct rtllib_hdr_3addr)); @@ -154,7 +154,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) + if (!skb) return NULL; skb_reserve(skb, ieee->tx_headroom); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: rtl8192e: Remove CamelCase
This patch renames pBA to pba to avoid camelcase. Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_BAProc.c | 100 +++--- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index bdbd21c..e51ec16 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -18,18 +18,18 @@ #include "rtllib.h" #include "rtl819x_BA.h" -static void ActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pBA, +static void ActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pba, u16 Time) { - pBA->bValid = true; + pba->bValid = true; if (Time != 0) - mod_timer(&pBA->Timer, jiffies + msecs_to_jiffies(Time)); + mod_timer(&pba->Timer, jiffies + msecs_to_jiffies(Time)); } -static void DeActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pBA) +static void DeActivateBAEntry(struct rtllib_device *ieee, struct ba_record *pba) { - pBA->bValid = false; - del_timer_sync(&pBA->Timer); + pba->bValid = false; + del_timer_sync(&pba->Timer); } static u8 TxTsDeleteBA(struct rtllib_device *ieee, struct tx_ts_record *pTxTs) @@ -63,16 +63,16 @@ static u8 RxTsDeleteBA(struct rtllib_device *ieee, struct rx_ts_record *pRxTs) return bSendDELBA; } -void ResetBaEntry(struct ba_record *pBA) +void ResetBaEntry(struct ba_record *pba) { - pBA->bValid = false; - pBA->BaParamSet.shortData = 0; - pBA->BaTimeoutValue = 0; - pBA->DialogToken= 0; - pBA->BaStartSeqCtrl.ShortData = 0; + pba->bValid = false; + pba->BaParamSet.shortData = 0; + pba->BaTimeoutValue = 0; + pba->DialogToken= 0; + pba->BaStartSeqCtrl.ShortData = 0; } static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, - struct ba_record *pBA, + struct ba_record *pba, u16 StatusCode, u8 type) { struct sk_buff *skb = NULL; @@ -83,8 +83,8 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, netdev_dbg(ieee->dev, "%s(): frame(%d) sentd to: %pM, ieee->dev:%p\n", __func__, type, Dst, ieee->dev); - if (!pBA) { - netdev_warn(ieee->dev, "pBA is NULL\n"); + if (!pba) { + netdev_warn(ieee->dev, "pba is NULL\n"); return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); @@ -107,7 +107,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, tag = (u8 *)skb_put(skb, 9); *tag++ = ACT_CAT_BA; *tag++ = type; - *tag++ = pBA->DialogToken; + *tag++ = pba->DialogToken; if (type == ACT_ADDBARSP) { RT_TRACE(COMP_DBG, ">to send ADDBARSP\n"); @@ -116,14 +116,14 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, tag += 2; } - put_unaligned_le16(pBA->BaParamSet.shortData, tag); + put_unaligned_le16(pba->BaParamSet.shortData, tag); tag += 2; - put_unaligned_le16(pBA->BaTimeoutValue, tag); + put_unaligned_le16(pba->BaTimeoutValue, tag); tag += 2; if (type == ACT_ADDBAREQ) { - memcpy(tag, (u8 *)&(pBA->BaStartSeqCtrl), 2); + memcpy(tag, (u8 *)&(pba->BaStartSeqCtrl), 2); tag += 2; } @@ -135,7 +135,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, } static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, - struct ba_record *pBA, + struct ba_record *pba, enum tr_select TxRxSelect, u16 ReasonCode) { union delba_param_set DelbaParamSet; @@ -151,7 +151,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, memset(&DelbaParamSet, 0, 2); DelbaParamSet.field.Initiator = (TxRxSelect == TX_DIR) ? 1 : 0; - DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; + DelbaParamSet.field.TID = pba->BaParamSet.field.TID; skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); if (!skb) @@ -187,11 +187,11 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, } static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst, -struct ba_record *pBA) +
[PATCH v2 1/6] staging: rtl8192e: Replaced comparison to NULL statements
This patch removes the explicit NULL comparison. This issue was found by checkpatch. Signed-off-by: simran singhal --- v2: -Modified commit message drivers/staging/rtl8192e/rtl819x_BAProc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 20260af..bdbd21c 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -83,12 +83,12 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, netdev_dbg(ieee->dev, "%s(): frame(%d) sentd to: %pM, ieee->dev:%p\n", __func__, type, Dst, ieee->dev); - if (pBA == NULL) { + if (!pBA) { netdev_warn(ieee->dev, "pBA is NULL\n"); return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) + if (!skb) return NULL; memset(skb->data, 0, sizeof(struct rtllib_hdr_3addr)); @@ -154,7 +154,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) + if (!skb) return NULL; skb_reserve(skb, ieee->tx_headroom); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: rtl8192e: Fix block comments warning
Align * on a line, to conform to the kernal coding style for block comments. Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 6eb018f..48d101a 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -11,7 +11,7 @@ * * Contact Information: * wlanfae -**/ + **/ #ifndef _RTL819XU_HTTYPE_H_ #define _RTL819XU_HTTYPE_H_ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/6] staging: rtl8192e: Remove blank line after '{'
Remove blank line after opening brace to fix the checkpatch issue blank lines aren't necessary after a open brace '{'. Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_HT.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 48d101a..f53903e 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -32,7 +32,6 @@ enum ht_extchnl_offset { }; struct ht_capab_ele { - u8 AdvCoding:1; u8 ChlWidth:1; u8 MimoPwrSave:2; @@ -187,7 +186,6 @@ struct rt_hi_throughput { } __packed; struct bss_ht { - u8 bdSupportHT; u8 bdHTCapBuf[32]; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/6] staging: rtl8192e: Fixes multiple blank lines issue
This patch fixes the checkpatch.pl issue: Please don't use multiple blank lines Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_HT.h | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index f53903e..eceb548 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -53,7 +53,6 @@ struct ht_capab_ele { u8 MCS[16]; - u16 ExtHTCapInfo; u8 TxBFCap[4]; @@ -62,7 +61,6 @@ struct ht_capab_ele { } __packed; - struct ht_info_ele { u8 ControlChl; @@ -101,7 +99,6 @@ enum ht_aggre_mode { HT_AGG_FORCE_DISABLE = 2, }; - struct rt_hi_throughput { u8 bEnableHT; u8 bCurrentHTSupport; @@ -120,14 +117,12 @@ struct rt_hi_throughput { enum ht_spec_ver ePeerHTSpecVer; - struct ht_capab_ele SelfHTCap; struct ht_info_ele SelfHTInfo; u8 PeerHTCapBuf[32]; u8 PeerHTInfoBuf[32]; - u8 bAMSDU_Support; u16 nAMSDU_MaxSize; u8 bCurrent_AMSDU_Support; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: rtl8192e: Removed unnecessary parentheses
Extra parentheses were causing checkpatch issues and were removed. Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_HTProc.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index cded0f4..1391c91 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -297,7 +297,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); - pCapELE = (struct ht_capab_ele *)&(posHTCap[4]); + pCapELE = (struct ht_capab_ele *)&posHTCap[4]; *len = 30 + 2; } else { pCapELE = (struct ht_capab_ele *)posHTCap; @@ -663,13 +663,13 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; - memset((void *)(&(pHTInfo->SelfHTCap)), 0, + memset((void *)(&pHTInfo->SelfHTCap), 0, sizeof(pHTInfo->SelfHTCap)); - memset((void *)(&(pHTInfo->SelfHTInfo)), 0, + memset((void *)(&pHTInfo->SelfHTInfo), 0, sizeof(pHTInfo->SelfHTInfo)); - memset((void *)(&(pHTInfo->PeerHTCapBuf)), 0, + memset((void *)(&pHTInfo->PeerHTCapBuf), 0, sizeof(pHTInfo->PeerHTCapBuf)); - memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0, + memset((void *)(&pHTInfo->PeerHTInfoBuf), 0, sizeof(pHTInfo->PeerHTInfoBuf)); pHTInfo->bSwBwInProgress = false; @@ -685,7 +685,7 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) pHTInfo->IOTRaFunc = 0; { - u8 *RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]); + u8 *RegHTSuppRateSets = &ieee->RegHTSuppRateSet[0]; RegHTSuppRateSets[0] = 0xFF; RegHTSuppRateSets[1] = 0xFF; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/6] staging: rtl8192e: Fix block comments warning
Align * on last line, to conform to the kernal coding style for block comments. Signed-off-by: simran singhal --- v2: -Modified commit message drivers/staging/rtl8192e/rtl819x_HT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HT.h b/drivers/staging/rtl8192e/rtl819x_HT.h index 6eb018f..48d101a 100644 --- a/drivers/staging/rtl8192e/rtl819x_HT.h +++ b/drivers/staging/rtl8192e/rtl819x_HT.h @@ -11,7 +11,7 @@ * * Contact Information: * wlanfae -**/ + **/ #ifndef _RTL819XU_HTTYPE_H_ #define _RTL819XU_HTTYPE_H_ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] staging: vt6655: Compress return logic
Simplify function returns by merging assignment and return into one command line. Found with Coccinelle @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: simran singhal --- drivers/staging/vt6655/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index e0c9281..b513846 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -920,7 +920,7 @@ u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2) qwTSFOffset = qwTSF1 - qwTSF2; - return qwTSFOffset; + return qwTSF1 - qwTSF2; } /* -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/6] staging: vt6655: Compress return logic
gre...@linuxfoundation.org,de...@driverdev.osuosl.org,linux-ker...@vger.kernel.org,outreachy-ker...@googlegroups.com Bcc: Subject: [PATCH v2 1/6] staging: vt6655: Compress return logic Reply-To: Simplify function returns by merging assignment and return into one command line. Found with Coccinelle @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: simran singhal --- v2: -Removed assignment drivers/staging/vt6655/card.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index e0c9281..9a8999f 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -918,9 +918,7 @@ u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2) qwTSF2 += (u64)wRxBcnTSFOffst; - qwTSFOffset = qwTSF1 - qwTSF2; - - return qwTSFOffset; + return qwTSF1 - qwTSF2; } /* -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/6] staging: vt6655: Compress return logic
Simplify function returns by merging assignment and return into one command line. Found with Coccinelle @@ local idexpression ret; expression e; @@ -ret = +return e; -return ret; Signed-off-by: simran singhal --- v2: -Removed assignment v3: -Removed declaration of qwTSFOffset drivers/staging/vt6655/card.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index e0c9281..1306e55 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -911,16 +911,13 @@ bool CARDbSoftwareReset(struct vnt_private *priv) */ u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2) { - u64 qwTSFOffset = 0; unsigned short wRxBcnTSFOffst; wRxBcnTSFOffst = cwRXBCNTSFOff[byRxRate%MAX_RATE]; qwTSF2 += (u64)wRxBcnTSFOffst; - qwTSFOffset = qwTSF1 - qwTSF2; - - return qwTSFOffset; + return qwTSF1 - qwTSF2; } /* -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: rtl8192e: Change form of NULL comparisons
Change null comparisons of the form x == NULL to !x. This was done using Coccinelle. @@ expression e; @@ - e == NULL + !e Signed-off-by: simran singhal --- drivers/staging/rtl8192e/rtl819x_TSProc.c| 2 +- drivers/staging/rtl8192e/rtllib_crypt_ccmp.c | 2 +- drivers/staging/rtl8192e/rtllib_crypt_wep.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c index 48bbd9e..d0c2f3c 100644 --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c @@ -289,7 +289,7 @@ static void MakeTSEntry(struct ts_common_info *pTsCommonInfo, u8 *Addr, { u8 count; - if (pTsCommonInfo == NULL) + if (!pTsCommonInfo) return; memcpy(pTsCommonInfo->Addr, Addr, 6); diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c index bc45cf0..ed2e06f 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c @@ -63,7 +63,7 @@ static void *rtllib_ccmp_init(int key_idx) struct rtllib_ccmp_data *priv; priv = kzalloc(sizeof(*priv), GFP_ATOMIC); - if (priv == NULL) + if (!priv) goto fail; priv->key_idx = key_idx; diff --git a/drivers/staging/rtl8192e/rtllib_crypt_wep.c b/drivers/staging/rtl8192e/rtllib_crypt_wep.c index b3343a5..f5a1bc5 100644 --- a/drivers/staging/rtl8192e/rtllib_crypt_wep.c +++ b/drivers/staging/rtl8192e/rtllib_crypt_wep.c @@ -37,7 +37,7 @@ static void *prism2_wep_init(int keyidx) struct prism2_wep_data *priv; priv = kzalloc(sizeof(*priv), GFP_ATOMIC); - if (priv == NULL) + if (!priv) goto fail; priv->key_idx = keyidx; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 6/6] staging: rtl8192e: Removed unnecessary parentheses
Extra parentheses were causing checkpatch issues and were removed. Signed-off-by: simran singhal --- v2: -Removed parentheses around argument of cast -Removed cast drivers/staging/rtl8192e/rtl819x_HTProc.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index cded0f4..0a9234e 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -297,7 +297,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); - pCapELE = (struct ht_capab_ele *)&(posHTCap[4]); + pCapELE = (struct ht_capab_ele *)&posHTCap[4]; *len = 30 + 2; } else { pCapELE = (struct ht_capab_ele *)posHTCap; @@ -663,13 +663,13 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; - memset((void *)(&(pHTInfo->SelfHTCap)), 0, + memset(&pHTInfo->SelfHTCap, 0, sizeof(pHTInfo->SelfHTCap)); - memset((void *)(&(pHTInfo->SelfHTInfo)), 0, + memset(&pHTInfo->SelfHTInfo, 0, sizeof(pHTInfo->SelfHTInfo)); - memset((void *)(&(pHTInfo->PeerHTCapBuf)), 0, + memset(&pHTInfo->PeerHTCapBuf, 0, sizeof(pHTInfo->PeerHTCapBuf)); - memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0, + memset(&pHTInfo->PeerHTInfoBuf, 0, sizeof(pHTInfo->PeerHTInfoBuf)); pHTInfo->bSwBwInProgress = false; @@ -685,7 +685,7 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) pHTInfo->IOTRaFunc = 0; { - u8 *RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]); + u8 *RegHTSuppRateSets = &ieee->RegHTSuppRateSet[0]; RegHTSuppRateSets[0] = 0xFF; RegHTSuppRateSets[1] = 0xFF; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: greybus: Remove unnecessary braces
This patch removes braces for single statement blocks. The warning was detected using checkpatch.pl. Coccinelle was used to make the change. @@ expression e,e1; @@ - if (e) { + if (e) e1; - } Signed-off-by: simran singhal --- drivers/staging/greybus/audio_manager_sysfs.c | 3 +-- drivers/staging/greybus/audio_topology.c | 9 +++-- drivers/staging/greybus/bootrom.c | 6 ++ drivers/staging/greybus/control.c | 3 +-- drivers/staging/greybus/es2.c | 3 +-- drivers/staging/greybus/gpio.c| 6 ++ drivers/staging/greybus/manifest.c| 3 +-- drivers/staging/greybus/module.c | 3 +-- drivers/staging/greybus/svc.c | 9 +++-- 9 files changed, 15 insertions(+), 30 deletions(-) diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c index 34ebd14..dc1d7a1 100644 --- a/drivers/staging/greybus/audio_manager_sysfs.c +++ b/drivers/staging/greybus/audio_manager_sysfs.c @@ -88,10 +88,9 @@ static void manager_sysfs_init_attribute( int err; err = sysfs_create_file(kobj, &kattr->attr); - if (err) { + if (err) pr_warn("creating the sysfs entry for %s failed: %d\n", kattr->attr.name, err); - } } void gb_audio_manager_sysfs_init(struct kobject *kobj) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 3001a49..0e02f00 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -327,10 +327,9 @@ static int gbcodec_mixer_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); - if (ret) { + if (ret) dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); - } return ret; } @@ -637,10 +636,9 @@ static int gbcodec_enum_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); - if (ret) { + if (ret) dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); - } return ret; } @@ -837,11 +835,10 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); - if (ret) { + if (ret) dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); - } for (wi = 0; wi < wlist->num_widgets; wi++) { widget = wlist->widgets[wi]; diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index 5f90721..0e01e2b 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -176,10 +176,9 @@ static int find_firmware(struct gb_bootrom *bootrom, u8 stage) rc = request_firmware(&bootrom->fw, firmware_name, &connection->bundle->dev); - if (rc) { + if (rc) dev_err(&connection->bundle->dev, "failed to find %s firmware (%d)\n", firmware_name, rc); - } return rc; } @@ -226,11 +225,10 @@ static int gb_bootrom_firmware_size_request(struct gb_operation *op) mutex_unlock(&bootrom->mutex); queue_work: - if (!ret) { + if (!ret) /* Refresh timeout */ gb_bootrom_set_timeout(bootrom, NEXT_REQ_GET_FIRMWARE, NEXT_REQ_TIMEOUT_MS); - } return ret; } diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c index 5b30be3..d8452c8 100644 --- a/drivers/staging/greybus/control.c +++ b/drivers/staging/greybus/control.c @@ -167,10 +167,9 @@ int gb_control_disconnecting_operation(struct gb_control *control, request->cport_id = cpu_to_le16(cport_id); ret = gb_operation_request_send_sync(operation); - if (ret) { + if (ret) dev_err(&control->dev, "failed to send disconnecting: %d\n", ret); - } gb_operation_put(operation); diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 93afd93..478eb53 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -1019,10 +1019,9 @@ static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload, spin_unlock_irqrestore(&es2->arpc_lock, flags); arpc_free(rpc); - if (retval < 0 && retval != -EREMOTEI
[PATCH v2 3/6] staging: greybus: Remove unnecessary braces
This patch removes braces for single statement blocks. The warning was detected using checkpatch.pl. Coccinelle was used to make the change. @@ expression e,e1; @@ - if (e) { + if (e) e1; - } Signed-off-by: simran singhal --- v2: -I forgot to cc outreachy mailing list drivers/staging/greybus/audio_manager_sysfs.c | 3 +-- drivers/staging/greybus/audio_topology.c | 9 +++-- drivers/staging/greybus/bootrom.c | 6 ++ drivers/staging/greybus/control.c | 3 +-- drivers/staging/greybus/es2.c | 3 +-- drivers/staging/greybus/gpio.c| 6 ++ drivers/staging/greybus/manifest.c| 3 +-- drivers/staging/greybus/module.c | 3 +-- drivers/staging/greybus/svc.c | 9 +++-- 9 files changed, 15 insertions(+), 30 deletions(-) diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c index 34ebd14..dc1d7a1 100644 --- a/drivers/staging/greybus/audio_manager_sysfs.c +++ b/drivers/staging/greybus/audio_manager_sysfs.c @@ -88,10 +88,9 @@ static void manager_sysfs_init_attribute( int err; err = sysfs_create_file(kobj, &kattr->attr); - if (err) { + if (err) pr_warn("creating the sysfs entry for %s failed: %d\n", kattr->attr.name, err); - } } void gb_audio_manager_sysfs_init(struct kobject *kobj) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 3001a49..0e02f00 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -327,10 +327,9 @@ static int gbcodec_mixer_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); - if (ret) { + if (ret) dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); - } return ret; } @@ -637,10 +636,9 @@ static int gbcodec_enum_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); - if (ret) { + if (ret) dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); - } return ret; } @@ -837,11 +835,10 @@ static int gbcodec_enum_dapm_ctl_put(struct snd_kcontrol *kcontrol, gb_pm_runtime_put_autosuspend(bundle); - if (ret) { + if (ret) dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret, __func__, kcontrol->id.name); - } for (wi = 0; wi < wlist->num_widgets; wi++) { widget = wlist->widgets[wi]; diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index 5f90721..0e01e2b 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -176,10 +176,9 @@ static int find_firmware(struct gb_bootrom *bootrom, u8 stage) rc = request_firmware(&bootrom->fw, firmware_name, &connection->bundle->dev); - if (rc) { + if (rc) dev_err(&connection->bundle->dev, "failed to find %s firmware (%d)\n", firmware_name, rc); - } return rc; } @@ -226,11 +225,10 @@ static int gb_bootrom_firmware_size_request(struct gb_operation *op) mutex_unlock(&bootrom->mutex); queue_work: - if (!ret) { + if (!ret) /* Refresh timeout */ gb_bootrom_set_timeout(bootrom, NEXT_REQ_GET_FIRMWARE, NEXT_REQ_TIMEOUT_MS); - } return ret; } diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c index 5b30be3..d8452c8 100644 --- a/drivers/staging/greybus/control.c +++ b/drivers/staging/greybus/control.c @@ -167,10 +167,9 @@ int gb_control_disconnecting_operation(struct gb_control *control, request->cport_id = cpu_to_le16(cport_id); ret = gb_operation_request_send_sync(operation); - if (ret) { + if (ret) dev_err(&control->dev, "failed to send disconnecting: %d\n", ret); - } gb_operation_put(operation); diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 93afd93..478eb53 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -1019,10 +1019,9 @@ static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload, spin_unlock_irqrestore(&es2->arpc_lock, flags); arpc_free(
[PATCH 4/6] staging: Drop useless initialisation
Removed initialisation of a varible if it is immediately reassigned. Changes were made using Coccinelle. @@ type T; constant C; expression e; identifier i; @@ T i - = C ; i = e; Signed-off-by: simran singhal --- drivers/staging/android/ion/ion_heap.c | 2 +- drivers/staging/gdm724x/gdm_lte.c | 2 +- drivers/staging/gdm724x/gdm_mux.c | 4 ++-- drivers/staging/iio/addac/adt7316-i2c.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_page.c| 2 +- drivers/staging/media/s5p-cec/exynos_hdmi_cecctrl.c | 2 +- drivers/staging/media/s5p-cec/s5p_cec.c | 2 +- drivers/staging/rtl8188eu/core/rtw_ap.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_efuse.c | 2 +- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_sreset.c | 2 +- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +- drivers/staging/rtl8188eu/hal/hal_intf.c| 2 +- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 +- drivers/staging/rtl8712/rtl8712_xmit.c | 2 +- drivers/staging/rtl8712/rtl871x_mp.c| 6 +++--- drivers/staging/rts5208/rtsx_chip.c | 2 +- drivers/staging/rts5208/sd.c| 4 ++-- drivers/staging/sm750fb/ddk750_chip.c | 2 +- drivers/staging/sm750fb/ddk750_power.c | 2 +- drivers/staging/speakup/speakup_ltlk.c | 2 +- drivers/staging/unisys/visorbus/visorchipset.c | 4 ++-- drivers/staging/wlan-ng/cfg80211.c | 2 +- drivers/staging/xgifb/XGI_main_26.c | 2 +- 28 files changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 4e5c0f1..4bd844b 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -270,7 +270,7 @@ static unsigned long ion_heap_shrink_count(struct shrinker *shrinker, { struct ion_heap *heap = container_of(shrinker, struct ion_heap, shrinker); - int total = 0; + int total; total = ion_heap_freelist_size(heap) / PAGE_SIZE; if (heap->ops->shrink) diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index a182757..e0f0912 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c @@ -353,7 +353,7 @@ static s32 gdm_lte_tx_nic_type(struct net_device *dev, struct sk_buff *skb) struct ipv6hdr *ipv6; int mac_proto; void *network_data; - u32 nic_type = 0; + u32 nic_type; /* NIC TYPE is based on the nic_id of this net_device */ nic_type = 0x0010 | nic->nic_id; diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index 4009691..aba32e2 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -62,7 +62,7 @@ static int packet_type_to_index(u16 packetType) static struct mux_tx *alloc_mux_tx(int len) { - struct mux_tx *t = NULL; + struct mux_tx *t; t = kzalloc(sizeof(*t), GFP_ATOMIC); if (!t) @@ -91,7 +91,7 @@ static void free_mux_tx(struct mux_tx *t) static struct mux_rx *alloc_mux_rx(void) { - struct mux_rx *r = NULL; + struct mux_rx *r; r = kzalloc(sizeof(*r), GFP_KERNEL); if (!r) diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c index f66dd3e..af56dba 100644 --- a/drivers/staging/iio/addac/adt7316-i2c.c +++ b/drivers/staging/iio/addac/adt7316-i2c.c @@ -41,7 +41,7 @@ static int adt7316_i2c_read(void *client, u8 reg, u8 *data) static int adt7316_i2c_write(void *client, u8 reg, u8 data) { struct i2c_client *cl = client; - int ret = 0; + int ret; ret = i2c_smbus_write_byte_data(cl, reg, data); if (ret < 0) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index c1f8693..9c1b1be 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -377,7 +377,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, } if (lvb_len > 0) { - int size = 0; + int size; size = req_capsule_get_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER); diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index cd9a40c..fdaebc3 10
[PATCH 5/6] staging: lustre: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 11 --- drivers/staging/lustre/lustre/ptlrpc/client.c | 3 +-- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 7f761b3..60264ed 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2058,7 +2058,7 @@ static int kiblnd_create_tx_pool(struct kib_poolset *ps, int size, tpo->tpo_tx_descs = NULL; tpo->tpo_tx_pages = NULL; - npg = (size * IBLND_MSG_SIZE + PAGE_SIZE - 1) / PAGE_SIZE; + npg = DIV_ROUND_UP(size * IBLND_MSG_SIZE, PAGE_SIZE); if (kiblnd_alloc_pages(&tpo->tpo_tx_pages, ps->ps_cpt, npg)) { CERROR("Can't allocate tx pages: %d\n", npg); LIBCFS_FREE(tpo, sizeof(*tpo)); diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index 994422c..afc514b 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -785,8 +785,7 @@ lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, struct test_bulk_req *brq = &req->tsr_u.bulk_v0; brq->blk_opc = param->blk_opc; - brq->blk_npg = (param->blk_size + PAGE_SIZE - 1) / - PAGE_SIZE; + brq->blk_npg = DIV_ROUND_UP(param->blk_size, PAGE_SIZE); brq->blk_flags = param->blk_flags; return 0; @@ -833,11 +832,9 @@ lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned int feats, trq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst; if (transop == LST_TRANS_TSBSRVADD) { - int ndist = (sgrp->grp_nnode + test->tes_dist - 1) / - test->tes_dist; - int nspan = (dgrp->grp_nnode + test->tes_span - 1) / - test->tes_span; - int nmax = (ndist + nspan - 1) / nspan; + int ndist = DIV_ROUND_UP(sgrp->grp_nnode, test->tes_dist); + int nspan = DIV_ROUND_UP(dgrp->grp_nnode, test->tes_span); + int nmax = DIV_ROUND_UP(ndist, nspan); trq->tsr_ndest = 0; trq->tsr_loop = nmax * test->tes_dist * test->tes_concur; diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 8047413..0d75fe7 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -3136,8 +3136,7 @@ void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req) * that server can infer the number of bulks that were prepared, * see LU-1431 */ - req->rq_mbits += ((bd->bd_iov_count + LNET_MAX_IOV - 1) / - LNET_MAX_IOV) - 1; + req->rq_mbits += (DIV_ROUND_UP(bd->bd_iov_count, LNET_MAX_IOV)) - 1; } /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c index da1209e..c2461c5 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c +++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c @@ -142,7 +142,7 @@ static int ptlrpc_register_bulk(struct ptlrpc_request *req) LASSERT(desc->bd_cbid.cbid_fn == client_bulk_callback); LASSERT(desc->bd_cbid.cbid_arg == desc); - total_md = (desc->bd_iov_count + LNET_MAX_IOV - 1) / LNET_MAX_IOV; + total_md = DIV_ROUND_UP(desc->bd_iov_count, LNET_MAX_IOV); /* rq_mbits is matchbits of the final bulk */ mbits = req->rq_mbits - total_md + 1; diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index 2fe9085..d43680c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -272,7 +272,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s, static inline int npages_to_npools(unsigned long npages) { - return (int)((npages + PAGES_PER_POOL - 1) / PAGES_PER_POOL); + return (int)(DIV_ROUND_UP(npages, PAGES_PER_POOL)); } /* -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: comedi: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal --- drivers/staging/comedi/drivers/addi_apci_3xxx.c | 2 +- drivers/staging/comedi/drivers/cb_pcidas64.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c index b6af3eb..82c2211 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c +++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c @@ -502,7 +502,7 @@ static int apci3xxx_ai_ns_to_timer(struct comedi_device *dev, timer = *ns / base; break; case CMDF_ROUND_UP: - timer = (*ns + base - 1) / base; + timer = DIV_ROUND_UP(*ns, base); break; } diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index efbf277..3b98193 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -2007,7 +2007,7 @@ static unsigned int get_divisor(unsigned int ns, unsigned int flags) switch (flags & CMDF_ROUND_MASK) { case CMDF_ROUND_UP: - divisor = (ns + TIMER_BASE - 1) / TIMER_BASE; + divisor = DIV_ROUND_UP(ns, TIMER_BASE); break; case CMDF_ROUND_DOWN: divisor = ns / TIMER_BASE; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging: vc04_services: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 2 +- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index e6241fb..e09731e 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -400,7 +400,7 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, dma_addr_t dma_addr; offset = ((unsigned int)(unsigned long)buf & (PAGE_SIZE - 1)); - num_pages = (count + offset + PAGE_SIZE - 1) / PAGE_SIZE; + num_pages = DIV_ROUND_UP(count + offset, PAGE_SIZE); pagelist_size = sizeof(PAGELIST_T) + (num_pages * sizeof(u32)) + diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 0525211..d0938de 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1557,7 +1557,7 @@ dump_phys_mem(void *virt_addr, u32 num_bytes) offset = (int)(long)virt_addr & (PAGE_SIZE - 1); end_offset = (int)(long)end_virt_addr & (PAGE_SIZE - 1); - num_pages = (offset + num_bytes + PAGE_SIZE - 1) / PAGE_SIZE; + num_pages = DIV_ROUND_UP(offset + num_bytes, PAGE_SIZE); pages = kmalloc(sizeof(struct page *) * num_pages, GFP_KERNEL); if (pages == NULL) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/7] staging: most: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal --- drivers/staging/most/hdm-dim2/dim2_hal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c b/drivers/staging/most/hdm-dim2/dim2_hal.c index 0b9816c..6824826 100644 --- a/drivers/staging/most/hdm-dim2/dim2_hal.c +++ b/drivers/staging/most/hdm-dim2/dim2_hal.c @@ -49,7 +49,7 @@ #define DBR_SIZE (16 * 1024) /* specified by IP */ #define DBR_BLOCK_SIZE (DBR_SIZE / 32 / DBR_MAP_SIZE) -#define ROUND_UP_TO(x, d) (((x) + (d) - 1) / (d) * (d)) +#define ROUND_UP_TO(x, d) (DIV_ROUND_UP(x, (d)) * (d)) /* -- */ /* generic helper functions and macros */ @@ -117,7 +117,7 @@ static int alloc_dbr(u16 size) return DBR_SIZE; /* out of memory */ for (i = 0; i < DBR_MAP_SIZE; i++) { - u32 const blocks = (size + DBR_BLOCK_SIZE - 1) / DBR_BLOCK_SIZE; + u32 const blocks = DIV_ROUND_UP(size, DBR_BLOCK_SIZE); u32 mask = ~((~(u32)0) << blocks); do { @@ -137,7 +137,7 @@ static int alloc_dbr(u16 size) static void free_dbr(int offs, int size) { int block_idx = offs / DBR_BLOCK_SIZE; - u32 const blocks = (size + DBR_BLOCK_SIZE - 1) / DBR_BLOCK_SIZE; + u32 const blocks = DIV_ROUND_UP(size, DBR_BLOCK_SIZE); u32 mask = ~((~(u32)0) << blocks); mask <<= block_idx % 32; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] staging: gdm724x: Drop useless initialisation
Removed initialisation of a varible if it is immediately reassigned. Changes were made using Coccinelle. @@ type T; constant C; expression e; identifier i; @@ T i - = C ; i = e; Signed-off-by: simran singhal --- drivers/staging/gdm724x/gdm_lte.c | 2 +- drivers/staging/gdm724x/gdm_mux.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c index a182757..e0f0912 100644 --- a/drivers/staging/gdm724x/gdm_lte.c +++ b/drivers/staging/gdm724x/gdm_lte.c @@ -353,7 +353,7 @@ static s32 gdm_lte_tx_nic_type(struct net_device *dev, struct sk_buff *skb) struct ipv6hdr *ipv6; int mac_proto; void *network_data; - u32 nic_type = 0; + u32 nic_type; /* NIC TYPE is based on the nic_id of this net_device */ nic_type = 0x0010 | nic->nic_id; diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c index 4009691..aba32e2 100644 --- a/drivers/staging/gdm724x/gdm_mux.c +++ b/drivers/staging/gdm724x/gdm_mux.c @@ -62,7 +62,7 @@ static int packet_type_to_index(u16 packetType) static struct mux_tx *alloc_mux_tx(int len) { - struct mux_tx *t = NULL; + struct mux_tx *t; t = kzalloc(sizeof(*t), GFP_ATOMIC); if (!t) @@ -91,7 +91,7 @@ static void free_mux_tx(struct mux_tx *t) static struct mux_rx *alloc_mux_rx(void) { - struct mux_rx *r = NULL; + struct mux_rx *r; r = kzalloc(sizeof(*r), GFP_KERNEL); if (!r) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/7] staging: most: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal --- v2: -Included kernel.h as DIV_ROUND_UP is defined in it, before it was giving compilation error. drivers/staging/most/hdm-dim2/dim2_hal.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c b/drivers/staging/most/hdm-dim2/dim2_hal.c index 0b9816c..d604ec09 100644 --- a/drivers/staging/most/hdm-dim2/dim2_hal.c +++ b/drivers/staging/most/hdm-dim2/dim2_hal.c @@ -18,6 +18,7 @@ #include "dim2_errors.h" #include "dim2_reg.h" #include +#include /* * Size factor for isochronous DBR buffer. @@ -49,7 +50,7 @@ #define DBR_SIZE (16 * 1024) /* specified by IP */ #define DBR_BLOCK_SIZE (DBR_SIZE / 32 / DBR_MAP_SIZE) -#define ROUND_UP_TO(x, d) (((x) + (d) - 1) / (d) * (d)) +#define ROUND_UP_TO(x, d) (DIV_ROUND_UP(x, (d)) * (d)) /* -- */ /* generic helper functions and macros */ @@ -117,7 +118,7 @@ static int alloc_dbr(u16 size) return DBR_SIZE; /* out of memory */ for (i = 0; i < DBR_MAP_SIZE; i++) { - u32 const blocks = (size + DBR_BLOCK_SIZE - 1) / DBR_BLOCK_SIZE; + u32 const blocks = DIV_ROUND_UP(size, DBR_BLOCK_SIZE); u32 mask = ~((~(u32)0) << blocks); do { @@ -137,7 +138,7 @@ static int alloc_dbr(u16 size) static void free_dbr(int offs, int size) { int block_idx = offs / DBR_BLOCK_SIZE; - u32 const blocks = (size + DBR_BLOCK_SIZE - 1) / DBR_BLOCK_SIZE; + u32 const blocks = DIV_ROUND_UP(size, DBR_BLOCK_SIZE); u32 mask = ~((~(u32)0) << blocks); mask <<= block_idx % 32; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 5/6] staging: lustre: Using macro DIV_ROUND_UP
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1)) / (e2) + DIV_ROUND_UP(e1,e2) ) Signed-off-by: simran singhal --- v2: -Removed unnecessary parantheses from the right side of assignment. drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 11 --- drivers/staging/lustre/lustre/ptlrpc/client.c | 3 +-- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 7f761b3..60264ed 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2058,7 +2058,7 @@ static int kiblnd_create_tx_pool(struct kib_poolset *ps, int size, tpo->tpo_tx_descs = NULL; tpo->tpo_tx_pages = NULL; - npg = (size * IBLND_MSG_SIZE + PAGE_SIZE - 1) / PAGE_SIZE; + npg = DIV_ROUND_UP(size * IBLND_MSG_SIZE, PAGE_SIZE); if (kiblnd_alloc_pages(&tpo->tpo_tx_pages, ps->ps_cpt, npg)) { CERROR("Can't allocate tx pages: %d\n", npg); LIBCFS_FREE(tpo, sizeof(*tpo)); diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index 994422c..afc514b 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -785,8 +785,7 @@ lstcon_bulkrpc_v0_prep(lst_test_bulk_param_t *param, struct test_bulk_req *brq = &req->tsr_u.bulk_v0; brq->blk_opc = param->blk_opc; - brq->blk_npg = (param->blk_size + PAGE_SIZE - 1) / - PAGE_SIZE; + brq->blk_npg = DIV_ROUND_UP(param->blk_size, PAGE_SIZE); brq->blk_flags = param->blk_flags; return 0; @@ -833,11 +832,9 @@ lstcon_testrpc_prep(struct lstcon_node *nd, int transop, unsigned int feats, trq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.tes_reqst; if (transop == LST_TRANS_TSBSRVADD) { - int ndist = (sgrp->grp_nnode + test->tes_dist - 1) / - test->tes_dist; - int nspan = (dgrp->grp_nnode + test->tes_span - 1) / - test->tes_span; - int nmax = (ndist + nspan - 1) / nspan; + int ndist = DIV_ROUND_UP(sgrp->grp_nnode, test->tes_dist); + int nspan = DIV_ROUND_UP(dgrp->grp_nnode, test->tes_span); + int nmax = DIV_ROUND_UP(ndist, nspan); trq->tsr_ndest = 0; trq->tsr_loop = nmax * test->tes_dist * test->tes_concur; diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 8047413..5214e68 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -3136,8 +3136,7 @@ void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req) * that server can infer the number of bulks that were prepared, * see LU-1431 */ - req->rq_mbits += ((bd->bd_iov_count + LNET_MAX_IOV - 1) / - LNET_MAX_IOV) - 1; + req->rq_mbits += DIV_ROUND_UP(bd->bd_iov_count, LNET_MAX_IOV) - 1; } /** diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c index da1209e..c2461c5 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c +++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c @@ -142,7 +142,7 @@ static int ptlrpc_register_bulk(struct ptlrpc_request *req) LASSERT(desc->bd_cbid.cbid_fn == client_bulk_callback); LASSERT(desc->bd_cbid.cbid_arg == desc); - total_md = (desc->bd_iov_count + LNET_MAX_IOV - 1) / LNET_MAX_IOV; + total_md = DIV_ROUND_UP(desc->bd_iov_count, LNET_MAX_IOV); /* rq_mbits is matchbits of the final bulk */ mbits = req->rq_mbits - total_md + 1; diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index 2fe9085..128838a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -272,7 +272,7 @@ static unsigned long enc_pools_shrink_scan(struct shrinker *s, static inline int npages_to_npools(unsigned long npages) { - return (int)((npages + PAGES_PER_POOL - 1) / PAGES_PER_POOL); + return (int)DIV_ROUND_UP(npages, PAGES_PER_POOL); } /* -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 6/6] staging: rtl8192e: Removed unnecessary parentheses
On Fri, Feb 24, 2017 at 10:47 PM, Greg KH wrote: > On Mon, Feb 20, 2017 at 10:41:47PM +0530, simran singhal wrote: >> Extra parentheses were causing checkpatch issues >> and were removed. >> >> Signed-off-by: simran singhal >> --- >> >> v2: >>-Removed parentheses around argument of cast >>-Removed cast > > I can't keep track of random patches in the middle of a series that is > updated. > > Please fix up and resend the whole series, as a series, that are linked > together in an email client, not as independent emails (i.e. use > git-send-email properly). I am using mutt for sending patches. In mutt I have to send each patch of a particular patch series one by one. So, they come as independent emails. And, they all get mix because of the reason, if I started sending new patch series and at the same time sending new versions of patches of previous patch series, so because of which their order changes. So, please suggest me some better way, considering I am using mutt. Thanks, Simran SInghal > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: lustre: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally useful after a break or return. @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: simran singhal --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c | 3 +-- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index fbbd8a5..02d49b7 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -1806,8 +1806,7 @@ ksocknal_close_matching_conns(struct lnet_process_id id, __u32 ipaddr) if (!count) return -ENOENT; - else - return 0; + return 0; } void diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index cf3fc57..ac32c82 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -338,8 +338,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl, if (nr == 0) return (unused / 100) * sysctl_vfs_cache_pressure; - else - return ldlm_cancel_lru(ns, nr, LCF_ASYNC, LDLM_LRU_FLAG_SHRINK); + return ldlm_cancel_lru(ns, nr, LCF_ASYNC, LDLM_LRU_FLAG_SHRINK); } static const struct ldlm_pool_ops ldlm_cli_pool_ops = { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: rtl8712: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: simran singhal --- drivers/staging/rtl8712/os_intfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 8836b31..3062167 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -411,8 +411,7 @@ static int netdev_open(struct net_device *pnetdev) goto netdev_open_error; if (!padapter->dvobjpriv.inirp_init) goto netdev_open_error; - else - padapter->dvobjpriv.inirp_init(padapter); + padapter->dvobjpriv.inirp_init(padapter); r8712_set_ps_mode(padapter, padapter->registrypriv.power_mgnt, padapter->registrypriv.smart_ps); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging: rtl8192u: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index 2453413..4d6c928 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c @@ -374,8 +374,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) if (!tcb_desc->bHwSec) return ret; - else - return 0; + return 0; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: sm750fb: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: simran singhal --- drivers/staging/sm750fb/ddk750_sii164.c | 6 ++ drivers/staging/sm750fb/ddk750_swi2c.c | 6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 259006a..6906598 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -368,8 +368,7 @@ unsigned char sii164IsConnected(void) hotPlugValue = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & SII164_DETECT_HOT_PLUG_STATUS_MASK; if (hotPlugValue == SII164_DETECT_HOT_PLUG_STATUS_ON) return 1; - else - return 0; + return 0; } /* @@ -387,8 +386,7 @@ unsigned char sii164CheckInterrupt(void) detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & SII164_DETECT_MONITOR_STATE_MASK; if (detectReg == SII164_DETECT_MONITOR_STATE_CHANGE) return 1; - else - return 0; + return 0; } /* diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c index a4ac07c..5997349 100644 --- a/drivers/staging/sm750fb/ddk750_swi2c.c +++ b/drivers/staging/sm750fb/ddk750_swi2c.c @@ -199,8 +199,7 @@ static unsigned char sw_i2c_read_sda(void) gpio_data = peek32(sw_i2c_data_gpio_data_reg); if (gpio_data & (1 << sw_i2c_data_gpio)) return 1; - else - return 0; + return 0; } /* @@ -295,8 +294,7 @@ static long sw_i2c_write_byte(unsigned char data) if (i < 0xff) return 0; - else - return -1; + return -1; } /* -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging: gdm724x: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: simran singhal --- drivers/staging/gdm724x/gdm_endian.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_endian.c b/drivers/staging/gdm724x/gdm_endian.c index d0b43e2..4ef728f 100644 --- a/drivers/staging/gdm724x/gdm_endian.c +++ b/drivers/staging/gdm724x/gdm_endian.c @@ -26,30 +26,26 @@ __dev16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x) { if (ed->dev_ed == ENDIANNESS_LITTLE) return (__force __dev16)cpu_to_le16(x); - else - return (__force __dev16)cpu_to_be16(x); + return (__force __dev16)cpu_to_be16(x); } u16 gdm_dev16_to_cpu(struct gdm_endian *ed, __dev16 x) { if (ed->dev_ed == ENDIANNESS_LITTLE) return le16_to_cpu((__force __le16)x); - else - return be16_to_cpu((__force __be16)x); + return be16_to_cpu((__force __be16)x); } __dev32 gdm_cpu_to_dev32(struct gdm_endian *ed, u32 x) { if (ed->dev_ed == ENDIANNESS_LITTLE) return (__force __dev32)cpu_to_le32(x); - else - return (__force __dev32)cpu_to_be32(x); + return (__force __dev32)cpu_to_be32(x); } u32 gdm_dev32_to_cpu(struct gdm_endian *ed, __dev32 x) { if (ed->dev_ed == ENDIANNESS_LITTLE) return le32_to_cpu((__force __le32)x); - else - return be32_to_cpu((__force __be32)x); + return be32_to_cpu((__force __be32)x); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: iio: accel: Move header file content to source file
The contents of the header file are used only by this single source file. Move content into .c and remove .h. Signed-off-by: simran singhal --- drivers/staging/iio/accel/adis16201.h | 144 drivers/staging/iio/accel/adis16201_core.c | 145 - 2 files changed, 144 insertions(+), 145 deletions(-) delete mode 100644 drivers/staging/iio/accel/adis16201.h diff --git a/drivers/staging/iio/accel/adis16201.h b/drivers/staging/iio/accel/adis16201.h deleted file mode 100644 index 64844ad..000 --- a/drivers/staging/iio/accel/adis16201.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef SPI_ADIS16201_H_ -#define SPI_ADIS16201_H_ - -#define ADIS16201_STARTUP_DELAY220 /* ms */ - -/* Flash memory write count */ -#define ADIS16201_FLASH_CNT 0x00 - -/* Output, power supply */ -#define ADIS16201_SUPPLY_OUT 0x02 - -/* Output, x-axis accelerometer */ -#define ADIS16201_XACCL_OUT 0x04 - -/* Output, y-axis accelerometer */ -#define ADIS16201_YACCL_OUT 0x06 - -/* Output, auxiliary ADC input */ -#define ADIS16201_AUX_ADC0x08 - -/* Output, temperature */ -#define ADIS16201_TEMP_OUT 0x0A - -/* Output, x-axis inclination */ -#define ADIS16201_XINCL_OUT 0x0C - -/* Output, y-axis inclination */ -#define ADIS16201_YINCL_OUT 0x0E - -/* Calibration, x-axis acceleration offset */ -#define ADIS16201_XACCL_OFFS 0x10 - -/* Calibration, y-axis acceleration offset */ -#define ADIS16201_YACCL_OFFS 0x12 - -/* x-axis acceleration scale factor */ -#define ADIS16201_XACCL_SCALE0x14 - -/* y-axis acceleration scale factor */ -#define ADIS16201_YACCL_SCALE0x16 - -/* Calibration, x-axis inclination offset */ -#define ADIS16201_XINCL_OFFS 0x18 - -/* Calibration, y-axis inclination offset */ -#define ADIS16201_YINCL_OFFS 0x1A - -/* x-axis inclination scale factor */ -#define ADIS16201_XINCL_SCALE0x1C - -/* y-axis inclination scale factor */ -#define ADIS16201_YINCL_SCALE0x1E - -/* Alarm 1 amplitude threshold */ -#define ADIS16201_ALM_MAG1 0x20 - -/* Alarm 2 amplitude threshold */ -#define ADIS16201_ALM_MAG2 0x22 - -/* Alarm 1, sample period */ -#define ADIS16201_ALM_SMPL1 0x24 - -/* Alarm 2, sample period */ -#define ADIS16201_ALM_SMPL2 0x26 - -/* Alarm control */ -#define ADIS16201_ALM_CTRL 0x28 - -/* Auxiliary DAC data */ -#define ADIS16201_AUX_DAC0x30 - -/* General-purpose digital input/output control */ -#define ADIS16201_GPIO_CTRL 0x32 - -/* Miscellaneous control */ -#define ADIS16201_MSC_CTRL 0x34 - -/* Internal sample period (rate) control */ -#define ADIS16201_SMPL_PRD 0x36 - -/* Operation, filter configuration */ -#define ADIS16201_AVG_CNT0x38 - -/* Operation, sleep mode control */ -#define ADIS16201_SLP_CNT0x3A - -/* Diagnostics, system status register */ -#define ADIS16201_DIAG_STAT 0x3C - -/* Operation, system command register */ -#define ADIS16201_GLOB_CMD 0x3E - -/* MSC_CTRL */ - -/* Self-test enable */ -#define ADIS16201_MSC_CTRL_SELF_TEST_ENBIT(8) - -/* Data-ready enable: 1 = enabled, 0 = disabled */ -#define ADIS16201_MSC_CTRL_DATA_RDY_EN BIT(2) - -/* Data-ready polarity: 1 = active high, 0 = active low */ -#define ADIS16201_MSC_CTRL_ACTIVE_HIGH BIT(1) - -/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */ -#define ADIS16201_MSC_CTRL_DATA_RDY_DIO1 BIT(0) - -/* DIAG_STAT */ - -/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */ -#define ADIS16201_DIAG_STAT_ALARM2BIT(9) - -/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */ -#define ADIS16201_DIAG_STAT_ALARM1BIT(8) - -/* SPI communications failure */ -#define ADIS16201_DIAG_STAT_SPI_FAIL_BIT 3 - -/* Flash update failure */ -#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT 2 - -/* Power supply above 3.625 V */ -#define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1 - -/* Power supply below 3.15 V */ -#define ADIS16201_DIAG_STAT_POWER_LOW_BIT 0 - -/* GLOB_CMD */ - -#define ADIS16201_GLOB_CMD_SW_RESETBIT(7) -#define ADIS16201_GLOB_CMD_FACTORY_CAL BIT(1) - -#define ADIS16201_ERROR_ACTIVE BIT(14) - -enum adis16201_scan { - ADIS16201_SCAN_ACC_X, - ADIS16201_SCAN_ACC_Y, - ADIS16201_SCAN_INCLI_X, - ADIS16201_SCAN_INCLI_Y, - ADIS16201_SCAN_SUPPLY, - ADIS16201_SCAN_AUX_ADC, - ADIS16201_SCAN_TEMP, -}; - -#endif /* SPI_ADIS16201_H_ */ diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index 7963d4a..210699e 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c @@ -20,7 +20,150 @@ #include #include -#include "adis16201.h" +#ifndef SPI_ADIS16201_H_ +#define SPI_ADIS16201_H_ + +#define ADIS16201_STARTUP_DELAY220 /* ms */ + +/* Flash memory write count */ +#define ADIS16201_FLASH_CNT 0x00 + +/* Output, power supply */ +#define ADIS16201_SUPPLY_OU
Re: [PATCH 5/5] staging: gdm724x: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 1:11 AM, Joe Perches wrote: > On Mon, 2017-02-27 at 23:44 +0530, simran singhal wrote: >> This patch fixes the checkpatch warning that else is not generally >> useful after a break or return. > >> This was done using Coccinelle: >> @@ >> expression e2; >> statement s1; >> @@ >> if(e2) { ... return ...; } >> -else >> s1 > [] >> diff --git a/drivers/staging/gdm724x/gdm_endian.c >> b/drivers/staging/gdm724x/gdm_endian.c > [] >> @@ -26,30 +26,26 @@ __dev16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x) >> { >> if (ed->dev_ed == ENDIANNESS_LITTLE) >> return (__force __dev16)cpu_to_le16(x); >> - else >> - return (__force __dev16)cpu_to_be16(x); >> + return (__force __dev16)cpu_to_be16(x); > > again, not a checkpatch message for any of the > suggested modified hunks. > So, I have to change commit message. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/5] staging: lustre: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 12:55 AM, Joe Perches wrote: > On Mon, 2017-02-27 at 23:44 +0530, simran singhal wrote: >> This patch fixes the checkpatch warning that else is not generally >> useful after a break or return. > > checkpatch doesn't actually warn for this style > > if (foo) > return bar; > else > return baz; > ok, My bad so, I have to change commit message as checkpatch doesn't warn for this style. >> @@ >> expression e2; >> statement s1; >> @@ >> if(e2) { ... return ...; } >> -else >> s1 >> >> Signed-off-by: simran singhal >> --- >> drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c | 3 +-- >> drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 3 +-- >> 2 files changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c >> b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c >> index fbbd8a5..02d49b7 100644 >> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c >> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c >> @@ -1806,8 +1806,7 @@ ksocknal_close_matching_conns(struct lnet_process_id >> id, __u32 ipaddr) >> >> if (!count) >> return -ENOENT; >> - else >> - return 0; >> + return 0; >> } >> >> void >> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >> b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >> index cf3fc57..ac32c82 100644 >> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c >> @@ -338,8 +338,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl, >> >> if (nr == 0) >> return (unused / 100) * sysctl_vfs_cache_pressure; >> - else >> - return ldlm_cancel_lru(ns, nr, LCF_ASYNC, >> LDLM_LRU_FLAG_SHRINK); >> + return ldlm_cancel_lru(ns, nr, LCF_ASYNC, LDLM_LRU_FLAG_SHRINK); >> } >> >> static const struct ldlm_pool_ops ldlm_cli_pool_ops = { ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/5] staging: sm750fb: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 1:01 AM, Joe Perches wrote: > On Mon, 2017-02-27 at 23:44 +0530, simran singhal wrote: >> This patch fixes the checkpatch warning that else is not generally >> useful after a break or return. > [] >> diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c >> b/drivers/staging/sm750fb/ddk750_swi2c.c > [] >> @@ -295,8 +294,7 @@ static long sw_i2c_write_byte(unsigned char data) >> >> if (i < 0xff) >> return 0; >> - else >> - return -1; >> + return -1; > > Assuming -1 is some sort of error, > it'd be a more common style to use > > if (i >= 0xff) > return -1; > > return 0; > > Looking at the code, it might make > sense to use something like: > > /* SDA still != 0 */ > if (i >= 0xff) > return -1; > > return 0; > } I will send v2. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: iio: accel: Move header file content to source file
The contents of the header file are used only by this single source file. Move content into .c and remove .h. Signed-off-by: simran singhal --- v2: -Removing ifndef and define drivers/staging/iio/accel/adis16201.h | 144 - drivers/staging/iio/accel/adis16201_core.c | 142 +++- 2 files changed, 141 insertions(+), 145 deletions(-) delete mode 100644 drivers/staging/iio/accel/adis16201.h diff --git a/drivers/staging/iio/accel/adis16201.h b/drivers/staging/iio/accel/adis16201.h deleted file mode 100644 index 64844ad..000 --- a/drivers/staging/iio/accel/adis16201.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef SPI_ADIS16201_H_ -#define SPI_ADIS16201_H_ - -#define ADIS16201_STARTUP_DELAY220 /* ms */ - -/* Flash memory write count */ -#define ADIS16201_FLASH_CNT 0x00 - -/* Output, power supply */ -#define ADIS16201_SUPPLY_OUT 0x02 - -/* Output, x-axis accelerometer */ -#define ADIS16201_XACCL_OUT 0x04 - -/* Output, y-axis accelerometer */ -#define ADIS16201_YACCL_OUT 0x06 - -/* Output, auxiliary ADC input */ -#define ADIS16201_AUX_ADC0x08 - -/* Output, temperature */ -#define ADIS16201_TEMP_OUT 0x0A - -/* Output, x-axis inclination */ -#define ADIS16201_XINCL_OUT 0x0C - -/* Output, y-axis inclination */ -#define ADIS16201_YINCL_OUT 0x0E - -/* Calibration, x-axis acceleration offset */ -#define ADIS16201_XACCL_OFFS 0x10 - -/* Calibration, y-axis acceleration offset */ -#define ADIS16201_YACCL_OFFS 0x12 - -/* x-axis acceleration scale factor */ -#define ADIS16201_XACCL_SCALE0x14 - -/* y-axis acceleration scale factor */ -#define ADIS16201_YACCL_SCALE0x16 - -/* Calibration, x-axis inclination offset */ -#define ADIS16201_XINCL_OFFS 0x18 - -/* Calibration, y-axis inclination offset */ -#define ADIS16201_YINCL_OFFS 0x1A - -/* x-axis inclination scale factor */ -#define ADIS16201_XINCL_SCALE0x1C - -/* y-axis inclination scale factor */ -#define ADIS16201_YINCL_SCALE0x1E - -/* Alarm 1 amplitude threshold */ -#define ADIS16201_ALM_MAG1 0x20 - -/* Alarm 2 amplitude threshold */ -#define ADIS16201_ALM_MAG2 0x22 - -/* Alarm 1, sample period */ -#define ADIS16201_ALM_SMPL1 0x24 - -/* Alarm 2, sample period */ -#define ADIS16201_ALM_SMPL2 0x26 - -/* Alarm control */ -#define ADIS16201_ALM_CTRL 0x28 - -/* Auxiliary DAC data */ -#define ADIS16201_AUX_DAC0x30 - -/* General-purpose digital input/output control */ -#define ADIS16201_GPIO_CTRL 0x32 - -/* Miscellaneous control */ -#define ADIS16201_MSC_CTRL 0x34 - -/* Internal sample period (rate) control */ -#define ADIS16201_SMPL_PRD 0x36 - -/* Operation, filter configuration */ -#define ADIS16201_AVG_CNT0x38 - -/* Operation, sleep mode control */ -#define ADIS16201_SLP_CNT0x3A - -/* Diagnostics, system status register */ -#define ADIS16201_DIAG_STAT 0x3C - -/* Operation, system command register */ -#define ADIS16201_GLOB_CMD 0x3E - -/* MSC_CTRL */ - -/* Self-test enable */ -#define ADIS16201_MSC_CTRL_SELF_TEST_ENBIT(8) - -/* Data-ready enable: 1 = enabled, 0 = disabled */ -#define ADIS16201_MSC_CTRL_DATA_RDY_EN BIT(2) - -/* Data-ready polarity: 1 = active high, 0 = active low */ -#define ADIS16201_MSC_CTRL_ACTIVE_HIGH BIT(1) - -/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */ -#define ADIS16201_MSC_CTRL_DATA_RDY_DIO1 BIT(0) - -/* DIAG_STAT */ - -/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */ -#define ADIS16201_DIAG_STAT_ALARM2BIT(9) - -/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */ -#define ADIS16201_DIAG_STAT_ALARM1BIT(8) - -/* SPI communications failure */ -#define ADIS16201_DIAG_STAT_SPI_FAIL_BIT 3 - -/* Flash update failure */ -#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT 2 - -/* Power supply above 3.625 V */ -#define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1 - -/* Power supply below 3.15 V */ -#define ADIS16201_DIAG_STAT_POWER_LOW_BIT 0 - -/* GLOB_CMD */ - -#define ADIS16201_GLOB_CMD_SW_RESETBIT(7) -#define ADIS16201_GLOB_CMD_FACTORY_CAL BIT(1) - -#define ADIS16201_ERROR_ACTIVE BIT(14) - -enum adis16201_scan { - ADIS16201_SCAN_ACC_X, - ADIS16201_SCAN_ACC_Y, - ADIS16201_SCAN_INCLI_X, - ADIS16201_SCAN_INCLI_Y, - ADIS16201_SCAN_SUPPLY, - ADIS16201_SCAN_AUX_ADC, - ADIS16201_SCAN_TEMP, -}; - -#endif /* SPI_ADIS16201_H_ */ diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index 7963d4a..dcf8463 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c @@ -20,7 +20,147 @@ #include #include -#include "adis16201.h" +#define ADIS16201_STARTUP_DELAY220 /* ms */ + +/* Flash memory write count */ +#define ADIS16201_FLASH_CNT 0x00 + +/* Output, power supply */ +#define ADIS16201_SUPPLY_OUT 0x02 + +/*
Re: [Outreachy kernel] [PATCH 4/5] staging: sm750fb: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 2:45 AM, Julia Lawall wrote: > > > On Mon, 27 Feb 2017, simran singhal wrote: > >> This patch fixes the checkpatch warning that else is not generally >> useful after a break or return. >> >> This was done using Coccinelle: >> @@ >> expression e2; >> statement s1; >> @@ >> if(e2) { ... return ...; } >> -else >> s1 >> >> Signed-off-by: simran singhal >> --- >> drivers/staging/sm750fb/ddk750_sii164.c | 6 ++ >> drivers/staging/sm750fb/ddk750_swi2c.c | 6 ++ >> 2 files changed, 4 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c >> b/drivers/staging/sm750fb/ddk750_sii164.c >> index 259006a..6906598 100644 >> --- a/drivers/staging/sm750fb/ddk750_sii164.c >> +++ b/drivers/staging/sm750fb/ddk750_sii164.c >> @@ -368,8 +368,7 @@ unsigned char sii164IsConnected(void) >> hotPlugValue = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & >> SII164_DETECT_HOT_PLUG_STATUS_MASK; >> if (hotPlugValue == SII164_DETECT_HOT_PLUG_STATUS_ON) >> return 1; >> - else >> - return 0; >> + return 0; > > > Totally unrelated to what you are doing, but I wonder if these return > values should be true and false? Perhaps it would help to see how the > return values are used at the calling context. > you want me to go ahead with what Joe mentioned and also do the same changes here also. > julia > >> } >> >> /* >> @@ -387,8 +386,7 @@ unsigned char sii164CheckInterrupt(void) >> detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & >> SII164_DETECT_MONITOR_STATE_MASK; >> if (detectReg == SII164_DETECT_MONITOR_STATE_CHANGE) >> return 1; >> - else >> - return 0; >> + return 0; >> } >> >> /* >> diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c >> b/drivers/staging/sm750fb/ddk750_swi2c.c >> index a4ac07c..5997349 100644 >> --- a/drivers/staging/sm750fb/ddk750_swi2c.c >> +++ b/drivers/staging/sm750fb/ddk750_swi2c.c >> @@ -199,8 +199,7 @@ static unsigned char sw_i2c_read_sda(void) >> gpio_data = peek32(sw_i2c_data_gpio_data_reg); >> if (gpio_data & (1 << sw_i2c_data_gpio)) >> return 1; >> - else >> - return 0; >> + return 0; >> } >> >> /* >> @@ -295,8 +294,7 @@ static long sw_i2c_write_byte(unsigned char data) >> >> if (i < 0xff) >> return 0; >> - else >> - return -1; >> + return -1; >> } >> >> /* >> -- >> 2.7.4 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "outreachy-kernel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to outreachy-kernel+unsubscr...@googlegroups.com. >> To post to this group, send email to outreachy-ker...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/outreachy-kernel/1488219268-3006-4-git-send-email-singhalsimran0%40gmail.com. >> For more options, visit https://groups.google.com/d/optout. >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/5] staging: lustre: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 2:13 AM, Joe Perches wrote: > On Tue, 2017-02-28 at 01:51 +0530, SIMRAN SINGHAL wrote: >> On Tue, Feb 28, 2017 at 12:55 AM, Joe Perches wrote: >> > On Mon, 2017-02-27 at 23:44 +0530, simran singhal wrote: >> > > This patch fixes the checkpatch warning that else is not generally >> > > useful after a break or return. >> > >> > checkpatch doesn't actually warn for this style >> > >> > if (foo) >> > return bar; >> > else >> > return baz; >> > >> >> ok, My bad >> so, I have to change commit message as checkpatch doesn't warn for this >> style. > > Perhaps better would be to leave them unchanged instead. > >> > > diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c >> > > b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c > [] >> > > @@ -1806,8 +1806,7 @@ ksocknal_close_matching_conns(struct >> > > lnet_process_id id, __u32 ipaddr) >> > > >> > > if (!count) >> > > return -ENOENT; >> > > - else >> > > - return 0; >> > > + return 0; > > There might be a case for this one. > error returns are generally in the form > > { > [...] > > err = func(...); > if (err < 0) > return err; > > return 0; > } Not sure, what's the problem in removing else as according to me there is no use of else. In this case if (if condition) does not satisfy then else condition will be satisfied and function will return 0. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 4/5] staging: sm750fb: Remove unnecessary else after return
On Wed, Mar 1, 2017 at 12:30 AM, Julia Lawall wrote: > > > On Wed, 1 Mar 2017, SIMRAN SINGHAL wrote: > >> On Tue, Feb 28, 2017 at 2:45 AM, Julia Lawall wrote: >> > >> > >> > On Mon, 27 Feb 2017, simran singhal wrote: >> > >> >> This patch fixes the checkpatch warning that else is not generally >> >> useful after a break or return. >> >> >> >> This was done using Coccinelle: >> >> @@ >> >> expression e2; >> >> statement s1; >> >> @@ >> >> if(e2) { ... return ...; } >> >> -else >> >> s1 >> >> >> >> Signed-off-by: simran singhal >> >> --- >> >> drivers/staging/sm750fb/ddk750_sii164.c | 6 ++ >> >> drivers/staging/sm750fb/ddk750_swi2c.c | 6 ++ >> >> 2 files changed, 4 insertions(+), 8 deletions(-) >> >> >> >> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c >> >> b/drivers/staging/sm750fb/ddk750_sii164.c >> >> index 259006a..6906598 100644 >> >> --- a/drivers/staging/sm750fb/ddk750_sii164.c >> >> +++ b/drivers/staging/sm750fb/ddk750_sii164.c >> >> @@ -368,8 +368,7 @@ unsigned char sii164IsConnected(void) >> >> hotPlugValue = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & >> >> SII164_DETECT_HOT_PLUG_STATUS_MASK; >> >> if (hotPlugValue == SII164_DETECT_HOT_PLUG_STATUS_ON) >> >> return 1; >> >> - else >> >> - return 0; >> >> + return 0; >> > >> > >> > Totally unrelated to what you are doing, but I wonder if these return >> > values should be true and false? Perhaps it would help to see how the >> > return values are used at the calling context. >> > >> you want me to go ahead with what Joe mentioned and also do the same >> changes here also. > > I think that it would be best to complete what you have underway already. > When those patches are picked up by Greg, you can look into the > possibility of using true and false. > Thanks, so for now I can ignore this. > julia > >> > julia >> > >> >> } >> >> >> >> /* >> >> @@ -387,8 +386,7 @@ unsigned char sii164CheckInterrupt(void) >> >> detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & >> >> SII164_DETECT_MONITOR_STATE_MASK; >> >> if (detectReg == SII164_DETECT_MONITOR_STATE_CHANGE) >> >> return 1; >> >> - else >> >> - return 0; >> >> + return 0; >> >> } >> >> >> >> /* >> >> diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c >> >> b/drivers/staging/sm750fb/ddk750_swi2c.c >> >> index a4ac07c..5997349 100644 >> >> --- a/drivers/staging/sm750fb/ddk750_swi2c.c >> >> +++ b/drivers/staging/sm750fb/ddk750_swi2c.c >> >> @@ -199,8 +199,7 @@ static unsigned char sw_i2c_read_sda(void) >> >> gpio_data = peek32(sw_i2c_data_gpio_data_reg); >> >> if (gpio_data & (1 << sw_i2c_data_gpio)) >> >> return 1; >> >> - else >> >> - return 0; >> >> + return 0; >> >> } >> >> >> >> /* >> >> @@ -295,8 +294,7 @@ static long sw_i2c_write_byte(unsigned char data) >> >> >> >> if (i < 0xff) >> >> return 0; >> >> - else >> >> - return -1; >> >> + return -1; >> >> } >> >> >> >> /* >> >> -- >> >> 2.7.4 >> >> >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> >> "outreachy-kernel" group. >> >> To unsubscribe from this group and stop receiving emails from it, send an >> >> email to outreachy-kernel+unsubscr...@googlegroups.com. >> >> To post to this group, send email to outreachy-ker...@googlegroups.com. >> >> To view this discussion on the web visit >> >> https://groups.google.com/d/msgid/outreachy-kernel/1488219268-3006-4-git-send-email-singhalsimran0%40gmail.com. >> >> For more options, visit https://groups.google.com/d/optout. >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "outreachy-kernel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to outreachy-kernel+unsubscr...@googlegroups.com. >> To post to this group, send email to outreachy-ker...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/outreachy-kernel/CALrZqyNXbn1SZ8Daws7yKkYm-C-U9FHyJ_eRxvuem1Fk%2BMqs%3Dg%40mail.gmail.com. >> For more options, visit https://groups.google.com/d/optout. >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 5/5] staging: gdm724x: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 1:49 AM, SIMRAN SINGHAL wrote: > On Tue, Feb 28, 2017 at 1:11 AM, Joe Perches wrote: >> On Mon, 2017-02-27 at 23:44 +0530, simran singhal wrote: >>> This patch fixes the checkpatch warning that else is not generally >>> useful after a break or return. >> >>> This was done using Coccinelle: >>> @@ >>> expression e2; >>> statement s1; >>> @@ >>> if(e2) { ... return ...; } >>> -else >>> s1 >> [] >>> diff --git a/drivers/staging/gdm724x/gdm_endian.c >>> b/drivers/staging/gdm724x/gdm_endian.c >> [] >>> @@ -26,30 +26,26 @@ __dev16 gdm_cpu_to_dev16(struct gdm_endian *ed, u16 x) >>> { >>> if (ed->dev_ed == ENDIANNESS_LITTLE) >>> return (__force __dev16)cpu_to_le16(x); >>> - else >>> - return (__force __dev16)cpu_to_be16(x); >>> + return (__force __dev16)cpu_to_be16(x); >> >> again, not a checkpatch message for any of the >> suggested modified hunks. >> I am not getting what's the problem in removing else or may be I am wrong you just want to say that I should change the commit message. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 3/5] staging: rtl8712: Remove unnecessary else after return
On Tue, Feb 28, 2017 at 2:49 AM, Julia Lawall wrote: > > > On Mon, 27 Feb 2017, simran singhal wrote: > >> This patch fixes the checkpatch warning that else is not generally >> useful after a break or return. >> >> This was done using Coccinelle: >> @@ >> expression e2; >> statement s1; >> @@ >> if(e2) { ... return ...; } >> -else >> s1 > > One might be surprised that the following code was detected using the > above semantic patch, because in the code below there is no return in the > if branches. Actually, as a special feature, when one has an if branch > that ends in return, Coccinelle will skip through any gotos and see if the > return is matched afterward. Indeed it is a common pattern to have > > if (...) { >foo(x); >bar(y); >return -ENOMEM; > } > > But the code can also be cut up as eg > > if (...) { >ret = -ENOMEM; >goto out; > } > ... > out: >foo(x); >bar(y); >return ret; > > To avoid having to write multiple patterns for these cases, Coccinelle > will just jump through the return in the second case, allowing the same > pattern to match both of them. > Julia, Thanks for explaination. Its really helpful. But I think there is no problem in removing else. Because it will execute this padapter->dvobjpriv.inirp_init(padapter); when if condition will not satisfy. > julia > >> >> Signed-off-by: simran singhal >> --- >> drivers/staging/rtl8712/os_intfs.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/staging/rtl8712/os_intfs.c >> b/drivers/staging/rtl8712/os_intfs.c >> index 8836b31..3062167 100644 >> --- a/drivers/staging/rtl8712/os_intfs.c >> +++ b/drivers/staging/rtl8712/os_intfs.c >> @@ -411,8 +411,7 @@ static int netdev_open(struct net_device *pnetdev) >> goto netdev_open_error; >> if (!padapter->dvobjpriv.inirp_init) >> goto netdev_open_error; >> - else >> - padapter->dvobjpriv.inirp_init(padapter); >> + padapter->dvobjpriv.inirp_init(padapter); >> r8712_set_ps_mode(padapter, padapter->registrypriv.power_mgnt, >> padapter->registrypriv.smart_ps); >> } >> -- >> 2.7.4 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "outreachy-kernel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to outreachy-kernel+unsubscr...@googlegroups.com. >> To post to this group, send email to outreachy-ker...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/outreachy-kernel/1488219268-3006-3-git-send-email-singhalsimran0%40gmail.com. >> For more options, visit https://groups.google.com/d/optout. >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: iio: accel: Move header file content to source file
On Wed, Mar 1, 2017 at 12:53 AM, Jonathan Cameron wrote: > On 28/02/17 19:17, Jonathan Cameron wrote: >> On 28/02/17 18:51, simran singhal wrote: >>> The contents of the header file are used only by this single >>> source file. Move content into .c and remove .h. >>> >>> Signed-off-by: simran singhal >> Applied to the togreg branch of iio.git and pushed out as testing >> for the autobuilders to play with it. >> >> Thanks, >> >> Jonathan > > One quick note: > > The title should include the name of the driver being modified > as this is probably the bit interested people are most likely > to pick up on in a long list of patches. > > I fixed this up. Thanks, > > Jonathan I have included the name of driver being modified. Due to want me to include the name of file i.e adis16201_core.c >>> --- >>> >>> v2: >>>-Removing ifndef and define >>> >>> drivers/staging/iio/accel/adis16201.h | 144 >>> - >>> drivers/staging/iio/accel/adis16201_core.c | 142 >>> +++- >>> 2 files changed, 141 insertions(+), 145 deletions(-) >>> delete mode 100644 drivers/staging/iio/accel/adis16201.h >>> >>> diff --git a/drivers/staging/iio/accel/adis16201.h >>> b/drivers/staging/iio/accel/adis16201.h >>> deleted file mode 100644 >>> index 64844ad..000 >>> --- a/drivers/staging/iio/accel/adis16201.h >>> +++ /dev/null >>> @@ -1,144 +0,0 @@ >>> -#ifndef SPI_ADIS16201_H_ >>> -#define SPI_ADIS16201_H_ >>> - >>> -#define ADIS16201_STARTUP_DELAY 220 /* ms */ >>> - >>> -/* Flash memory write count */ >>> -#define ADIS16201_FLASH_CNT 0x00 >>> - >>> -/* Output, power supply */ >>> -#define ADIS16201_SUPPLY_OUT 0x02 >>> - >>> -/* Output, x-axis accelerometer */ >>> -#define ADIS16201_XACCL_OUT 0x04 >>> - >>> -/* Output, y-axis accelerometer */ >>> -#define ADIS16201_YACCL_OUT 0x06 >>> - >>> -/* Output, auxiliary ADC input */ >>> -#define ADIS16201_AUX_ADC0x08 >>> - >>> -/* Output, temperature */ >>> -#define ADIS16201_TEMP_OUT 0x0A >>> - >>> -/* Output, x-axis inclination */ >>> -#define ADIS16201_XINCL_OUT 0x0C >>> - >>> -/* Output, y-axis inclination */ >>> -#define ADIS16201_YINCL_OUT 0x0E >>> - >>> -/* Calibration, x-axis acceleration offset */ >>> -#define ADIS16201_XACCL_OFFS 0x10 >>> - >>> -/* Calibration, y-axis acceleration offset */ >>> -#define ADIS16201_YACCL_OFFS 0x12 >>> - >>> -/* x-axis acceleration scale factor */ >>> -#define ADIS16201_XACCL_SCALE0x14 >>> - >>> -/* y-axis acceleration scale factor */ >>> -#define ADIS16201_YACCL_SCALE0x16 >>> - >>> -/* Calibration, x-axis inclination offset */ >>> -#define ADIS16201_XINCL_OFFS 0x18 >>> - >>> -/* Calibration, y-axis inclination offset */ >>> -#define ADIS16201_YINCL_OFFS 0x1A >>> - >>> -/* x-axis inclination scale factor */ >>> -#define ADIS16201_XINCL_SCALE0x1C >>> - >>> -/* y-axis inclination scale factor */ >>> -#define ADIS16201_YINCL_SCALE0x1E >>> - >>> -/* Alarm 1 amplitude threshold */ >>> -#define ADIS16201_ALM_MAG1 0x20 >>> - >>> -/* Alarm 2 amplitude threshold */ >>> -#define ADIS16201_ALM_MAG2 0x22 >>> - >>> -/* Alarm 1, sample period */ >>> -#define ADIS16201_ALM_SMPL1 0x24 >>> - >>> -/* Alarm 2, sample period */ >>> -#define ADIS16201_ALM_SMPL2 0x26 >>> - >>> -/* Alarm control */ >>> -#define ADIS16201_ALM_CTRL 0x28 >>> - >>> -/* Auxiliary DAC data */ >>> -#define ADIS16201_AUX_DAC0x30 >>> - >>> -/* General-purpose digital input/output control */ >>> -#define ADIS16201_GPIO_CTRL 0x32 >>> - >>> -/* Miscellaneous control */ >>> -#define ADIS16201_MSC_CTRL 0x34 >>> - >>> -/* Internal sample period (rate) control */ >>> -#define ADIS16201_SMPL_PRD 0x36 >>> - >>> -/* Operation, filter configuration */ >>> -#define ADIS16201_AVG_CNT0x38 >>> - >>> -/* Operation, sleep mode control */ >>> -#define ADIS16201_SLP_CNT0x3A >>>
Re: [PATCH v2] staging: iio: accel: Move header file content to source file
On Wed, Mar 1, 2017 at 1:04 AM, Lars-Peter Clausen wrote: > On 02/28/2017 08:32 PM, SIMRAN SINGHAL wrote: >> On Wed, Mar 1, 2017 at 12:53 AM, Jonathan Cameron wrote: >>> On 28/02/17 19:17, Jonathan Cameron wrote: >>>> On 28/02/17 18:51, simran singhal wrote: >>>>> The contents of the header file are used only by this single >>>>> source file. Move content into .c and remove .h. >>>>> >>>>> Signed-off-by: simran singhal >>>> Applied to the togreg branch of iio.git and pushed out as testing >>>> for the autobuilders to play with it. >>>> >>>> Thanks, >>>> >>>> Jonathan >>> >>> One quick note: >>> >>> The title should include the name of the driver being modified >>> as this is probably the bit interested people are most likely >>> to pick up on in a long list of patches. >>> >>> I fixed this up. Thanks, >>> >>> Jonathan >> >> I have included the name of driver being modified. >> Due to want me to include the name of file i.e adis16201_core.c > > Not the full filename, but the partnumber. E.g. > > 'staging: iio: adis16201: ...' > Lars-Peter, I got it. Jonathan, I got my mistake should I send v3. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: iio: adis16201: Move header file content to source file
The contents of the header file are used only by this single source file. Move content into .c and remove .h. Signed-off-by: simran singhal --- v3: -Removing endif as it is not needed -Changing subject drivers/staging/iio/accel/adis16201.h | 144 - drivers/staging/iio/accel/adis16201_core.c | 140 +++- 2 files changed, 139 insertions(+), 145 deletions(-) delete mode 100644 drivers/staging/iio/accel/adis16201.h diff --git a/drivers/staging/iio/accel/adis16201.h b/drivers/staging/iio/accel/adis16201.h deleted file mode 100644 index 64844ad..000 --- a/drivers/staging/iio/accel/adis16201.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef SPI_ADIS16201_H_ -#define SPI_ADIS16201_H_ - -#define ADIS16201_STARTUP_DELAY220 /* ms */ - -/* Flash memory write count */ -#define ADIS16201_FLASH_CNT 0x00 - -/* Output, power supply */ -#define ADIS16201_SUPPLY_OUT 0x02 - -/* Output, x-axis accelerometer */ -#define ADIS16201_XACCL_OUT 0x04 - -/* Output, y-axis accelerometer */ -#define ADIS16201_YACCL_OUT 0x06 - -/* Output, auxiliary ADC input */ -#define ADIS16201_AUX_ADC0x08 - -/* Output, temperature */ -#define ADIS16201_TEMP_OUT 0x0A - -/* Output, x-axis inclination */ -#define ADIS16201_XINCL_OUT 0x0C - -/* Output, y-axis inclination */ -#define ADIS16201_YINCL_OUT 0x0E - -/* Calibration, x-axis acceleration offset */ -#define ADIS16201_XACCL_OFFS 0x10 - -/* Calibration, y-axis acceleration offset */ -#define ADIS16201_YACCL_OFFS 0x12 - -/* x-axis acceleration scale factor */ -#define ADIS16201_XACCL_SCALE0x14 - -/* y-axis acceleration scale factor */ -#define ADIS16201_YACCL_SCALE0x16 - -/* Calibration, x-axis inclination offset */ -#define ADIS16201_XINCL_OFFS 0x18 - -/* Calibration, y-axis inclination offset */ -#define ADIS16201_YINCL_OFFS 0x1A - -/* x-axis inclination scale factor */ -#define ADIS16201_XINCL_SCALE0x1C - -/* y-axis inclination scale factor */ -#define ADIS16201_YINCL_SCALE0x1E - -/* Alarm 1 amplitude threshold */ -#define ADIS16201_ALM_MAG1 0x20 - -/* Alarm 2 amplitude threshold */ -#define ADIS16201_ALM_MAG2 0x22 - -/* Alarm 1, sample period */ -#define ADIS16201_ALM_SMPL1 0x24 - -/* Alarm 2, sample period */ -#define ADIS16201_ALM_SMPL2 0x26 - -/* Alarm control */ -#define ADIS16201_ALM_CTRL 0x28 - -/* Auxiliary DAC data */ -#define ADIS16201_AUX_DAC0x30 - -/* General-purpose digital input/output control */ -#define ADIS16201_GPIO_CTRL 0x32 - -/* Miscellaneous control */ -#define ADIS16201_MSC_CTRL 0x34 - -/* Internal sample period (rate) control */ -#define ADIS16201_SMPL_PRD 0x36 - -/* Operation, filter configuration */ -#define ADIS16201_AVG_CNT0x38 - -/* Operation, sleep mode control */ -#define ADIS16201_SLP_CNT0x3A - -/* Diagnostics, system status register */ -#define ADIS16201_DIAG_STAT 0x3C - -/* Operation, system command register */ -#define ADIS16201_GLOB_CMD 0x3E - -/* MSC_CTRL */ - -/* Self-test enable */ -#define ADIS16201_MSC_CTRL_SELF_TEST_ENBIT(8) - -/* Data-ready enable: 1 = enabled, 0 = disabled */ -#define ADIS16201_MSC_CTRL_DATA_RDY_EN BIT(2) - -/* Data-ready polarity: 1 = active high, 0 = active low */ -#define ADIS16201_MSC_CTRL_ACTIVE_HIGH BIT(1) - -/* Data-ready line selection: 1 = DIO1, 0 = DIO0 */ -#define ADIS16201_MSC_CTRL_DATA_RDY_DIO1 BIT(0) - -/* DIAG_STAT */ - -/* Alarm 2 status: 1 = alarm active, 0 = alarm inactive */ -#define ADIS16201_DIAG_STAT_ALARM2BIT(9) - -/* Alarm 1 status: 1 = alarm active, 0 = alarm inactive */ -#define ADIS16201_DIAG_STAT_ALARM1BIT(8) - -/* SPI communications failure */ -#define ADIS16201_DIAG_STAT_SPI_FAIL_BIT 3 - -/* Flash update failure */ -#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT 2 - -/* Power supply above 3.625 V */ -#define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1 - -/* Power supply below 3.15 V */ -#define ADIS16201_DIAG_STAT_POWER_LOW_BIT 0 - -/* GLOB_CMD */ - -#define ADIS16201_GLOB_CMD_SW_RESETBIT(7) -#define ADIS16201_GLOB_CMD_FACTORY_CAL BIT(1) - -#define ADIS16201_ERROR_ACTIVE BIT(14) - -enum adis16201_scan { - ADIS16201_SCAN_ACC_X, - ADIS16201_SCAN_ACC_Y, - ADIS16201_SCAN_INCLI_X, - ADIS16201_SCAN_INCLI_Y, - ADIS16201_SCAN_SUPPLY, - ADIS16201_SCAN_AUX_ADC, - ADIS16201_SCAN_TEMP, -}; - -#endif /* SPI_ADIS16201_H_ */ diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index 7963d4a..d6c8658 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c @@ -20,7 +20,145 @@ #include #include -#include "adis16201.h" +#define ADIS16201_STARTUP_DELAY220 /* ms */ + +/* Flash memory write count */ +#define ADIS16201_FLASH_CNT 0x00 + +/* Output, power supply *
[PATCH 5/6] staging: rtl8192u: Fix Sparse warning of cast from restricted __le16
This patch fixes the following Sparse warning- drivers/staging/rtl8192u/r8192U_dm.c:2307:49: warning: cast from restricted __le16 drivers/staging/rtl8192u/r8192U_dm.c:2308:44: warning: cast from restricted __le16 drivers/staging/rtl8192u/r8192U_dm.c:2309:44: warning: cast from restricted __le16 And added space before '|' Signed-off-by: simran singhal --- drivers/staging/rtl8192u/r8192U_dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 9209aad..e1c83a3 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -2304,9 +2304,9 @@ static void dm_check_edca_turbo( /* For Each time updating EDCA parameter, reset EDCA turbo mode status. */ dm_init_edca_turbo(dev); u1bAIFS = qos_parameters->aifs[0] * ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime; - u4bAcParam = (((u32)(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)| - (((u32)(qos_parameters->cw_max[0])) << AC_PARAM_ECW_MAX_OFFSET)| - (((u32)(qos_parameters->cw_min[0])) << AC_PARAM_ECW_MIN_OFFSET)| + u4bAcParam = ((le16_to_cpu(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET) | + ((le16_to_cpu(qos_parameters->cw_max[0])) << AC_PARAM_ECW_MAX_OFFSET) | + ((le16_to_cpu(qos_parameters->cw_min[0])) << AC_PARAM_ECW_MIN_OFFSET) | ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET); /*write_nic_dword(dev, WDCAPARA_ADD[i], u4bAcParam);*/ write_nic_dword(dev, EDCAPARA_BE, u4bAcParam); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: wlan-ng: Fix sparse warnings in hfa384x_usb.c
drivers/staging/wlan-ng/hfa384x_usb.c:3520:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:expected unsigned int [unsigned] [usertype] datarate drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3521:33: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:expected unsigned int [unsigned] [usertype] antenna drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3522:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:expected unsigned int [unsigned] [usertype] priority drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3523:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:expected unsigned int [unsigned] [usertype] ssi_type drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3524:36: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:expected signed int [signed] [usertype] [explicitly-signed] ssi_signal drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3525:35: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:expected signed int [signed] [usertype] [explicitly-signed] ssi_noise drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3526:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:expected unsigned int [unsigned] [usertype] preamble drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3527:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:expected unsigned int [unsigned] [usertype] encoding drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:got restricted __be32 [usertype] Signed-off-by: simran singhal --- drivers/staging/wlan-ng/hfa384x_usb.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index a7ff572..cdf987b 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3517,14 +3517,14 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev, caphdr->hosttime = __cpu_to_be64(jiffies); caphdr->phytype = htonl(4); /* dss_dot11_b */ caphdr->channel = htonl(hw->sniff_channel); - caphdr->datarate = htonl(rxdesc->rate); - caphdr->antenna = htonl(0); /* unknown */ - caphdr->priority = htonl(0);/* unknown */ - caphdr->ssi_type = htonl(3);/* rssi_raw */ - caphdr->ssi_signal = htonl(rxdesc->signal); - caphdr->ssi_noise = htonl(rxdesc->silence); - caphdr->preamble = htonl(0);/* unknown */ - caphdr->encoding = htonl(1);/* cck */ + caphdr->datarate = be32_to_cpu(htonl(rxdesc->rate)); + caphdr->antenna = be32_to_cpu(htonl(0));/* unknown */ + caphdr->priority = be32_to_cpu(htonl(0)); /* unknown */ + caphdr->ssi_type = be32_to_cpu(htonl(3)); /* rssi_raw */ + caphdr->ssi_signal = be32_to_cpu(htonl(rxdesc->signal)); + caphdr->ssi_noise = be32_to_cpu(htonl(rxdesc->silence)); + caphdr->preamble = be32_to_cpu(htonl(0)); /* unknown */ + caphdr->encoding = be32_to_cpu(htonl(1)); /* cck */ } /* Copy the 802.11 header to the skb -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] staging: wlan-ng: Fix sparse warning of restricted __le16
This patch fixes the following sparse warning: warning: cast to restricted __le16 Signed-off-by: simran singhal --- drivers/staging/wlan-ng/prism2sta.c | 51 ++--- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index 984804b..82d3a70 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -372,10 +372,9 @@ static int prism2sta_mlmerequest(struct wlandevice *wlandev, qualmsg->noise.status = P80211ENUM_msgitem_status_data_ok; - qualmsg->link.data = le16_to_cpu(hw->qual.cq_curr_bss); - qualmsg->level.data = - le16_to_cpu(hw->qual.asl_curr_bss); - qualmsg->noise.data = le16_to_cpu(hw->qual.anl_curr_fc); + qualmsg->link.data = hw->qual.cq_curr_bss; + qualmsg->level.data = hw->qual.asl_curr_bss; + qualmsg->noise.data = hw->qual.anl_curr_fc; qualmsg->txrate.data = hw->txrate; break; @@ -603,10 +602,10 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev) } /* get all the nic id fields in host byte order */ - hw->ident_nic.id = le16_to_cpu(hw->ident_nic.id); - hw->ident_nic.variant = le16_to_cpu(hw->ident_nic.variant); - hw->ident_nic.major = le16_to_cpu(hw->ident_nic.major); - hw->ident_nic.minor = le16_to_cpu(hw->ident_nic.minor); + hw->ident_nic.id = hw->ident_nic.id; + hw->ident_nic.variant = hw->ident_nic.variant; + hw->ident_nic.major = hw->ident_nic.major; + hw->ident_nic.minor = hw->ident_nic.minor; netdev_info(wlandev->netdev, "ident: nic h/w: id=0x%02x %d.%d.%d\n", hw->ident_nic.id, hw->ident_nic.major, @@ -622,10 +621,10 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev) } /* get all the private fw id fields in host byte order */ - hw->ident_pri_fw.id = le16_to_cpu(hw->ident_pri_fw.id); - hw->ident_pri_fw.variant = le16_to_cpu(hw->ident_pri_fw.variant); - hw->ident_pri_fw.major = le16_to_cpu(hw->ident_pri_fw.major); - hw->ident_pri_fw.minor = le16_to_cpu(hw->ident_pri_fw.minor); + hw->ident_pri_fw.id = hw->ident_pri_fw.id; + hw->ident_pri_fw.variant = hw->ident_pri_fw.variant; + hw->ident_pri_fw.major = hw->ident_pri_fw.major; + hw->ident_pri_fw.minor = hw->ident_pri_fw.minor; netdev_info(wlandev->netdev, "ident: pri f/w: id=0x%02x %d.%d.%d\n", hw->ident_pri_fw.id, hw->ident_pri_fw.major, @@ -648,10 +647,10 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev) } /* get all the station fw id fields in host byte order */ - hw->ident_sta_fw.id = le16_to_cpu(hw->ident_sta_fw.id); - hw->ident_sta_fw.variant = le16_to_cpu(hw->ident_sta_fw.variant); - hw->ident_sta_fw.major = le16_to_cpu(hw->ident_sta_fw.major); - hw->ident_sta_fw.minor = le16_to_cpu(hw->ident_sta_fw.minor); + hw->ident_sta_fw.id = hw->ident_sta_fw.id; + hw->ident_sta_fw.variant = hw->ident_sta_fw.variant; + hw->ident_sta_fw.major = hw->ident_sta_fw.major; + hw->ident_sta_fw.minor = hw->ident_sta_fw.minor; /* strip out the 'special' variant bits */ hw->mm_mods = hw->ident_sta_fw.variant & GENMASK(15, 14); @@ -683,11 +682,11 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev) /* get all the Compatibility range, modem interface supplier * fields in byte order */ - hw->cap_sup_mfi.role = le16_to_cpu(hw->cap_sup_mfi.role); - hw->cap_sup_mfi.id = le16_to_cpu(hw->cap_sup_mfi.id); - hw->cap_sup_mfi.variant = le16_to_cpu(hw->cap_sup_mfi.variant); - hw->cap_sup_mfi.bottom = le16_to_cpu(hw->cap_sup_mfi.bottom); - hw->cap_sup_mfi.top = le16_to_cpu(hw->cap_sup_mfi.top); + hw->cap_sup_mfi.role = hw->cap_sup_mfi.role; + hw->cap_sup_mfi.id = hw->cap_sup_mfi.id; + hw->cap_sup_mfi.variant = hw->cap_sup_mfi.variant; + hw->cap_sup_mfi.bottom = hw->cap_sup_mfi.bottom; + hw->cap_sup_mfi.top = hw->cap_sup_mfi.top; netdev_info(wlandev->netdev, "MFI:SUP:role=0x%02x:id=0x%02x:var=0x%02x:b/t=%d/%d\n", @@ -707,11 +706,11 @@ static int prism2sta_getcardinfo(struct wlandevice *wlandev) /* get all the Compatibility range, controller interface supplier * fields in byte order
[PATCH 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment
drivers/staging/fbtft/fbtft-bus.c:166:36: warning: incorrect type in assignment (different base types) drivers/staging/fbtft/fbtft-bus.c:166:36:expected unsigned short [unsigned] [short] [usertype] drivers/staging/fbtft/fbtft-bus.c:166:36:got restricted __be16 [usertype] drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in assignment (different base types) drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long [unsigned] [long] [long long] [usertype] drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] Signed-off-by: simran singhal --- drivers/staging/fbtft/fbtft-bus.c | 2 +- drivers/staging/fbtft/fbtft-io.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index ec45043..df2223e 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -163,7 +163,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) to_copy, remain - to_copy); for (i = 0; i < to_copy; i++) - txbuf16[i] = cpu_to_be16(vmem16[i]); + txbuf16[i] = vmem16[i]; vmem16 = vmem16 + to_copy; ret = par->fbtftops.write(par, par->txbuf.buf, diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c index d868405..ffb9a3b 100644 --- a/drivers/staging/fbtft/fbtft-io.c +++ b/drivers/staging/fbtft/fbtft-io.c @@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len) src++; } tmp |= ((*src & 0x0100) ? 1 : 0); - *(u64 *)dst = cpu_to_be64(tmp); + *(__be64 *)dst = cpu_to_be64(tmp); dst += 8; *dst++ = (u8)(*src++ & 0x00FF); added++; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: wlan-ng: Fix sparse warnings
This patch fixes the following sparse warnings: drivers/staging/wlan-ng/hfa384x_usb.c:1327:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:1327:34:expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/hfa384x_usb.c:1327:34:got restricted __le16 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:1328:33: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:1328:33:expected unsigned short [unsigned] [usertype] cmd drivers/staging/wlan-ng/hfa384x_usb.c:1328:33:got restricted __le16 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:1329:35: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:1329:35:expected unsigned short [unsigned] [usertype] parm0 drivers/staging/wlan-ng/hfa384x_usb.c:1329:35:got restricted __le16 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:1330:35: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:1330:35:expected unsigned short [unsigned] [usertype] parm1 drivers/staging/wlan-ng/hfa384x_usb.c:1330:35:got restricted __le16 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:1331:35: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:1331:35:expected unsigned short [unsigned] [usertype] parm2 drivers/staging/wlan-ng/hfa384x_usb.c:1331:35:got restricted __le16 [usertype] Signed-off-by: simran singhal --- drivers/staging/wlan-ng/hfa384x_usb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 6134eba..a7ff572 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -1324,11 +1324,11 @@ hfa384x_docmd(struct hfa384x *hw, } /* Initialize the command */ - ctlx->outbuf.cmdreq.type = cpu_to_le16(HFA384x_USB_CMDREQ); - ctlx->outbuf.cmdreq.cmd = cpu_to_le16(cmd->cmd); - ctlx->outbuf.cmdreq.parm0 = cpu_to_le16(cmd->parm0); - ctlx->outbuf.cmdreq.parm1 = cpu_to_le16(cmd->parm1); - ctlx->outbuf.cmdreq.parm2 = cpu_to_le16(cmd->parm2); + ctlx->outbuf.cmdreq.type = HFA384x_USB_CMDREQ; + ctlx->outbuf.cmdreq.cmd = cmd->cmd; + ctlx->outbuf.cmdreq.parm0 = cmd->parm0; + ctlx->outbuf.cmdreq.parm1 = cmd->parm1; + ctlx->outbuf.cmdreq.parm2 = cmd->parm2; ctlx->outbufsize = sizeof(ctlx->outbuf.cmdreq); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: rtl8192u: Fix Sparse warning of cast to restricted __le16
This patch fixes the following Sparse warnings:- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:177:16: warning: cast to restricted __le16 Signed-off-by: simran singhal --- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index 4d6c928..713f1d6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c @@ -174,7 +174,7 @@ static inline u16 Mk16(u8 hi, u8 lo) static inline u16 Mk16_le(u16 *v) { - return le16_to_cpu(*v); + return *v; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 1/6] staging: wlan-ng: Fix sparse warning of restricted __le16
On Thu, Mar 2, 2017 at 3:20 PM, Julia Lawall wrote: > > > On Thu, 2 Mar 2017, Julia Lawall wrote: > >> >> >> On Thu, 2 Mar 2017, simran singhal wrote: >> >> > This patch fixes the following sparse warning: >> > warning: cast to restricted __le16 >> >> You commit message should not say just fix X. What have you done to carry >> out the fix and why is this the correct approach? > > This comment applies to all of the patches in the series. > > julia > The changes and sparse warnings for them seems reasonable to me as after doing the change sparse was not showing error like cast to __le16 or something like this. Also it compiled perfectly. >> >> julia >> >> > >> > Signed-off-by: simran singhal >> > --- >> > drivers/staging/wlan-ng/prism2sta.c | 51 >> > ++--- >> > 1 file changed, 25 insertions(+), 26 deletions(-) >> > >> > diff --git a/drivers/staging/wlan-ng/prism2sta.c >> > b/drivers/staging/wlan-ng/prism2sta.c >> > index 984804b..82d3a70 100644 >> > --- a/drivers/staging/wlan-ng/prism2sta.c >> > +++ b/drivers/staging/wlan-ng/prism2sta.c >> > @@ -372,10 +372,9 @@ static int prism2sta_mlmerequest(struct wlandevice >> > *wlandev, >> > qualmsg->noise.status = >> > P80211ENUM_msgitem_status_data_ok; >> > >> > - qualmsg->link.data = le16_to_cpu(hw->qual.cq_curr_bss); >> > - qualmsg->level.data = >> > - le16_to_cpu(hw->qual.asl_curr_bss); >> > - qualmsg->noise.data = >> > le16_to_cpu(hw->qual.anl_curr_fc); >> > + qualmsg->link.data = hw->qual.cq_curr_bss; >> > + qualmsg->level.data = hw->qual.asl_curr_bss; >> > + qualmsg->noise.data = hw->qual.anl_curr_fc; >> > qualmsg->txrate.data = hw->txrate; >> > >> > break; >> > @@ -603,10 +602,10 @@ static int prism2sta_getcardinfo(struct wlandevice >> > *wlandev) >> > } >> > >> > /* get all the nic id fields in host byte order */ >> > - hw->ident_nic.id = le16_to_cpu(hw->ident_nic.id); >> > - hw->ident_nic.variant = le16_to_cpu(hw->ident_nic.variant); >> > - hw->ident_nic.major = le16_to_cpu(hw->ident_nic.major); >> > - hw->ident_nic.minor = le16_to_cpu(hw->ident_nic.minor); >> > + hw->ident_nic.id = hw->ident_nic.id; >> > + hw->ident_nic.variant = hw->ident_nic.variant; >> > + hw->ident_nic.major = hw->ident_nic.major; >> > + hw->ident_nic.minor = hw->ident_nic.minor; >> > >> > netdev_info(wlandev->netdev, "ident: nic h/w: id=0x%02x %d.%d.%d\n", >> > hw->ident_nic.id, hw->ident_nic.major, >> > @@ -622,10 +621,10 @@ static int prism2sta_getcardinfo(struct wlandevice >> > *wlandev) >> > } >> > >> > /* get all the private fw id fields in host byte order */ >> > - hw->ident_pri_fw.id = le16_to_cpu(hw->ident_pri_fw.id); >> > - hw->ident_pri_fw.variant = le16_to_cpu(hw->ident_pri_fw.variant); >> > - hw->ident_pri_fw.major = le16_to_cpu(hw->ident_pri_fw.major); >> > - hw->ident_pri_fw.minor = le16_to_cpu(hw->ident_pri_fw.minor); >> > + hw->ident_pri_fw.id = hw->ident_pri_fw.id; >> > + hw->ident_pri_fw.variant = hw->ident_pri_fw.variant; >> > + hw->ident_pri_fw.major = hw->ident_pri_fw.major; >> > + hw->ident_pri_fw.minor = hw->ident_pri_fw.minor; >> > >> > netdev_info(wlandev->netdev, "ident: pri f/w: id=0x%02x %d.%d.%d\n", >> > hw->ident_pri_fw.id, hw->ident_pri_fw.major, >> > @@ -648,10 +647,10 @@ static int prism2sta_getcardinfo(struct wlandevice >> > *wlandev) >> > } >> > >> > /* get all the station fw id fields in host byte order */ >> > - hw->ident_sta_fw.id = le16_to_cpu(hw->ident_sta_fw.id); >> > - hw->ident_sta_fw.variant = le16_to_cpu(hw->ident_sta_fw.variant); >> > - hw->ident_sta_fw.major = le16_to_cpu(hw->ident_sta_fw.major); >> > - hw->ident_sta_fw.minor = le16_to_cpu(hw->ident_sta_fw.minor); >> > + hw->ident_sta_fw.id = hw->ident_sta_fw.id; >> > + hw-&
[PATCH v2 3/6] staging: wlan-ng: Fix sparse warnings in hfa384x_usb.c
This patch fixes the following sparse warnings: drivers/staging/wlan-ng/hfa384x_usb.c:3520:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:expected unsigned int [unsigned] [usertype] datarate drivers/staging/wlan-ng/hfa384x_usb.c:3520:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3521:33: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:expected unsigned int [unsigned] [usertype] antenna drivers/staging/wlan-ng/hfa384x_usb.c:3521:33:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3522:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:expected unsigned int [unsigned] [usertype] priority drivers/staging/wlan-ng/hfa384x_usb.c:3522:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3523:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:expected unsigned int [unsigned] [usertype] ssi_type drivers/staging/wlan-ng/hfa384x_usb.c:3523:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3524:36: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:expected signed int [signed] [usertype] [explicitly-signed] ssi_signal drivers/staging/wlan-ng/hfa384x_usb.c:3524:36:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3525:35: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:expected signed int [signed] [usertype] [explicitly-signed] ssi_noise drivers/staging/wlan-ng/hfa384x_usb.c:3525:35:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3526:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:expected unsigned int [unsigned] [usertype] preamble drivers/staging/wlan-ng/hfa384x_usb.c:3526:34:got restricted __be32 [usertype] drivers/staging/wlan-ng/hfa384x_usb.c:3527:34: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:expected unsigned int [unsigned] [usertype] encoding drivers/staging/wlan-ng/hfa384x_usb.c:3527:34:got restricted __be32 [usertype] Signed-off-by: simran singhal --- v2: -changed commit message drivers/staging/wlan-ng/hfa384x_usb.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index a7ff572..cdf987b 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3517,14 +3517,14 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev, caphdr->hosttime = __cpu_to_be64(jiffies); caphdr->phytype = htonl(4); /* dss_dot11_b */ caphdr->channel = htonl(hw->sniff_channel); - caphdr->datarate = htonl(rxdesc->rate); - caphdr->antenna = htonl(0); /* unknown */ - caphdr->priority = htonl(0);/* unknown */ - caphdr->ssi_type = htonl(3);/* rssi_raw */ - caphdr->ssi_signal = htonl(rxdesc->signal); - caphdr->ssi_noise = htonl(rxdesc->silence); - caphdr->preamble = htonl(0);/* unknown */ - caphdr->encoding = htonl(1);/* cck */ + caphdr->datarate = be32_to_cpu(htonl(rxdesc->rate)); + caphdr->antenna = be32_to_cpu(htonl(0));/* unknown */ + caphdr->priority = be32_to_cpu(htonl(0)); /* unknown */ + caphdr->ssi_type = be32_to_cpu(htonl(3)); /* rssi_raw */ + caphdr->ssi_signal = be32_to_cpu(htonl(rxdesc->signal)); + caphdr->ssi_noise = be32_to_cpu(htonl(rxdesc->silence)); + caphdr->preamble = be32_to_cpu(htonl(0)); /* unknown */ + caphdr->encoding = be32_to_cpu(htonl(1)); /* cck */ } /* Copy the 802.11 header to the skb -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment
This patch fixes the following sparse warnings: drivers/staging/fbtft/fbtft-bus.c:166:36: warning: incorrect type in assignment (different base types) drivers/staging/fbtft/fbtft-bus.c:166:36:expected unsigned short [unsigned] [short] [usertype] drivers/staging/fbtft/fbtft-bus.c:166:36:got restricted __be16 [usertype] drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in assignment (different base types) drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long [unsigned] [long] [long long] [usertype] drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] Signed-off-by: simran singhal --- v2: -changed commit message drivers/staging/fbtft/fbtft-bus.c | 2 +- drivers/staging/fbtft/fbtft-io.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index ec45043..df2223e 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -163,7 +163,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) to_copy, remain - to_copy); for (i = 0; i < to_copy; i++) - txbuf16[i] = cpu_to_be16(vmem16[i]); + txbuf16[i] = vmem16[i]; vmem16 = vmem16 + to_copy; ret = par->fbtftops.write(par, par->txbuf.buf, diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c index d868405..ffb9a3b 100644 --- a/drivers/staging/fbtft/fbtft-io.c +++ b/drivers/staging/fbtft/fbtft-io.c @@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len) src++; } tmp |= ((*src & 0x0100) ? 1 : 0); - *(u64 *)dst = cpu_to_be64(tmp); + *(__be64 *)dst = cpu_to_be64(tmp); dst += 8; *dst++ = (u8)(*src++ & 0x00FF); added++; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: nvec: cleanup USLEEP_RANGE checkpatch checks
Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt. CHECK: usleep_range is preferred over udelay; see Documentation/ timers/timers-howto.txt Signed-off-by: simran singhal --- drivers/staging/nvec/nvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index c1feccf..cd35e64 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) break; case 2: /* first byte after command */ if (status == (I2C_SL_IRQ | RNW | RCVD)) { - udelay(33); + usleep_range(33, 100); if (nvec->rx->data[0] != 0x01) { dev_err(nvec->dev, "Read without prior read command\n"); @@ -718,7 +718,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev) * We experience less incomplete messages with this delay than without * it, but we don't know why. Help is appreciated. */ - udelay(100); + usleep_range(100, 200); return IRQ_HANDLED; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging: media: Remove unnecessary typecast of c90 int constant
This patch removes unnecessary typecast of c90 int constant. WARNING: Unnecessary typecast of c90 int constant Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 3dd5e7f..3f2b11ec 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -706,10 +706,10 @@ static int distance(struct gc2235_resolution *res, u32 w, u32 h) h_ratio = ((res->height << 13) / h); if (h_ratio == 0) return -1; - match = abs(((w_ratio << 13) / h_ratio) - ((int)8192)); + match = abs(((w_ratio << 13) / h_ratio) - 8192); - if ((w_ratio < (int)8192) || (h_ratio < (int)8192) || - (match > LARGEST_ALLOWED_RATIO_MISMATCH)) + if ((w_ratio < 8192) || (h_ratio < 8192) || + (match > LARGEST_ALLOWED_RATIO_MISMATCH)) return -1; return w_ratio + h_ratio; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] staging: media: Replace NULL with "!"
Use ! in comparison tests using "==NULL" rather than moving the "==NULL" to the right side of the test. Addesses multiple instances of the checkpatch.pl warning: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 7de7e24..2ef876a 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -603,7 +603,7 @@ static int power_up(struct v4l2_subdev *sd) struct i2c_client *client = v4l2_get_subdevdata(sd); int ret; - if (NULL == dev->platform_data) { + if (!dev->platform_data) { dev_err(&client->dev, "no camera_sensor_platform_data"); return -ENODEV; @@ -647,7 +647,7 @@ static int power_down(struct v4l2_subdev *sd) struct i2c_client *client = v4l2_get_subdevdata(sd); int ret = 0; - if (NULL == dev->platform_data) { + if (!dev->platform_data) { dev_err(&client->dev, "no camera_sensor_platform_data"); return -ENODEV; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/7] staging: media: Remove blank line before '}' and after '{' braces
Remove unneeded blank lines preceding/following '}' and '{' braces, as pointed out by checkpatch. This patch addresses the following checkpatch checks: CHECK: Blank lines aren't necessary before a close brace '}' CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 2ef876a..198df22 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -788,7 +788,6 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) { - struct v4l2_mbus_framefmt *fmt = &format->format; struct gc2235_device *dev = to_gc2235_sensor(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); @@ -1070,7 +1069,6 @@ static int gc2235_enum_frame_size(struct v4l2_subdev *sd, fse->max_height = gc2235_res[index].height; return 0; - } static int gc2235_g_skip_frames(struct v4l2_subdev *sd, u32 *frames) @@ -1228,7 +1226,6 @@ static int init_gc2235(void) static void exit_gc2235(void) { - i2c_del_driver(&gc2235_driver); } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/7] staging: media: Use x instead of x != NULL
Use x instead of x != NULL . This patch removes the explicit NULL comparisons.This issue is found by checkpatch.pl script. Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 165dcb3..40a5a2f 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -255,7 +255,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client, u16 reg_val, reg_val_h, dummy; int ret; - if (info == NULL) + if (!info) return -EINVAL; /* pixel clock calculattion */ @@ -797,7 +797,7 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd, int idx; gc2235_info = v4l2_get_subdev_hostdata(sd); - if (gc2235_info == NULL) + if (!gc2235_info) return -EINVAL; if (format->pad) return -EINVAL; @@ -917,7 +917,7 @@ static int gc2235_s_config(struct v4l2_subdev *sd, struct i2c_client *client = v4l2_get_subdevdata(sd); int ret = 0; - if (platform_data == NULL) + if (!platform_data) return -ENODEV; dev->platform_data = -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/7] staging: media: Add blank line after a declaration
Add blank line after a declaration. Problem found using checkpatch. This patch fixes these warning messages found by checkpatch.pl: WARNING : Missing a blank line after declarations. Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 3f2b11ec..7de7e24 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -359,6 +359,7 @@ static long __gc2235_set_exposure(struct v4l2_subdev *sd, int coarse_itg, u16 coarse_integration = (u16)coarse_itg; int ret = 0; u16 expo_coarse_h, expo_coarse_l, gain_val = 0xF0, gain_val2 = 0xF0; + expo_coarse_h = coarse_integration>>8; expo_coarse_l = coarse_integration & 0xff; @@ -410,6 +411,7 @@ static long gc2235_s_exposure(struct v4l2_subdev *sd, /* we should not accept the invalid value below. */ if (gain == 0) { struct i2c_client *client = v4l2_get_subdevdata(sd); + v4l2_err(client, "%s: invalid value\n", __func__); return -EINVAL; } @@ -546,6 +548,7 @@ static int is_init; static int gc2235_init(struct v4l2_subdev *sd) { int ret = 0; + ret = __gc2235_init(sd); return ret; @@ -759,6 +762,7 @@ static int startup(struct v4l2_subdev *sd) struct gc2235_device *dev = to_gc2235_sensor(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); int ret = 0; + if (is_init == 0) { /* force gc2235 to do a reset in res change, otherwise it * can not output normal after switching res. and it is not @@ -893,6 +897,7 @@ static int gc2235_s_stream(struct v4l2_subdev *sd, int enable) struct gc2235_device *dev = to_gc2235_sensor(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); int ret; + mutex_lock(&dev->input_lock); if (enable) @@ -1007,6 +1012,7 @@ static int gc2235_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *param) { struct gc2235_device *dev = to_gc2235_sensor(sd); + dev->run_mode = param->parm.capture.capturemode; mutex_lock(&dev->input_lock); @@ -1112,6 +1118,7 @@ static int gc2235_remove(struct i2c_client *client) { struct v4l2_subdev *sd = i2c_get_clientdata(client); struct gc2235_device *dev = to_gc2235_sensor(sd); + dev_dbg(&client->dev, "gc2235_remove...\n"); if (dev->platform_data->platform_deinit) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/7] staging: media: Do not use multiple blank lines
Remove multiple blank lines. Problem found using checkpatch.pl "CHECK: Please don't use multiple blank lines". Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 40a5a2f..b97a74b 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -244,7 +244,6 @@ static int gc2235_g_fnumber_range(struct v4l2_subdev *sd, s32 *val) return 0; } - static int gc2235_get_intg_factor(struct i2c_client *client, struct camera_mipi_info *info, const struct gc2235_resolution *res) @@ -388,7 +387,6 @@ static long __gc2235_set_exposure(struct v4l2_subdev *sd, int coarse_itg, return ret; } - static int gc2235_set_exposure(struct v4l2_subdev *sd, int exposure, int gain, int digitgain) { @@ -909,7 +907,6 @@ static int gc2235_s_stream(struct v4l2_subdev *sd, int enable) return ret; } - static int gc2235_s_config(struct v4l2_subdev *sd, int irq, void *platform_data) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/7] staging: media: Remove multiple assignments
Remove multiple assignments by factorizing them. Problem found using checkpatch.pl CHECK: multiple assignments should be avoided Signed-off-by: simran singhal --- drivers/staging/media/atomisp/i2c/gc2235.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/i2c/gc2235.c b/drivers/staging/media/atomisp/i2c/gc2235.c index 198df22..165dcb3 100644 --- a/drivers/staging/media/atomisp/i2c/gc2235.c +++ b/drivers/staging/media/atomisp/i2c/gc2235.c @@ -259,7 +259,8 @@ static int gc2235_get_intg_factor(struct i2c_client *client, return -EINVAL; /* pixel clock calculattion */ - buf->vt_pix_clk_freq_mhz = dev->vt_pix_clk_freq_mhz = 3000; + buf->vt_pix_clk_freq_mhz = 3000; + dev->vt_pix_clk_freq_mhz = 3000; /* get integration time */ buf->coarse_integration_time_min = GC2235_COARSE_INTG_TIME_MIN; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: nvec: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal --- drivers/staging/nvec/nvec_kbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c index e881e6b..a01f486 100644 --- a/drivers/staging/nvec/nvec_kbd.c +++ b/drivers/staging/nvec/nvec_kbd.c @@ -58,7 +58,7 @@ static int nvec_keys_notifier(struct notifier_block *nb, unsigned long event_type, void *data) { int code, state; - unsigned char *msg = (unsigned char *)data; + unsigned char *msg = data; if (event_type == NVEC_KB_EVT) { int _size = (msg[0] & (3 << 5)) >> 5; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: nvec: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal --- drivers/staging/nvec/nvec_kbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c index e881e6b..a01f486 100644 --- a/drivers/staging/nvec/nvec_kbd.c +++ b/drivers/staging/nvec/nvec_kbd.c @@ -58,7 +58,7 @@ static int nvec_keys_notifier(struct notifier_block *nb, unsigned long event_type, void *data) { int code, state; - unsigned char *msg = (unsigned char *)data; + unsigned char *msg = data; if (event_type == NVEC_KB_EVT) { int _size = (msg[0] & (3 << 5)) >> 5; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: lustre: lustre: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal --- drivers/staging/lustre/lustre/llite/range_lock.c | 2 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c b/drivers/staging/lustre/lustre/llite/range_lock.c index 14148a0..161391b 100644 --- a/drivers/staging/lustre/lustre/llite/range_lock.c +++ b/drivers/staging/lustre/lustre/llite/range_lock.c @@ -174,7 +174,7 @@ void range_unlock(struct range_lock_tree *tree, struct range_lock *lock) */ static enum interval_iter range_lock_cb(struct interval_node *node, void *arg) { - struct range_lock *lock = (struct range_lock *)arg; + struct range_lock *lock = arg; struct range_lock *overlap = node2rangelock(node); lock->rl_blocking_ranges += overlap->rl_lock_count + 1; diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 6a76605..b13961a 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1034,7 +1034,7 @@ static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, rc = sptlrpc_parse_flavor(val, &flvr); if (rc) { CERROR("invalid sptlrpc flavor %s to MGS\n", - (char *)val); + val); return rc; } @@ -1050,7 +1050,7 @@ static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, sptlrpc_flavor2name(&cli->cl_flvr_mgc, str, sizeof(str)); LCONSOLE_ERROR("asking sptlrpc flavor %s to MGS but currently %s is in use\n", - (char *)val, str); + val, str); rc = -EPERM; } return rc; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: rts5208: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal --- drivers/staging/rts5208/rtsx_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c index 2379901..d745b93 100644 --- a/drivers/staging/rts5208/rtsx_transport.c +++ b/drivers/staging/rts5208/rtsx_transport.c @@ -767,7 +767,7 @@ int rtsx_transfer_data(struct rtsx_chip *chip, u8 card, void *buf, size_t len, if (use_sg) { err = rtsx_transfer_sglist_adma(chip, card, - (struct scatterlist *)buf, + buf, use_sg, dma_dir, timeout); } else { err = rtsx_transfer_buf(chip, card, buf, len, dma_dir, timeout); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging: rtl8712: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal --- drivers/staging/rtl8712/rtl8712_recv.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 20fe45a..4367c68 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -444,9 +444,9 @@ void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf) u16 cmd_len, drvinfo_sz; struct recv_stat *prxstat; - poffset = (u8 *)prxcmdbuf; + poffset = prxcmdbuf; voffset = *(__le32 *)poffset; - prxstat = (struct recv_stat *)prxcmdbuf; + prxstat = prxcmdbuf; drvinfo_sz = (le32_to_cpu(prxstat->rxdw0) & 0x000f) >> 16; drvinfo_sz <<= 3; poffset += RXDESC_SIZE + drvinfo_sz; @@ -635,7 +635,7 @@ void r8712_reordering_ctrl_timeout_handler(void *pcontext) { unsigned long irql; struct recv_reorder_ctrl *preorder_ctrl = -(struct recv_reorder_ctrl *)pcontext; +pcontext; struct _adapter *padapter = preorder_ctrl->padapter; struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue; @@ -976,7 +976,7 @@ int recv_func(struct _adapter *padapter, void *pcontext) struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - prframe = (union recv_frame *)pcontext; + prframe = pcontext; orig_prframe = prframe; pattrib = &prframe->u.hdr.attrib; if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) { @@ -1124,7 +1124,7 @@ static int recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb) static void recv_tasklet(void *priv) { struct sk_buff *pskb; - struct _adapter *padapter = (struct _adapter *)priv; + struct _adapter *padapter = priv; struct recv_priv *precvpriv = &padapter->recvpriv; while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging: lustre: Remove unnecessary cast on void pointer
The following Coccinelle script was used to detect this: @r@ expression x; void* e; type T; identifier f; @@ ( *((T *)e) | ((T *)x)[...] | ((T*)x)->f | - (T*) e ) Signed-off-by: simran singhal --- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 271e189..09b46924 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -640,7 +640,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, int remote_gf_size = 0; int rc; - gf = (struct getinfo_fid2path *)karg; + gf = karg; tgt = lmv_find_target(lmv, &gf->gf_fid); if (IS_ERR(tgt)) return PTR_ERR(tgt); @@ -657,7 +657,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, struct getinfo_fid2path *ori_gf; char *ptr; - ori_gf = (struct getinfo_fid2path *)karg; + ori_gf = karg; if (strlen(ori_gf->gf_path) + strlen(gf->gf_path) > ori_gf->gf_pathlen) { rc = -EOVERFLOW; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/5] staging: lustre: lustre: Remove unnecessary cast on void pointer
On Fri, Mar 3, 2017 at 3:13 AM, Joe Perches wrote: > On Fri, 2017-03-03 at 02:49 +0530, simran singhal wrote: >> The following Coccinelle script was used to detect this: >> @r@ >> expression x; >> void* e; >> type T; >> identifier f; >> @@ >> ( >> *((T *)e) >> > >> >> ((T *)x)[...] >> > >> >> ((T*)x)->f >> > >> >> - (T*) >> e >> ) > > NAK. > > Nice, but you still have to verify correctness > before submitting these patches. > >> diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c >> b/drivers/staging/lustre/lustre/mgc/mgc_request.c > [] >> @@ -1034,7 +1034,7 @@ static int mgc_set_info_async(const struct lu_env >> *env, struct obd_export *exp, >> rc = sptlrpc_parse_flavor(val, &flvr); >> if (rc) { >> CERROR("invalid sptlrpc flavor %s to MGS\n", >> -(char *)val); >> +val); > > Try compiling this. > I compiled it before sending. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 5/5] staging: rtl8712: Remove unnecessary cast on void pointer
On Fri, Mar 3, 2017 at 3:26 AM, Julia Lawall wrote: >> @@ -635,7 +635,7 @@ void r8712_reordering_ctrl_timeout_handler(void >> *pcontext) >> { >> unsigned long irql; >> struct recv_reorder_ctrl *preorder_ctrl = >> - (struct recv_reorder_ctrl *)pcontext; >> + pcontext; > > Coccinelle doesn't always generate code in the best way. pcontext can be > moved up to the previous line in this case. > Thanks, I will send v2. > julia ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel