Re: [PATCH v2 4/4] Staging: rtl8712: fix warning for placing constant on the right side of test
On Fri, Oct 23, 2015 at 2:04 AM, Dan Carpenter wrote: > First fetch the changes, then check them out. > > $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > staging-next > $ git checkout FETCH_HEAD > > regards, > dan carpenter > Thank you very much Dan. Problem is solved :-) @Greg I haven't found any warnings in your tree .You might applied this patch before. So I am forward to create other patches ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] lustre: obdclass: fix sparse warning
This patch fixes the following warnings given by the sparse: drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:424:5: warning: symbol 'class_procfs_init' was not declared. Should it be static? drivers/staging/lustre/lustre/obdclass/linux/linux-module.c:460:5: warning: symbol 'class_procfs_clean' was not declared. Should it be static? drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:161:5: warning: symbol 'obd_sysctl_init' was not declared. Should it be static? drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c:166:6: warning: symbol 'obd_sysctl_clean' was not declared. Should it be static? Signed-off-by: Paul Davies C --- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index 6218ef3..45d92c2 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -421,7 +421,7 @@ static struct attribute_group lustre_attr_group = { .attrs = lustre_attrs, }; -int class_procfs_init(void) +static int class_procfs_init(void) { int rc = -ENOMEM; struct dentry *file; @@ -457,7 +457,7 @@ out: return rc; } -int class_procfs_clean(void) +static int class_procfs_clean(void) { if (debugfs_lustre_root != NULL) debugfs_remove_recursive(debugfs_lustre_root); diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index 1515163..6f13f21 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -158,11 +158,11 @@ static struct attribute_group lustre_attr_group = { .attrs = lustre_attrs, }; -int obd_sysctl_init(void) +static int obd_sysctl_init(void) { return sysfs_create_group(lustre_kobj, &lustre_attr_group); } -void obd_sysctl_clean(void) +static void obd_sysctl_clean(void) { } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/3] staging: rtl8712: Remove boolean comparisons
On 22/10/15 20:05, Dan Carpenter wrote: > On Mon, Oct 19, 2015 at 06:14:29PM +0100, Luis de Bethencourt wrote: >> Boolean tests do not need explicit comparison to true or false. >> >> Signed-off-by: Luis de Bethencourt >> --- >> diff --git a/drivers/staging/rtl8712/usb_ops_linux.c >> b/drivers/staging/rtl8712/usb_ops_linux.c >> index c940722..e33eeed 100644 >> --- a/drivers/staging/rtl8712/usb_ops_linux.c >> +++ b/drivers/staging/rtl8712/usb_ops_linux.c >> @@ -266,7 +266,7 @@ u32 r8712_usb_read_port(struct intf_hdl *pintfhdl, u32 >> addr, u32 cnt, u8 *rmem) >> if (adapter->bDriverStopped || adapter->bSurpriseRemoved || >> adapter->pwrctrlpriv.pnp_bstop_trx) >> return _FAIL; >> -if (!precvbuf->reuse == false || !precvbuf->pskb) { >> +if (precvbuf->reuse || !precvbuf->pskb) { >> precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue); >> if (precvbuf->pskb != NULL) >> precvbuf->reuse = true; > > You have transformed this faithfully, but my instinct says that the > original code is wrong. It should be: > > if (!precvbuf->reuse || !precvbuf->pskb) { > > I checked and usb_read_port() is implemented this way in > drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c. Again I am going on > instinct and not a full understanding of the code, but I'm probably > correct. > > Anyway, this is not related to the patch so we should fix it in a later > patch, but let's not forget. > > TODO: rtl8712: fix a reversed condition in r8712_usb_read_port() > > regards, > dan carpenter > Hi Dan, Thank you for the review. I will study the code and make sure that your intuition is correct, which initially it sounds to be. Thanks, Luis ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/21] staging: rtl8188eu: code cleanups
Kernel macros used, unnecessary macro removed, some checkpatch fixes performed and other changes added. Ivan Safonov (21): staging: rtl8188eu: sizeof/sizeof replaced by ARRAY_SIZE kernel macro staging: rtl8188eu: clamp kernel macro used in proc_get_rx_signal staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro staging: rtl8188eu: diff kernel macro used in simularity_compare function staging: rtl8188eu: unused SUCCESS and FAIL macros removed staging: rtl8188eu: unused MEM_ALIGNMENT_OFFSET and MEM_ALIGNMENT_PADDING macros removed staging: rtl8188eu: unused MIN macro removed staging: rtl8188eu: while loop replaced by for loop in rtw_restruct_wmm_ie staging: rtl8188eu: increment placed into for loop header staging: rtl8188eu: occurrence of the 5 GHz code marked staging: rtl8188eu: operator = replaced by += in loop increment staging: rtl8188eu: checkpatch fixes: spaces preferred around that '|' in hal/bb_cfg.c staging: rtl8188eu: BITn macro replaced by BIT(n) in hal/bb_cfg.c staging: rtl8188eu: checkpatch fixes: unnecessary parentheses removed in hal/bb_cfg.c staging: rtl8188eu: checkpatch fixes: alignment should match open parenthesis staging: rtl8188eu: checkpatch fixes: line over 80 characters splited into two parts staging: rtl8188eu: checkpatch fixes: 'Avoid CamelCase' in hal/bb_cfg.c staging: rtl8188eu: new variable for hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt] in store_pwrindex_offset function pwrGrpCnt variable removed in store_pwrindex_offset function drivers/staging/rtl8188eu/core/rtw_ap.c | 2 +- drivers/staging/rtl8188eu/core/rtw_debug.c| 3 +- drivers/staging/rtl8188eu/core/rtw_efuse.c| 2 +- drivers/staging/rtl8188eu/core/rtw_ieee80211.c| 2 +- drivers/staging/rtl8188eu/core/rtw_mlme.c | 5 +- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 9 ++- drivers/staging/rtl8188eu/core/rtw_recv.c | 6 +- drivers/staging/rtl8188eu/core/rtw_wlan_util.c| 19 ++- drivers/staging/rtl8188eu/hal/bb_cfg.c| 69 --- drivers/staging/rtl8188eu/hal/mac_cfg.c | 4 +- drivers/staging/rtl8188eu/hal/odm_HWConfig.c | 2 +- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 6 +- drivers/staging/rtl8188eu/hal/phy.c | 2 +- drivers/staging/rtl8188eu/hal/rf_cfg.c| 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 2 + drivers/staging/rtl8188eu/include/basic_types.h | 6 -- drivers/staging/rtl8188eu/include/rtw_security.h | 3 - drivers/staging/rtl8188eu/os_dep/ioctl_linux.c| 28 - drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 5 +- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 +- 21 files changed, 83 insertions(+), 98 deletions(-) -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/21] staging: rtl8188eu: clamp kernel macro used in proc_get_rx_signal
To limit the range of integers there is clamp macro. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c b/drivers/staging/rtl8188eu/core/rtw_debug.c index 993c7db..2c4afb8 100644 --- a/drivers/staging/rtl8188eu/core/rtw_debug.c +++ b/drivers/staging/rtl8188eu/core/rtw_debug.c @@ -594,8 +594,7 @@ int proc_set_rx_signal(struct file *file, const char __user *buffer, if (is_signal_dbg && num != 2) return count; - signal_strength = signal_strength > 100 ? 100 : signal_strength; - signal_strength = signal_strength < 0 ? 0 : signal_strength; + signal_strength = clamp(signal_strength, 0, 100); padapter->recvpriv.is_signal_dbg = is_signal_dbg; padapter->recvpriv.signal_strength_dbg = signal_strength; -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/21] staging: rtl8188eu: while loop replaced by for loop in rtw_restruct_wmm_ie
This patch replaces while loop with for loop, because the initial condition and the increment clearly and briefly defined for this loop. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index 2b917a1..37eb294 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -1709,8 +1709,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ unsignedint ielength = 0; unsigned int i, j; - i = 12; /* after the fixed IE */ - while (i < in_len) { + /* i = 12; after the fixed IE */ + for (i = 12; i < in_len; i += (in_ie[i+1]+2)/* to the next IE element */) { ielength = initial_out_len; if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { @@ -1726,7 +1726,6 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_ out_ie[initial_out_len + 8] = 0x00; break; } - i += (in_ie[i+1]+2); /* to the next IE element */ } return ielength; } -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/21] staging: rtl8188eu: BITn macro replaced by BIT(n) in hal/bb_cfg.c
BIT(n) macro preferable BITn. The BITn definitions saved, because BITn used in other files. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index a7844d4..6042c1a 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -705,7 +705,7 @@ bool rtl88eu_phy_bb_config(struct adapter *adapt) /* Enable BB and RF */ regval = usb_read16(adapt, REG_SYS_FUNC_EN); - usb_write16(adapt, REG_SYS_FUNC_EN, (u16)(regval | BIT13 | BIT0 | BIT1)); + usb_write16(adapt, REG_SYS_FUNC_EN, (u16)(regval | BIT(13) | BIT(0) | BIT(1))); usb_write8(adapt, REG_RF_CTRL, RF_EN | RF_RSTB | RF_SDMRSTB); -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/21] staging: rtl8188eu: abs kernel macro used in simularity_compare function
abs macro is useful for determining the difference between the two integers. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c index 2eafa50..bda4bd0 100644 --- a/drivers/staging/rtl8188eu/hal/phy.c +++ b/drivers/staging/rtl8188eu/hal/phy.c @@ -1013,7 +1013,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], tmp2 = resulta[c2][i]; } - diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1); + diff = abs(tmp1 - tmp2); if (diff > MAX_TOLERANCE) { if ((i == 2 || i == 6) && !sim_bitmap) { -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/21] staging: rtl8188eu: checkpatch fixes: 'Avoid CamelCase' in hal/bb_cfg.c
This is checkpatch fixes for hal/bb_cfg.c file: Avoid CamelCase. Additionaly unnecessary space before line removed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 5ab8277..54b33da 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -500,11 +500,11 @@ static u32 array_phy_reg_pg_8188e[] = { }; -static void store_pwrindex_offset(struct adapter *Adapter, +static void store_pwrindex_offset(struct adapter *adapter, u32 regaddr, u32 bitmask, u32 data) { - struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter); -u8 pwrGrpCnt = hal_data->pwrGroupCnt; + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapter); + u8 pwrGrpCnt = hal_data->pwrGroupCnt; if (regaddr == rTxAGC_A_Rate18_06) hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][0] = data; @@ -590,9 +590,9 @@ static bool config_bb_with_pgheader(struct adapter *adapt) return true; } -static void rtl88e_phy_init_bb_rf_register_definition(struct adapter *Adapter) +static void rtl88e_phy_init_bb_rf_register_definition(struct adapter *adapter) { - struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter); + struct hal_data_8188e *hal_data = GET_HAL_DATA(adapter); struct bb_reg_def *reg[4]; reg[RF_PATH_A] = &hal_data->PHYRegDef[RF_PATH_A]; @@ -681,13 +681,13 @@ static void rtl88e_phy_init_bb_rf_register_definition(struct adapter *Adapter) static bool config_parafile(struct adapter *adapt) { - struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(adapt); + struct eeprom_priv *eeprom = GET_EEPROM_EFUSE_PRIV(adapt); struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt); set_baseband_phy_config(adapt); /* If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */ - if (!pEEPROM->bautoload_fail_flag) { + if (!eeprom->bautoload_fail_flag) { hal_data->pwrGroupCnt = 0; config_bb_with_pgheader(adapt); } -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/21] staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro
min macro better conveys the meaning of the code. Constants types explicitly specified to suppress compiler warnings about incompatible types. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c| 2 +- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 2 +- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 4 ++-- drivers/staging/rtl8188eu/hal/odm_HWConfig.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 2 +- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 20 ++-- drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 5 ++--- 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 5c45f8a..c39b9a1 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -1795,7 +1795,7 @@ int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset) plist = plist->next; issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset); - psta->expire_to = ((pstapriv->expire_to * 2) > 5) ? 5 : (pstapriv->expire_to * 2); + psta->expire_to = min(pstapriv->expire_to * 2, (unsigned int)5); } spin_unlock_bh(&pstapriv->asoc_list_lock); diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index 82d4e88..dfa5638 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -1392,6 +1392,6 @@ static const char *_action_public_str[] = { const char *action_public_str(u8 action) { - action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action; + action = min(action, (u8)ACT_PUBLIC_MAX); return _action_public_str[action]; } diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index e15c198..4c943e3 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -418,7 +418,7 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, min(rate_len, (unsigned int)8), cur_network->SupportedRates, &pattrib->pktlen); /* DS parameter set */ pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); @@ -578,7 +578,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da) /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, min(rate_len, (unsigned int)8), cur_network->SupportedRates, &pattrib->pktlen); /* DS parameter set */ pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 3bb40a7fe..19c5663 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -1227,7 +1227,7 @@ unsigned int update_basic_rate(unsigned char *ptn, unsigned int ptn_sz) unsigned int i, num_of_rate; unsigned int mask = 0; - num_of_rate = (ptn_sz > NumRates) ? NumRates : ptn_sz; + num_of_rate = min(ptn_sz, (unsigned int)NumRates); for (i = 0; i < num_of_rate; i++) { if ((*(ptn + i)) & 0x80) @@ -1241,7 +1241,7 @@ unsigned int update_supported_rate(unsigned char *ptn, unsigned int ptn_sz) unsigned int i, num_of_rate; unsigned int mask = 0; - num_of_rate = (ptn_sz > NumRates) ? NumRates : ptn_sz; + num_of_rate = min(ptn_sz, (unsigned int)NumRates); for (i = 0; i < num_of_rate; i++) mask |= 0x1 << wifirate2_ratetbl_inx(*(ptn + i)); diff --git a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c index 36afe45..5b17d6e 100644 --- a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c @@ -394,7 +394,7 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm, OFDM_pkt += (u8)(pEntry->rssi_stat.PacketMap>>i)&BIT0; if (pEntry->rssi_stat.ValidBit == 64) { - Weighting =
[PATCH 03/21] staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro
min (or max) kernel macro better conveys the meaning of the code. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 6 ++ drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++-- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c index d3c6873..2b16256 100644 --- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c @@ -292,8 +292,7 @@ static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm) (dm_fat_tbl->AuxAnt_Sum[i]/dm_fat_tbl->AuxAnt_Cnt[i]) : 0; target_ant = (main_rssi >= aux_rssi) ? MAIN_ANT : AUX_ANT; /* 2 Select max_rssi for DIG */ - local_max_rssi = (main_rssi > aux_rssi) ? - main_rssi : aux_rssi; + local_max_rssi = max(main_rssi, aux_rssi); if ((local_max_rssi > ant_div_max_rssi) && (local_max_rssi < 40)) ant_div_max_rssi = local_max_rssi; @@ -308,8 +307,7 @@ static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm) (aux_rssi == 0)) aux_rssi = main_rssi; - local_min_rssi = (main_rssi > aux_rssi) ? - aux_rssi : main_rssi; + local_min_rssi = min(main_rssi, aux_rssi); if (local_min_rssi < min_rssi) { min_rssi = local_min_rssi; RxIdleAnt = target_ant; diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index bda423e..fd01ca4 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -604,7 +604,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&buf[cnt+2], wps_oui, 4))) { DBG_88E("SET WPS_IE\n"); - padapter->securitypriv.wps_ie_len = ((buf[cnt+1]+2) < (MAX_WPA_IE_LEN<<2)) ? (buf[cnt+1]+2) : (MAX_WPA_IE_LEN<<2); + padapter->securitypriv.wps_ie_len = min(buf[cnt + 1] + 2, MAX_WPA_IE_LEN << 2); memcpy(padapter->securitypriv.wps_ie, &buf[cnt], padapter->securitypriv.wps_ie_len); @@ -2974,7 +2974,7 @@ static int rtw_wx_set_priv(struct net_device *dev, if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && (!memcmp(&probereq_wpsie[2], wps_oui, 4))) { - cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len; + cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN); pmlmepriv->wps_probe_req_ie_len = 0; kfree(pmlmepriv->wps_probe_req_ie); diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c index 5acf9a9..1593e28 100644 --- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c @@ -52,7 +52,7 @@ uint _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen) len = rtw_remainder_len(pfile); - len = (rlen > len) ? len : rlen; + len = min(rlen, len); if (rmem) skb_copy_bits(pfile->pkt, pfile->buf_len-pfile->pkt_len, rmem, len); -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/21] staging: rtl8188eu: unused MEM_ALIGNMENT_OFFSET and MEM_ALIGNMENT_PADDING macros removed
This patch removes unused MEM_ALIGNMENT_OFFSET and MEM_ALIGNMENT_PADDING macros from include/basic_types.h. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/basic_types.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/basic_types.h b/drivers/staging/rtl8188eu/include/basic_types.h index 485d5c7..6a2a147 100644 --- a/drivers/staging/rtl8188eu/include/basic_types.h +++ b/drivers/staging/rtl8188eu/include/basic_types.h @@ -27,9 +27,6 @@ typedef void (*proc_t)(void *); #define FIELD_OFFSET(s, field) ((ssize_t)&((s *)(0))->field) -#define MEM_ALIGNMENT_OFFSET (sizeof(size_t)) -#define MEM_ALIGNMENT_PADDING (sizeof(size_t) - 1) - /* port from fw */ /* TODO: Macros Below are Sync from SD7-Driver. It is necessary * to check correctness */ -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/21] staging: rtl8188eu: checkpatch fixes: spaces preferred around that '|' in hal/bb_cfg.c
This is checkpatch fixes for hal/bb_cfg.c file: spaces preferred around that '|'. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 4eb982b..a7844d4 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -705,9 +705,9 @@ bool rtl88eu_phy_bb_config(struct adapter *adapt) /* Enable BB and RF */ regval = usb_read16(adapt, REG_SYS_FUNC_EN); - usb_write16(adapt, REG_SYS_FUNC_EN, (u16)(regval|BIT13|BIT0|BIT1)); + usb_write16(adapt, REG_SYS_FUNC_EN, (u16)(regval | BIT13 | BIT0 | BIT1)); - usb_write8(adapt, REG_RF_CTRL, RF_EN|RF_RSTB|RF_SDMRSTB); + usb_write8(adapt, REG_RF_CTRL, RF_EN | RF_RSTB | RF_SDMRSTB); usb_write8(adapt, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/21] staging: rtl8188eu: checkpatch fixes: line over 80 characters splited into two parts
This is checkpatch fixes for hal/bb_cfg.c file: line over 80 characters. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 82990ed..5ab8277 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -500,7 +500,8 @@ static u32 array_phy_reg_pg_8188e[] = { }; -static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitmask, u32 data) +static void store_pwrindex_offset(struct adapter *Adapter, + u32 regaddr, u32 bitmask, u32 data) { struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter); u8 pwrGrpCnt = hal_data->pwrGroupCnt; @@ -705,18 +706,21 @@ bool rtl88eu_phy_bb_config(struct adapter *adapt) /* Enable BB and RF */ regval = usb_read16(adapt, REG_SYS_FUNC_EN); - usb_write16(adapt, REG_SYS_FUNC_EN, (u16)(regval | BIT(13) | BIT(0) | BIT(1))); + usb_write16(adapt, REG_SYS_FUNC_EN, + (u16)(regval | BIT(13) | BIT(0) | BIT(1))); usb_write8(adapt, REG_RF_CTRL, RF_EN | RF_RSTB | RF_SDMRSTB); - usb_write8(adapt, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); + usb_write8(adapt, REG_SYS_FUNC_EN, FEN_USBA | + FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); /* Config BB and AGC */ rtstatus = config_parafile(adapt); /* write 0x24[16:11] = 0x24[22:17] = crystal_cap */ crystal_cap = hal_data->CrystalCap & 0x3F; - phy_set_bb_reg(adapt, REG_AFE_XTAL_CTRL, 0x7ff800, (crystal_cap | (crystal_cap << 6))); + phy_set_bb_reg(adapt, REG_AFE_XTAL_CTRL, 0x7ff800, + (crystal_cap | (crystal_cap << 6))); return rtstatus; } -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/21] staging: rtl8188eu: operator = replaced by += in loop increment
x = x + a and x += a equivalen, but second preferably. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 6 +++--- drivers/staging/rtl8188eu/hal/mac_cfg.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index cb90ad5..110b8c0 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1277,7 +1277,7 @@ static int validate_recv_frame(struct adapter *adapter, int i; DBG_88E("#\n"); - for (i = 0; i < 64; i = i+8) + for (i = 0; i < 64; i += 8) DBG_88E("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2), *(ptr+i+3), *(ptr+i+4), *(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_88E("#\n"); @@ -1286,7 +1286,7 @@ static int validate_recv_frame(struct adapter *adapter, int i; DBG_88E("#\n"); - for (i = 0; i < 64; i = i+8) + for (i = 0; i < 64; i += 8) DBG_88E("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2), *(ptr+i+3), *(ptr+i+4), *(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_88E("#\n"); @@ -1296,7 +1296,7 @@ static int validate_recv_frame(struct adapter *adapter, int i; DBG_88E("#\n"); - for (i = 0; i < 64; i = i+8) + for (i = 0; i < 64; i += 8) DBG_88E("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr+i), *(ptr+i+1), *(ptr+i+2), *(ptr+i+3), *(ptr+i+4), *(ptr+i+5), *(ptr+i+6), *(ptr+i+7)); DBG_88E("#\n"); diff --git a/drivers/staging/rtl8188eu/hal/mac_cfg.c b/drivers/staging/rtl8188eu/hal/mac_cfg.c index b867db5..0bc1b21 100644 --- a/drivers/staging/rtl8188eu/hal/mac_cfg.c +++ b/drivers/staging/rtl8188eu/hal/mac_cfg.c @@ -126,7 +126,7 @@ bool rtl88eu_phy_mac_config(struct adapter *adapt) arraylength = ARRAY_SIZE(array_MAC_REG_8188E); ptrarray = array_MAC_REG_8188E; - for (i = 0; i < arraylength; i = i + 2) + for (i = 0; i < arraylength; i += 2) usb_write8(adapt, ptrarray[i], (u8)ptrarray[i + 1]); usb_write8(adapt, REG_MAX_AGGR_NUM, MAX_AGGR_NUM); -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/21] staging: rtl8188eu: sizeof/sizeof replaced by ARRAY_SIZE kernel macro
ARRAY_SIZE shorter and more difficult to create bugs. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/mac_cfg.c| 2 +- drivers/staging/rtl8188eu/hal/rf_cfg.c | 2 +- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/mac_cfg.c b/drivers/staging/rtl8188eu/hal/mac_cfg.c index febc83a..b867db5 100644 --- a/drivers/staging/rtl8188eu/hal/mac_cfg.c +++ b/drivers/staging/rtl8188eu/hal/mac_cfg.c @@ -123,7 +123,7 @@ bool rtl88eu_phy_mac_config(struct adapter *adapt) u32 arraylength; u32 *ptrarray; - arraylength = sizeof(array_MAC_REG_8188E)/sizeof(u32); + arraylength = ARRAY_SIZE(array_MAC_REG_8188E); ptrarray = array_MAC_REG_8188E; for (i = 0; i < arraylength; i = i + 2) diff --git a/drivers/staging/rtl8188eu/hal/rf_cfg.c b/drivers/staging/rtl8188eu/hal/rf_cfg.c index 067649a..372ee9a 100644 --- a/drivers/staging/rtl8188eu/hal/rf_cfg.c +++ b/drivers/staging/rtl8188eu/hal/rf_cfg.c @@ -198,7 +198,7 @@ static void rtl8188e_config_rf_reg(struct adapter *adapt, static bool rtl88e_phy_config_rf_with_headerfile(struct adapter *adapt) { u32 i; - u32 array_len = sizeof(Array_RadioA_1T_8188E)/sizeof(u32); + u32 array_len = ARRAY_SIZE(Array_RadioA_1T_8188E); u32 *array = Array_RadioA_1T_8188E; for (i = 0; i < array_len; i += 2) { diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 9695749..bda423e 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -3091,7 +3091,7 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) struct iw_handler_def rtw_handlers_def = { .standard = rtw_handlers, - .num_standard = sizeof(rtw_handlers) / sizeof(iw_handler), + .num_standard = ARRAY_SIZE(rtw_handlers), .get_wireless_stats = rtw_get_wireless_stats, }; -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/21] staging: rtl8188eu: ternary operator (?:) replaced by min/max kernel macro
min macro better conveys the meaning of the code. Expressions types explicitly specified to suppress compiler warnings about incompatible types. Types of the macro arguments match the types of the left side. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_efuse.c | 2 +- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c index 7b99ea9..923e636 100644 --- a/drivers/staging/rtl8188eu/core/rtw_efuse.c +++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c @@ -268,7 +268,7 @@ static void efuse_read_phymap_from_txpktbuf( aaa = le16_to_cpup((__le16 *)&lo32); len = le16_to_cpu(*((__le16 *)&lo32)); - limit = (len-2 < limit) ? len-2 : limit; + limit = min((u16)(len - 2), limit); DBG_88E("%s len:%u, lenbak:%u, aaa:%u, aaabak:%u\n", __func__, len, lenbak, aaa, aaabak); diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 4c943e3..70acdf2 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -3239,7 +3239,7 @@ static unsigned int OnAssocReq(struct adapter *padapter, pstat->flags |= WLAN_STA_WPS; copy_len = 0; } else { - copy_len = ((wpa_ie_len+2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)) : (wpa_ie_len+2); + copy_len = min(wpa_ie_len + 2, (int)sizeof(pstat->wpa_ie)); } if (copy_len > 0) memcpy(pstat->wpa_ie, wpa_ie-2, copy_len); diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 98bdc95..735e24b 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -2669,7 +2669,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) int copy_len; wpa_ie_len = psta->wpa_ie[1]; - copy_len = ((wpa_ie_len+2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)) : (wpa_ie_len+2); + copy_len = min(wpa_ie_len + 2, (int)sizeof(psta->wpa_ie)); param->u.wpa_ie.len = copy_len; memcpy(param->u.wpa_ie.reserved, psta->wpa_ie, copy_len); } else { -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/21] staging: rtl8188eu: occurrence of the 5 GHz code marked
Channel numbers greater than 14 are used here, which are possible only for the 5 GHz frequency. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c index a6295ca..821b8b5 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c @@ -446,6 +446,8 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup) } else { bIn24G = false; + /* probably, this branch is suitable only for 5 GHz */ + if (chnl <= 40) *pGroup = 0; else if (chnl <= 48) -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/21] staging: rtl8188eu: increment placed into for loop header
The increment at the end of the cycle, and it can be placed in the loop header. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 3 +-- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 15 --- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 70acdf2..8985552 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -1181,7 +1181,7 @@ static void issue_assocreq(struct adapter *padapter) } /* vendor specific IE, such as WPA, WMM, WPS */ - for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) { + for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength; i += (pIE->Length + 2)) { pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { @@ -1202,7 +1202,6 @@ static void issue_assocreq(struct adapter *padapter) default: break; } - i += (pIE->Length + 2); } if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 19c5663..a3e46b6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -1071,7 +1071,7 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN); - for (i = 0; i < len;) { + for (i = 0; i < len; i += (pIE->Length + 2)) { pIE = (struct ndis_802_11_var_ie *)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i); switch (pIE->ElementID) { @@ -1086,8 +1086,6 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru default: break; } - - i += (pIE->Length + 2); } } @@ -1100,7 +1098,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter) struct wlan_bssid_ex*cur_network = &(pmlmeinfo->network); if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) { - for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) { + for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength; i += (pIE->Length + 2)) { pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { @@ -1114,8 +1112,6 @@ unsigned int is_ap_in_tkip(struct adapter *padapter) default: break; } - - i += (pIE->Length + 2); } return false; } else { @@ -1131,7 +1127,7 @@ unsigned int should_forbid_n_rate(struct adapter *padapter) struct wlan_bssid_ex *cur_network = &pmlmepriv->cur_network.network; if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) { - for (i = sizeof(struct ndis_802_11_fixed_ie); i < cur_network->IELength;) { + for (i = sizeof(struct ndis_802_11_fixed_ie); i < cur_network->IELength; i += (pIE->Length + 2)) { pIE = (struct ndis_802_11_var_ie *)(cur_network->IEs + i); switch (pIE->ElementID) { @@ -1148,8 +1144,6 @@ unsigned int should_forbid_n_rate(struct adapter *padapter) default: break; } - - i += (pIE->Length + 2); } return true; @@ -1167,7 +1161,7 @@ unsigned int is_ap_in_wep(struct adapter *padapter) struct wlan_bssid_ex*cur_network = &(pmlmeinfo->network); if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) { - for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) { + for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength; i += (pIE->Length + 2)) { pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { @@ -1180,7 +1174,6 @@ unsigned int is_ap_in_wep(struct adapter *padapter) default: break; } - i += (pIE->Length + 2); } return true; } else { -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/
[PATCH 17/21] staging: rtl8188eu: checkpatch fixes: alignment should match open parenthesis
This is checkpatch fixes for hal/bb_cfg.c file: alignment should match open parenthesis. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 167b6a0..82990ed 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -546,7 +546,7 @@ static void store_pwrindex_offset(struct adapter *Adapter, u32 regaddr, u32 bitm } static void rtl_addr_delay(struct adapter *adapt, - u32 addr, u32 bit_mask, u32 data) + u32 addr, u32 bit_mask, u32 data) { switch (addr) { case 0xfe: -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/21] staging: rtl8188eu: new variable for hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt] in store_pwrindex_offset function
hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt] frequent in this function, so it replaced by the power_level_offset new variable. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 54b33da..ebb37ed 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -505,42 +505,44 @@ static void store_pwrindex_offset(struct adapter *adapter, { struct hal_data_8188e *hal_data = GET_HAL_DATA(adapter); u8 pwrGrpCnt = hal_data->pwrGroupCnt; + u32 * const power_level_offset = + hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt]; if (regaddr == rTxAGC_A_Rate18_06) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][0] = data; + power_level_offset[0] = data; if (regaddr == rTxAGC_A_Rate54_24) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][1] = data; + power_level_offset[1] = data; if (regaddr == rTxAGC_A_CCK1_Mcs32) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][6] = data; + power_level_offset[6] = data; if (regaddr == rTxAGC_B_CCK11_A_CCK2_11 && bitmask == 0xff00) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][7] = data; + power_level_offset[7] = data; if (regaddr == rTxAGC_A_Mcs03_Mcs00) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][2] = data; + power_level_offset[2] = data; if (regaddr == rTxAGC_A_Mcs07_Mcs04) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][3] = data; + power_level_offset[3] = data; if (regaddr == rTxAGC_A_Mcs11_Mcs08) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][4] = data; + power_level_offset[4] = data; if (regaddr == rTxAGC_A_Mcs15_Mcs12) { - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][5] = data; + power_level_offset[5] = data; if (hal_data->rf_type == RF_1T1R) hal_data->pwrGroupCnt++; } if (regaddr == rTxAGC_B_Rate18_06) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][8] = data; + power_level_offset[8] = data; if (regaddr == rTxAGC_B_Rate54_24) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][9] = data; + power_level_offset[9] = data; if (regaddr == rTxAGC_B_CCK1_55_Mcs32) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][14] = data; + power_level_offset[14] = data; if (regaddr == rTxAGC_B_CCK11_A_CCK2_11 && bitmask == 0x00ff) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][15] = data; + power_level_offset[15] = data; if (regaddr == rTxAGC_B_Mcs03_Mcs00) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][10] = data; + power_level_offset[10] = data; if (regaddr == rTxAGC_B_Mcs07_Mcs04) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][11] = data; + power_level_offset[11] = data; if (regaddr == rTxAGC_B_Mcs11_Mcs08) - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][12] = data; + power_level_offset[12] = data; if (regaddr == rTxAGC_B_Mcs15_Mcs12) { - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt][13] = data; + power_level_offset[13] = data; if (hal_data->rf_type != RF_1T1R) hal_data->pwrGroupCnt++; } -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/21] staging: rtl8188eu: unused SUCCESS and FAIL macros removed
This patch removes unused SUCCESS and FAIL macros in include/basic_types.h. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/basic_types.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/basic_types.h b/drivers/staging/rtl8188eu/include/basic_types.h index 8a7ca99..485d5c7 100644 --- a/drivers/staging/rtl8188eu/include/basic_types.h +++ b/drivers/staging/rtl8188eu/include/basic_types.h @@ -20,9 +20,6 @@ #ifndef __BASIC_TYPES_H__ #define __BASIC_TYPES_H__ -#define SUCCESS0 -#define FAIL (-1) - #include #define NDIS_OID uint -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/21] pwrGrpCnt variable removed in store_pwrindex_offset function
This variable used only once in the beginning of the function, it can be removed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index ebb37ed..f58a822 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -504,9 +504,8 @@ static void store_pwrindex_offset(struct adapter *adapter, u32 regaddr, u32 bitmask, u32 data) { struct hal_data_8188e *hal_data = GET_HAL_DATA(adapter); - u8 pwrGrpCnt = hal_data->pwrGroupCnt; u32 * const power_level_offset = - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt]; + hal_data->MCSTxPowerLevelOriginalOffset[hal_data->pwrGroupCnt]; if (regaddr == rTxAGC_A_Rate18_06) power_level_offset[0] = data; -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/21] staging: rtl8188eu: unused MIN macro removed
This patch removes unused MIN macro from include/rtw_security.h. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/rtw_security.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/rtw_security.h b/drivers/staging/rtl8188eu/include/rtw_security.h index abe7e21..a1aebe6 100644 --- a/drivers/staging/rtl8188eu/include/rtw_security.h +++ b/drivers/staging/rtl8188eu/include/rtw_security.h @@ -336,9 +336,6 @@ static const unsigned long K[64] = { #define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) #define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) #define Gamma1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10)) -#ifndef MIN -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) -#endif void rtw_secmicsetkey(struct mic_data *pmicdata, u8 *key); void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b); -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/21] staging: rtl8188eu: checkpatch fixes: unnecessary parentheses removed in hal/bb_cfg.c
This is checkpatch fixes for hal/bb_cfg.c file: unnecessary parentheses around . Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index 6042c1a..167b6a0 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -594,10 +594,10 @@ static void rtl88e_phy_init_bb_rf_register_definition(struct adapter *Adapter) struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter); struct bb_reg_def *reg[4]; - reg[RF_PATH_A] = &(hal_data->PHYRegDef[RF_PATH_A]); - reg[RF_PATH_B] = &(hal_data->PHYRegDef[RF_PATH_B]); - reg[RF_PATH_C] = &(hal_data->PHYRegDef[RF_PATH_C]); - reg[RF_PATH_D] = &(hal_data->PHYRegDef[RF_PATH_D]); + reg[RF_PATH_A] = &hal_data->PHYRegDef[RF_PATH_A]; + reg[RF_PATH_B] = &hal_data->PHYRegDef[RF_PATH_B]; + reg[RF_PATH_C] = &hal_data->PHYRegDef[RF_PATH_C]; + reg[RF_PATH_D] = &hal_data->PHYRegDef[RF_PATH_D]; reg[RF_PATH_A]->rfintfs = rFPGA0_XAB_RFInterfaceSW; reg[RF_PATH_B]->rfintfs = rFPGA0_XAB_RFInterfaceSW; -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/21] staging: rtl8188eu: pwrGrpCnt variable removed in store_pwrindex_offset function
This variable used only once in the beginning of the function, it can be removed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c index ebb37ed..f58a822 100644 --- a/drivers/staging/rtl8188eu/hal/bb_cfg.c +++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c @@ -504,9 +504,8 @@ static void store_pwrindex_offset(struct adapter *adapter, u32 regaddr, u32 bitmask, u32 data) { struct hal_data_8188e *hal_data = GET_HAL_DATA(adapter); - u8 pwrGrpCnt = hal_data->pwrGroupCnt; u32 * const power_level_offset = - hal_data->MCSTxPowerLevelOriginalOffset[pwrGrpCnt]; + hal_data->MCSTxPowerLevelOriginalOffset[hal_data->pwrGroupCnt]; if (regaddr == rTxAGC_A_Rate18_06) power_level_offset[0] = data; -- 2.4.10 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: wilc1000: Remove reference preceded by free
This patch is to the wilc_wfi_cfgoperations.c file that fixes up following error reported by coccicheck: ERROR: reference preceded by free on line 1219 For (params->seq_len) <= 0 memory is already freed when (params->seq_len) >0 then memory was alloted. So there is no need to use kfree whenever params->seq_len <=0 remove it and place kfree inside (params->seq_len) >0 condition. Signed-off-by: Punit Vara --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index bcbf1bd..9b3cf04 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1216,11 +1216,10 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, priv->wilc_ptk[key_index]->key = kmalloc(params->key_len, GFP_KERNEL); - kfree(priv->wilc_ptk[key_index]->seq); - - if ((params->seq_len) > 0) + if ((params->seq_len) > 0) { + kfree(priv->wilc_ptk[key_index]->seq); priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL); - + } if (INFO) { for (i = 0; i < params->key_len; i++) PRINT_INFO(CFG80211_DBG, "Adding pairwise key value[%d] = %x\n", i, params->key[i]); -- 2.5.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] Staging: wilc1000: Remove comparision of field address to NULL
This is patch to the linux_wlan file that fixes up following error reported by coccicheck : ERROR: test of a variable/field address Signed-off-by: Punit Vara --- drivers/staging/wilc1000/linux_wlan.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index b879b8b..1b0f89c 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -907,7 +907,7 @@ void wilc1000_wlan_deinit(struct wilc *nic) disable_sdio_interrupt(); mutex_unlock(&g_linux_wlan->hif_cs); #endif - if (&g_linux_wlan->txq_event != NULL) + if (!(&g_linux_wlan->txq_event)) up(&g_linux_wlan->txq_event); PRINT_D(INIT_DBG, "Deinitializing Threads\n"); @@ -969,10 +969,10 @@ static int wlan_deinit_locks(struct wilc *nic) { PRINT_D(INIT_DBG, "De-Initializing Locks\n"); - if (&g_linux_wlan->hif_cs != NULL) + if (!(&g_linux_wlan->hif_cs)) mutex_destroy(&g_linux_wlan->hif_cs); - if (&g_linux_wlan->rxq_cs != NULL) + if (!(&g_linux_wlan->rxq_cs)) mutex_destroy(&g_linux_wlan->rxq_cs); return 0; @@ -1037,7 +1037,7 @@ static void wlan_deinitialize_threads(struct wilc *nic) g_linux_wlan->close = 1; PRINT_D(INIT_DBG, "Deinitializing Threads\n"); - if (&g_linux_wlan->txq_event != NULL) + if (!(&g_linux_wlan->txq_event)) up(&g_linux_wlan->txq_event); if (g_linux_wlan->txq_thread != NULL) { -- 2.5.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] Staging: wilc1000: Remove coccicheck warnings and error
Punit Vara (3): staging: wilc1000: Remove reference preceded by free Staging: wilc1000: Remove comparision of field address to NULL Staging: wilc1000: Remove boolean comparision drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/linux_wlan.c | 8 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 7 +++ 3 files changed, 9 insertions(+), 10 deletions(-) -- 2.5.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] Staging: wilc1000: Remove boolean comparision
This patch is to the host_interface.c file that fixes up following warning reported by coccicheck: WARNING: Comparison to bool Boolean tests do not need explicit comparison to true or false Signed-off-by: Punit Vara --- drivers/staging/wilc1000/host_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 38fead4..09a6c98 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1440,7 +1440,7 @@ static s32 Handle_RcvdNtwrkInfo(struct host_if_drv *hif_drv, } } - if (bNewNtwrkFound == true) { + if (bNewNtwrkFound) { PRINT_D(HOSTINF_DBG, "New network found\n"); if (hif_drv->strWILC_UsrScanReq.u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) { @@ -2714,7 +2714,7 @@ static void Handle_PowerManagement(struct host_if_drv *hif_drv, strWID.id = (u16)WID_POWER_MANAGEMENT; - if (strPowerMgmtParam->enabled == true) + if (strPowerMgmtParam->enabled) s8PowerMode = MIN_FAST_PS; else s8PowerMode = NO_POWERSAVE; -- 2.5.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 7/7] staging: lustre: remove container_of0 and __container_of
Hi Aya, [auto build test ERROR on staging/staging-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base] url: https://github.com/0day-ci/linux/commits/Aya-Mahfouz/staging-lustre-remove-uses-and-definition-of-container_of0/20151014-062751 config: x86_64-randconfig-s2-10250612 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): In file included from drivers/staging/lustre/lustre/fid/../include/lustre_net.h:65:0, from drivers/staging/lustre/lustre/fid/../include/lustre_lib.h:64, from drivers/staging/lustre/lustre/fid/../include/obd.h:52, from drivers/staging/lustre/lustre/fid/fid_request.c:48: drivers/staging/lustre/lustre/fid/../include/lu_object.h: In function 'lu_object_top': >> drivers/staging/lustre/lustre/fid/../include/lu_object.h:737:9: error: >> implicit declaration of function 'container_of0' >> [-Werror=implicit-function-declaration] return container_of0(h->loh_layers.next, struct lu_object, lo_linkage); ^ >> drivers/staging/lustre/lustre/fid/../include/lu_object.h:737:43: error: >> expected expression before 'struct' return container_of0(h->loh_layers.next, struct lu_object, lo_linkage); ^ drivers/staging/lustre/lustre/fid/../include/lu_object.h: In function 'lu_object_next': drivers/staging/lustre/lustre/fid/../include/lu_object.h:745:43: error: expected expression before 'struct' return container_of0(o->lo_linkage.next, struct lu_object, lo_linkage); ^ cc1: some warnings being treated as errors -- In file included from drivers/staging/lustre/lustre/fld/../include/lustre_net.h:65:0, from drivers/staging/lustre/lustre/fld/../include/lustre_lib.h:64, from drivers/staging/lustre/lustre/fld/../include/obd.h:52, from drivers/staging/lustre/lustre/fld/fld_request.c:49: drivers/staging/lustre/lustre/fld/../include/lu_object.h: In function 'lu_object_top': >> drivers/staging/lustre/lustre/fld/../include/lu_object.h:737:9: error: >> implicit declaration of function 'container_of0' >> [-Werror=implicit-function-declaration] return container_of0(h->loh_layers.next, struct lu_object, lo_linkage); ^ >> drivers/staging/lustre/lustre/fld/../include/lu_object.h:737:43: error: >> expected expression before 'struct' return container_of0(h->loh_layers.next, struct lu_object, lo_linkage); ^ drivers/staging/lustre/lustre/fld/../include/lu_object.h: In function 'lu_object_next': drivers/staging/lustre/lustre/fld/../include/lu_object.h:745:43: error: expected expression before 'struct' return container_of0(o->lo_linkage.next, struct lu_object, lo_linkage); ^ cc1: some warnings being treated as errors -- In file included from drivers/staging/lustre/lustre/llite/../include/linux/../lustre_net.h:65:0, from drivers/staging/lustre/lustre/llite/../include/linux/../obd_class.h:41, from drivers/staging/lustre/lustre/llite/../include/linux/lustre_lite.h:47, from drivers/staging/lustre/lustre/llite/../include/lustre_lite.h:45, from drivers/staging/lustre/lustre/llite/dcache.c:44: drivers/staging/lustre/lustre/llite/../include/linux/../lu_object.h: In function 'lu_object_top': >> drivers/staging/lustre/lustre/llite/../include/linux/../lu_object.h:737:9: >> error: implicit declaration of function 'container_of0' >> [-Werror=implicit-function-declaration] return container_of0(h->loh_layers.next, struct lu_object, lo_linkage); ^ >> drivers/staging/lustre/lustre/llite/../include/linux/../lu_object.h:737:43: >> error: expected expression before 'struct' return container_of0(h->loh_layers.next, struct lu_object, lo_linkage); ^ drivers/staging/lustre/lustre/llite/../include/linux/../lu_object.h: In function 'lu_object_next': drivers/staging/lustre/lustre/llite/../include/linux/../lu_object.h:745:43: error: expected expression before 'struct' return container_of0(o->lo_linkage.next, struct lu_object, lo_linkage); ^ In file included from drivers/staging/lustre/lustre/llite/llite_internal.h:45:0, from drivers/staging/lustre/lustre/llite/dcache.c:48: drivers/staging/lustre/lustre/llite/../include/cl_object.h: In function 'lu2cl_dev': >> drivers/staging/lustre/lustre/llite/../include/cl_object.h:2657:26: error: >> expected expression before 'struct' return container_of0(d, struct cl_device, cd_lu_dev); ^ drivers/stag