[PATCH] staging: rtl8723bs: fix line over 80 characters
Fix line over 80 characters by replacing tab with space. Signed-off-by: Michael Straube --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 3e7c1f07b8b4..edb678190b4b 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -36,7 +36,7 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) INIT_LIST_HEAD(&psta_xmitpriv->apsd); } -s32_rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) +s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) { int i; struct xmit_buf *pxmitbuf; -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: rtl8192u: Prune the rtl819x_HT.h file of unused definitions.
On 29 June 2018 19:10:07 BST, John Whitmore wrote: >There are two files named "rtl819x_HT.h" > >$ find . -name rtl819x_HT.h -print >./drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h >./drivers/staging/rtl8192e/rtl819x_HT.h > >The two files are very similar but differ slightly. Unsed definitions >have >been removed from "drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h" as >a first >step towards possibly merging the two files into one. Just delete the lines if they are unused. Don't worry about commenting them out. That way it is easier to visually diff the patches for review. (Plus, the previous code is never lost in the git tree, anyway) :-) Justin ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: fix comparsion to true/false and brace issues
Use if(x) and if(!x) instead of comparsion to true/false. Reported by checkpatch. Remove unrequired braces from single if else statements. Add missing space after else: else{ -> else { Signed-off-by: Michael Straube --- drivers/staging/rtl8723bs/core/rtw_btcoex.c | 13 ++--- drivers/staging/rtl8723bs/core/rtw_efuse.c | 5 ++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_btcoex.c b/drivers/staging/rtl8723bs/core/rtw_btcoex.c index adac915a2153..922628c59f80 100644 --- a/drivers/staging/rtl8723bs/core/rtw_btcoex.c +++ b/drivers/staging/rtl8723bs/core/rtw_btcoex.c @@ -77,14 +77,14 @@ void rtw_btcoex_SuspendNotify(struct adapter *padapter, u8 state) void rtw_btcoex_HaltNotify(struct adapter *padapter) { - if (false == padapter->bup) { + if (!padapter->bup) { DBG_871X(FUNC_ADPT_FMT ": bup =%d Skip!\n", FUNC_ADPT_ARG(padapter), padapter->bup); return; } - if (true == padapter->bSurpriseRemoved) { + if (padapter->bSurpriseRemoved) { DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved =%d Skip!\n", FUNC_ADPT_ARG(padapter), padapter->bSurpriseRemoved); @@ -115,11 +115,10 @@ s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter) void rtw_btcoex_SetManualControl(struct adapter *padapter, u8 manual) { - if (true == manual) { + if (manual) hal_btcoex_SetManualControl(padapter, true); - } else{ + else hal_btcoex_SetManualControl(padapter, false); - } } u8 rtw_btcoex_IsBtControlLps(struct adapter *padapter) @@ -198,11 +197,11 @@ void rtw_btcoex_RejectApAggregatedPacket(struct adapter *padapter, u8 enable) pmlmeinfo = &padapter->mlmeextpriv.mlmext_info; psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv)); - if (true == enable) { + if (enable) { pmlmeinfo->accept_addba_req = false; if (psta) send_delba(padapter, 0, psta->hwaddr); - } else{ + } else { pmlmeinfo->accept_addba_req = true; } } diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c index c306ad7e395c..b3247c9642ea 100644 --- a/drivers/staging/rtl8723bs/core/rtw_efuse.c +++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c @@ -580,11 +580,10 @@ void EFUSE_ShadowMapUpdate( EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, bPseudoTest); - if (pEEPROM->bautoload_fail_flag == true) { + if (pEEPROM->bautoload_fail_flag) memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen); - } else{ + else Efuse_ReadAllMap(padapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest); - } /* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */ /* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */ -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723bs: fix comparsion to true/false and brace issues
On Jun 30 2018, Michael Straube wrote: > @@ -115,11 +115,10 @@ s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter > *padapter) > > void rtw_btcoex_SetManualControl(struct adapter *padapter, u8 manual) > { > - if (true == manual) { > + if (manual) > hal_btcoex_SetManualControl(padapter, true); > - } else{ > + else > hal_btcoex_SetManualControl(padapter, false); > - } aka. hal_btcoex_SetManualControl(padapter, manual); Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723bs: fix comparsion to true/false and brace issues
On 06/30/18 12:08, Andreas Schwab wrote: On Jun 30 2018, Michael Straube wrote: @@ -115,11 +115,10 @@ s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter) void rtw_btcoex_SetManualControl(struct adapter *padapter, u8 manual) { - if (true == manual) { + if (manual) hal_btcoex_SetManualControl(padapter, true); - } else{ + else hal_btcoex_SetManualControl(padapter, false); - } aka. hal_btcoex_SetManualControl(padapter, manual); Andreas. Ah, thanks! Michael ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: rtl8723bs: simplify if else statement
Simplify if else statement to a single function call by passing the variable. Suggested-by: Andreas Schwab Signed-off-by: Michael Straube --- drivers/staging/rtl8723bs/core/rtw_btcoex.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_btcoex.c b/drivers/staging/rtl8723bs/core/rtw_btcoex.c index e56502e301ec..35310e8e0806 100644 --- a/drivers/staging/rtl8723bs/core/rtw_btcoex.c +++ b/drivers/staging/rtl8723bs/core/rtw_btcoex.c @@ -115,11 +115,7 @@ s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(struct adapter *padapter) void rtw_btcoex_SetManualControl(struct adapter *padapter, u8 manual) { - if (true == manual) { - hal_btcoex_SetManualControl(padapter, true); - } else{ - hal_btcoex_SetManualControl(padapter, false); - } + hal_btcoex_SetManualControl(padapter, manual); } u8 rtw_btcoex_IsBtControlLps(struct adapter *padapter) -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: rtl8723bs: fix comparsion to true/false and brace issues
Use if(x) and if(!x) instead of comparsion to true/false. Reported by checkpatch. Remove unrequired braces from single if else statement. Add missing space after else: else{ -> else { Signed-off-by: Michael Straube --- drivers/staging/rtl8723bs/core/rtw_btcoex.c | 8 drivers/staging/rtl8723bs/core/rtw_efuse.c | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_btcoex.c b/drivers/staging/rtl8723bs/core/rtw_btcoex.c index adac915a2153..e56502e301ec 100644 --- a/drivers/staging/rtl8723bs/core/rtw_btcoex.c +++ b/drivers/staging/rtl8723bs/core/rtw_btcoex.c @@ -77,14 +77,14 @@ void rtw_btcoex_SuspendNotify(struct adapter *padapter, u8 state) void rtw_btcoex_HaltNotify(struct adapter *padapter) { - if (false == padapter->bup) { + if (!padapter->bup) { DBG_871X(FUNC_ADPT_FMT ": bup =%d Skip!\n", FUNC_ADPT_ARG(padapter), padapter->bup); return; } - if (true == padapter->bSurpriseRemoved) { + if (padapter->bSurpriseRemoved) { DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved =%d Skip!\n", FUNC_ADPT_ARG(padapter), padapter->bSurpriseRemoved); @@ -198,11 +198,11 @@ void rtw_btcoex_RejectApAggregatedPacket(struct adapter *padapter, u8 enable) pmlmeinfo = &padapter->mlmeextpriv.mlmext_info; psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv)); - if (true == enable) { + if (enable) { pmlmeinfo->accept_addba_req = false; if (psta) send_delba(padapter, 0, psta->hwaddr); - } else{ + } else { pmlmeinfo->accept_addba_req = true; } } diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c index c306ad7e395c..b3247c9642ea 100644 --- a/drivers/staging/rtl8723bs/core/rtw_efuse.c +++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c @@ -580,11 +580,10 @@ void EFUSE_ShadowMapUpdate( EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, bPseudoTest); - if (pEEPROM->bautoload_fail_flag == true) { + if (pEEPROM->bautoload_fail_flag) memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen); - } else{ + else Efuse_ReadAllMap(padapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest); - } /* PlatformMoveMemory((void *)&pHalData->EfuseMap[EFUSE_MODIFY_MAP][0], */ /* void *)&pHalData->EfuseMap[EFUSE_INIT_MAP][0], mapLen); */ -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH net] hv_netvsc: split sub-channel setup into async and sync
From: Haiyang Zhang Date: Fri, 29 Jun 2018 14:07:16 -0700 > From: Stephen Hemminger > > When doing device hotplug the sub channel must be async to avoid > deadlock issues because device is discovered in softirq context. > > When doing changes to MTU and number of channels, the setup > must be synchronous to avoid races such as when MTU and device > settings are done in a single ip command. > > Reported-by: Thomas Walker > Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug") > Fixes: 732e49850c5e ("netvsc: fix race on sub channel creation") > Signed-off-by: Stephen Hemminger > Signed-off-by: Haiyang Zhang Applied and queued up for -stable. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: remove rtw_ioctl_rtl.h
The header rtw_ioctl_rtl.h is not used anywhere. Running 'grep -r rtw_ioctl_rtl *' from kernel root directory returns nothing, remove the file. Signed-off-by: Michael Straube --- .../staging/rtl8188eu/include/rtw_ioctl_rtl.h | 66 --- 1 file changed, 66 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/include/rtw_ioctl_rtl.h diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl_rtl.h b/drivers/staging/rtl8188eu/include/rtw_ioctl_rtl.h deleted file mode 100644 index e29ebfd40a58.. --- a/drivers/staging/rtl8188eu/include/rtw_ioctl_rtl.h +++ /dev/null @@ -1,66 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - **/ -#ifndef _RTW_IOCTL_RTL_H_ -#define _RTW_IOCTL_RTL_H_ - -#include -#include - -/* oid_rtl_seg_01_01 ** */ -int oid_rt_get_signal_quality_hdl(struct oid_par_priv *poid_par_priv);/* 84 */ -int oid_rt_get_small_packet_crc_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_large_packet_crc_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_tx_retry_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_rx_retry_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_rx_total_packet_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv *poid_par_priv); - -int oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv *poid_par_priv);/* 8a */ -int oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv *poid_par_priv); /* 8b */ - -int oid_rt_get_rx_icv_err_hdl(struct oid_par_priv *poid_par_priv);/* 93 */ -int oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_preamble_mode_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_ap_ip_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_channelplan_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_set_channelplan_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_set_preamble_mode_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_set_bcn_intvl_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_dedicate_probe_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_current_tx_power_level_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_channel_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_key_mismatch_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_supported_wireless_mode_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_channel_list_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_scan_in_progress_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_forced_data_rate_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv *poid_par_priv); - -/* oid_rtl_seg_01_03 section start ** */ -int oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv *priv); -int oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_ap_supported_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_ap_set_passphrase_hdl(struct oid_par_priv *poid_par_priv); - -/* oid_rtl_seg_01_11 */ -int oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv *poid_par_priv); - -/* oid_rtl_seg_03_00 section start ** */ -int oid_rt_get_connect_state_hdl(struct oid_par_priv *poid_par_priv); -int oid_rt_set_default_key_id_hdl(struct oid_par_priv *poid_par_priv); - -#endif -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames
Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. --- v2: - refactor error handling. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_security.c | 82 +++ 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c index 5b8d7288a4e7..a01290467c64 100644 --- a/drivers/staging/rtl8188eu/core/rtw_security.c +++ b/drivers/staging/rtl8188eu/core/rtw_security.c @@ -131,60 +131,72 @@ static __le32 getcrc32(u8 *buf, int len) Need to consider the fragment situation */ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) -{ /* exclude ICV */ - - unsigned char crc[4]; - struct arc4context mycontext; - +{ int curfragnum, length; - u32 keylength; - - u8 *pframe, *payload, *iv;/* wepkey */ - u8 wepkey[16]; - u8 hw_hdr_offset = 0; + u8 *pframe; + u8 hw_hdr_offset = 0; struct pkt_attrib *pattrib = &((struct xmit_frame *)pxmitframe)->attrib; struct security_priv *psecuritypriv = &padapter->securitypriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - + const int keyindex = psecuritypriv->dot11PrivacyKeyIndex; + void *crypto_private; + struct sk_buff *skb; + struct lib80211_crypto_ops *crypto_ops; if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL) return; + if ((pattrib->encrypt != _WEP40_) && (pattrib->encrypt != _WEP104_)) + return; + hw_hdr_offset = TXDESC_SIZE + (((struct xmit_frame *)pxmitframe)->pkt_offset * PACKET_OFFSET_SZ); pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset; - /* start to encrypt each fragment */ - if ((pattrib->encrypt == _WEP40_) || (pattrib->encrypt == _WEP104_)) { - keylength = psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex]; + crypto_ops = try_then_request_module(lib80211_get_crypto_ops("WEP"), "lib80211_crypt_wep"); - for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) { - iv = pframe+pattrib->hdrlen; - memcpy(&wepkey[0], iv, 3); - memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); - payload = pframe+pattrib->iv_len+pattrib->hdrlen; + if (!crypto_ops) + return; - if ((curfragnum+1) == pattrib->nr_frags) { /* the last fragment */ - length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len; + crypto_private = crypto_ops->init(keyindex); + if (!crypto_private) + return; - *((__le32 *)crc) = getcrc32(payload, length); + if (crypto_ops->set_key(psecuritypriv->dot11DefKey[keyindex].skey, + psecuritypriv->dot11DefKeylen[keyindex], NULL, crypto_private) < 0) + goto free_crypto_private; - arcfour_init(&mycontext, wepkey, 3+keylength); - arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload+length, crc, 4); - } else { - length = pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len; - *((__le32 *)crc) = getcrc32(payload, length); - arcfour_init(&mycontext, wepkey, 3+keylength); - arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload+length, crc, 4); - - pframe += pxmitpriv->frag_len; - pframe = (u8 *)round_up((size_t)(pframe), 4); - } + for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) { + if (curfragnum + 1 == pattrib->nr_frags) + length = pattrib->last_txcmdsz; + else + length = pxmitpriv->frag_len; + skb = dev_alloc_skb(length); + if (!skb) + goto free_crypto_private; + + skb_put_data(skb, pframe, length); + + memmove(skb->data + 4, skb->data, pattrib->hdrlen); + skb_pull(skb, 4); + skb_trim(skb, skb->len - 4); + + if (crypto_ops->encrypt_mpdu(skb, pattrib->hdrlen, crypto_private)) { + kfree_skb(skb); + goto free_crypto_private; } + + memcpy(pframe, skb->data, skb->len); + +
[PATCH 2/2] NETLOGIC: Kconfig: Fixed help and coding style warnings
Fixed Coding style issues Signed-off-by: Tamir Suliman --- drivers/staging/netlogic/Kconfig | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/netlogic/Kconfig b/drivers/staging/netlogic/Kconfig index d660de5..6e8e56a 100644 --- a/drivers/staging/netlogic/Kconfig +++ b/drivers/staging/netlogic/Kconfig @@ -2,6 +2,8 @@ config NETLOGIC_XLR_NET tristate "Netlogic XLR/XLS network device" depends on CPU_XLR select PHYLIB - ---help--- + help This driver support Netlogic XLR/XLS on chip gigabit - Ethernet. + Ethernet.The XLR/XLS NAE blocks can be configured as one 10G + interface or four 1G interfaces. This driver supports blocks + with 1G ports. -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] FBTFT: fb_sh: Fix alignment and style problems Fixed Coding style issues Signed-off-by: Tamir Suliman
--- drivers/staging/fbtft/fb_sh1106.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/fbtft/fb_sh1106.c b/drivers/staging/fbtft/fb_sh1106.c index 3fc18c0..c18763b 100644 --- a/drivers/staging/fbtft/fb_sh1106.c +++ b/drivers/staging/fbtft/fb_sh1106.c @@ -36,27 +36,27 @@ static int init_display(struct fbtft_par *par) par->fbtftops.reset(par); /* Set Display OFF */ - write_reg(par, 0xAE); + write_reg(par, 0xAE); /* Set Display Clock Divide Ratio/ Oscillator Frequency */ - write_reg(par, 0xD5, 0x80); + write_reg(par, 0xD5, 0x80); /* Set Multiplex Ratio */ - write_reg(par, 0xA8, par->info->var.yres - 1); + write_reg(par, 0xA8, par->info->var.yres - 1); /* Set Display Offset */ - write_reg(par, 0xD3, 0x00); + write_reg(par, 0xD3, 0x00); /* Set Display Start Line */ - write_reg(par, 0x40 | 0x0); + write_reg(par, 0x40 | 0x0); /* Set Segment Re-map */ /* column address 127 is mapped to SEG0 */ - write_reg(par, 0xA0 | 0x1); + write_reg(par, 0xA0 | 0x1); /* Set COM Output Scan Direction */ /* remapped mode. Scan from COM[N-1] to COM0 */ - write_reg(par, 0xC8); + write_reg(par, 0xC8); /* Set COM Pins Hardware Configuration */ if (par->info->var.yres == 64) @@ -70,15 +70,15 @@ static int init_display(struct fbtft_par *par) write_reg(par, 0xDA, 0x02); /* Set Pre-charge Period */ - write_reg(par, 0xD9, 0xF1); + write_reg(par, 0xD9, 0xF1); /* Set VCOMH Deselect Level */ - write_reg(par, 0xDB, 0x40); + write_reg(par, 0xDB, 0x40); /* Set Display ON */ - write_reg(par, 0xAF); + write_reg(par, 0xAF); - msleep(150); + msleep(150); return 0; } @@ -89,8 +89,8 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) static int blank(struct fbtft_par *par, bool on) { - fbtft_par_dbg(DEBUG_BLANK, par, "%s(blank=%s)\n", - __func__, on ? "true" : "false"); + fbtft_par_dbg(DEBUG_BLANK, par, "%s(_func_=%s)\n", + __func__, on ? "true" : "false"); write_reg(par, on ? 0xAE : 0xAF); -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] NETLOGIC: Kconfig: Fixed help and coding style warnings
On Sat, Jun 30, 2018 at 02:30:44PM +, Tamir Suliman wrote: > Fixed Coding style issues > > Signed-off-by: Tamir Suliman > --- > drivers/staging/netlogic/Kconfig | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/netlogic/Kconfig > b/drivers/staging/netlogic/Kconfig > index d660de5..6e8e56a 100644 > --- a/drivers/staging/netlogic/Kconfig > +++ b/drivers/staging/netlogic/Kconfig > @@ -2,6 +2,8 @@ config NETLOGIC_XLR_NET > tristate "Netlogic XLR/XLS network device" > depends on CPU_XLR > select PHYLIB > - ---help--- > + help > This driver support Netlogic XLR/XLS on chip gigabit > - Ethernet. > + Ethernet.The XLR/XLS NAE blocks can be configured as one 10G > + interface or four 1G interfaces. This driver supports blocks > + with 1G ports. > -- > 1.8.3.1 Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change. - You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] FBTFT: fb_sh: Fix alignment and style problems Fixed Coding style issues Signed-off-by: Tamir Suliman
On Sat, Jun 30, 2018 at 02:32:39PM +, Tamir Suliman wrote: > --- > drivers/staging/fbtft/fb_sh1106.c | 26 +- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/fbtft/fb_sh1106.c > b/drivers/staging/fbtft/fb_sh1106.c > index 3fc18c0..c18763b 100644 > --- a/drivers/staging/fbtft/fb_sh1106.c > +++ b/drivers/staging/fbtft/fb_sh1106.c > @@ -36,27 +36,27 @@ static int init_display(struct fbtft_par *par) > par->fbtftops.reset(par); > > /* Set Display OFF */ > - write_reg(par, 0xAE); > + write_reg(par, 0xAE); > > /* Set Display Clock Divide Ratio/ Oscillator Frequency */ > - write_reg(par, 0xD5, 0x80); > + write_reg(par, 0xD5, 0x80); > > /* Set Multiplex Ratio */ > - write_reg(par, 0xA8, par->info->var.yres - 1); > + write_reg(par, 0xA8, par->info->var.yres - 1); > > /* Set Display Offset */ > - write_reg(par, 0xD3, 0x00); > + write_reg(par, 0xD3, 0x00); > > /* Set Display Start Line */ > - write_reg(par, 0x40 | 0x0); > + write_reg(par, 0x40 | 0x0); > > /* Set Segment Re-map */ > /* column address 127 is mapped to SEG0 */ > - write_reg(par, 0xA0 | 0x1); > + write_reg(par, 0xA0 | 0x1); > > /* Set COM Output Scan Direction */ > /* remapped mode. Scan from COM[N-1] to COM0 */ > - write_reg(par, 0xC8); > + write_reg(par, 0xC8); > > /* Set COM Pins Hardware Configuration */ > if (par->info->var.yres == 64) > @@ -70,15 +70,15 @@ static int init_display(struct fbtft_par *par) > write_reg(par, 0xDA, 0x02); > > /* Set Pre-charge Period */ > - write_reg(par, 0xD9, 0xF1); > + write_reg(par, 0xD9, 0xF1); > > /* Set VCOMH Deselect Level */ > - write_reg(par, 0xDB, 0x40); > + write_reg(par, 0xDB, 0x40); > > /* Set Display ON */ > - write_reg(par, 0xAF); > + write_reg(par, 0xAF); > > - msleep(150); > + msleep(150); > > return 0; > } > @@ -89,8 +89,8 @@ static void set_addr_win(struct fbtft_par *par, int xs, int > ys, int xe, int ye) > > static int blank(struct fbtft_par *par, bool on) > { > - fbtft_par_dbg(DEBUG_BLANK, par, "%s(blank=%s)\n", > - __func__, on ? "true" : "false"); > + fbtft_par_dbg(DEBUG_BLANK, par, "%s(_func_=%s)\n", > + __func__, on ? "true" : "false"); > > write_reg(par, on ? 0xAE : 0xAF); > > -- > 1.8.3.1 Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - Your patch does not have a Signed-off-by: line. Please read the kernel file, Documentation/SubmittingPatches and resend it after adding that line. Note, the line needs to be in the body of the email, before the patch, not at the bottom of the patch or in the email signature. - Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause. - You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change. - You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] FBTFT: fb_sh: Fix alignment and style problems Fixed Coding style issues Signed-off-by: Tamir Suliman
On Sat, 2018-06-30 at 14:32 +, Tamir Suliman wrote: > --- > drivers/staging/fbtft/fb_sh1106.c | 26 +- > 1 file changed, 13 insertions(+), 13 deletions(-) Adding to what Greg's patchbot already wrote: > diff --git a/drivers/staging/fbtft/fb_sh1106.c > b/drivers/staging/fbtft/fb_sh1106.c [] > @@ -36,27 +36,27 @@ static int init_display(struct fbtft_par *par) > par->fbtftops.reset(par); > > /* Set Display OFF */ > - write_reg(par, 0xAE); > + write_reg(par, 0xAE); Nope. You are overly indenting already correctly indented code. Statements start in the same column unless following an if/for/do/while/else/case. > @@ -89,8 +89,8 @@ static void set_addr_win(struct fbtft_par *par, int xs, int > ys, int xe, int ye) > > static int blank(struct fbtft_par *par, bool on) > { > - fbtft_par_dbg(DEBUG_BLANK, par, "%s(blank=%s)\n", > - __func__, on ? "true" : "false"); > + fbtft_par_dbg(DEBUG_BLANK, par, "%s(_func_=%s)\n", > + __func__, on ? "true" : "false"); Again, nope. Here you are misaligning a multi-line continuation which is correctly aligned to the open parenthesis. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: mt7621-pinctrl: Replaces "unsigned" with "unsigned int", fixes mixed indentation, and puts spaces after commas.
Signed-off-by: Peter Vernia --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 35 + 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 0c3e498..6894510 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -54,7 +54,7 @@ static int rt2880_get_group_count(struct pinctrl_dev *pctrldev) } static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev, -unsigned group) +unsigned int group) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); @@ -65,9 +65,9 @@ static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev, } static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev, -unsigned group, -const unsigned **pins, -unsigned *num_pins) +unsigned int group, +const unsigned int **pins, +unsigned int *num_pins) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); @@ -81,7 +81,8 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev, } static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev, - struct pinctrl_map *map, unsigned num_maps) + struct pinctrl_map *map, + unsigned int num_maps) { int i; @@ -94,7 +95,7 @@ static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev, static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev, struct seq_file *s, - unsigned offset) + unsigned int offset) { seq_printf(s, "ralink pio"); } @@ -103,7 +104,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, struct device_node *np, struct pinctrl_map **map) { -const char *function; + const char *function; int func = of_property_read_string(np, "ralink,function", &function); int grps = of_property_count_strings(np, "ralink,group"); int i; @@ -112,7 +113,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, return; for (i = 0; i < grps; i++) { - const char *group; + const char *group; of_property_read_string_index(np, "ralink,group", i, &group); @@ -127,7 +128,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev, struct device_node *np_config, struct pinctrl_map **map, - unsigned *num_maps) + unsigned int *num_maps) { int max_maps = 0; struct pinctrl_map *tmp; @@ -173,7 +174,7 @@ static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev) } static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev, -unsigned func) +unsigned int func) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); @@ -181,7 +182,7 @@ static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev, } static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev, - unsigned func, + unsigned int func, const char * const **groups, unsigned * const num_groups) { @@ -198,11 +199,11 @@ static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev, } static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev, - unsigned func, - unsigned group) + unsigned int func, + unsigned int group) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); -u32 mode = 0; + u32 mode = 0; u32 reg = SYSC_REG_GPIO_MODE; int i; int shift; @@ -243,7 +244,7 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev, static int rt2880_pmx_group_gpio_request_enable(struct pinctrl_dev *pctrldev, struct pinctrl_gpio_range *range, - unsigned pin) + unsigned int pin) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); @@ -355,13 +356,13 @@ static
Re: [PATCH v2] staging:iio:impedance-analyzer:ad5933: Macro replacement Cleanups.
On Mon, 25 Jun 2018 21:11:23 +0200 Karim Eshapa wrote: > Doing some macro replacement to start an array of structures > so it can be reused by manipulating it with different values. > > Signed-off-by: Karim Eshapa There are all sorts of issues with the ABI this driver is providing to userspace, but this isn't a bad bit of cleanup none the less. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > .../staging/iio/impedance-analyzer/ad5933.c | 57 +++ > 1 file changed, 19 insertions(+), 38 deletions(-) > > diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c > b/drivers/staging/iio/impedance-analyzer/ad5933.c > index 3bcf49466361..14df89510396 100644 > --- a/drivers/staging/iio/impedance-analyzer/ad5933.c > +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c > @@ -116,45 +116,26 @@ static struct ad5933_platform_data ad5933_default_pdata > = { > .vref_mv = 3300, > }; > > +#define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \ > + _scan_index, _realbits) { \ > + .type = (_type), \ > + .extend_name = (_extend_name), \ > + .info_mask_separate = (_info_mask_separate), \ > + .address = (_address), \ > + .scan_index = (_scan_index), \ > + .scan_type = { \ > + .sign = 's', \ > + .realbits = (_realbits), \ > + .storagebits = 16, \ > + }, \ > +} > + > static const struct iio_chan_spec ad5933_channels[] = { > - { > - .type = IIO_TEMP, > - .indexed = 1, > - .channel = 0, > - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | > - BIT(IIO_CHAN_INFO_SCALE), > - .address = AD5933_REG_TEMP_DATA, > - .scan_index = -1, > - .scan_type = { > - .sign = 's', > - .realbits = 14, > - .storagebits = 16, > - }, > - }, { /* Ring Channels */ > - .type = IIO_VOLTAGE, > - .indexed = 1, > - .channel = 0, > - .extend_name = "real", > - .address = AD5933_REG_REAL_DATA, > - .scan_index = 0, > - .scan_type = { > - .sign = 's', > - .realbits = 16, > - .storagebits = 16, > - }, > - }, { > - .type = IIO_VOLTAGE, > - .indexed = 1, > - .channel = 0, > - .extend_name = "imag", > - .address = AD5933_REG_IMAG_DATA, > - .scan_index = 1, > - .scan_type = { > - .sign = 's', > - .realbits = 16, > - .storagebits = 16, > - }, > - }, > + AD5933_CHANNEL(IIO_TEMP, NULL, BIT(IIO_CHAN_INFO_RAW) | > + BIT(IIO_CHAN_INFO_SCALE), AD5933_REG_TEMP_DATA, -1, 14), > + /* Ring Channels */ > + AD5933_CHANNEL(IIO_VOLTAGE, "real", 0, AD5933_REG_REAL_DATA, 0, 16), > + AD5933_CHANNEL(IIO_VOLTAGE, "imag", 0, AD5933_REG_IMAG_DATA, 1, 16), > }; > > static int ad5933_i2c_write(struct i2c_client *client, u8 reg, u8 len, u8 > *data) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames
Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. Signed-off-by: Ivan Safonov --- v2: - refactor error handling, v3: - fix commit message. drivers/staging/rtl8188eu/core/rtw_security.c | 82 +++ 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c index 5b8d7288a4e7..a01290467c64 100644 --- a/drivers/staging/rtl8188eu/core/rtw_security.c +++ b/drivers/staging/rtl8188eu/core/rtw_security.c @@ -131,60 +131,72 @@ static __le32 getcrc32(u8 *buf, int len) Need to consider the fragment situation */ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) -{ /* exclude ICV */ - - unsigned char crc[4]; - struct arc4context mycontext; - +{ int curfragnum, length; - u32 keylength; - - u8 *pframe, *payload, *iv;/* wepkey */ - u8 wepkey[16]; - u8 hw_hdr_offset = 0; + u8 *pframe; + u8 hw_hdr_offset = 0; struct pkt_attrib *pattrib = &((struct xmit_frame *)pxmitframe)->attrib; struct security_priv *psecuritypriv = &padapter->securitypriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - + const int keyindex = psecuritypriv->dot11PrivacyKeyIndex; + void *crypto_private; + struct sk_buff *skb; + struct lib80211_crypto_ops *crypto_ops; if (((struct xmit_frame *)pxmitframe)->buf_addr == NULL) return; + if ((pattrib->encrypt != _WEP40_) && (pattrib->encrypt != _WEP104_)) + return; + hw_hdr_offset = TXDESC_SIZE + (((struct xmit_frame *)pxmitframe)->pkt_offset * PACKET_OFFSET_SZ); pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset; - /* start to encrypt each fragment */ - if ((pattrib->encrypt == _WEP40_) || (pattrib->encrypt == _WEP104_)) { - keylength = psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex]; + crypto_ops = try_then_request_module(lib80211_get_crypto_ops("WEP"), "lib80211_crypt_wep"); - for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) { - iv = pframe+pattrib->hdrlen; - memcpy(&wepkey[0], iv, 3); - memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); - payload = pframe+pattrib->iv_len+pattrib->hdrlen; + if (!crypto_ops) + return; - if ((curfragnum+1) == pattrib->nr_frags) { /* the last fragment */ - length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len; + crypto_private = crypto_ops->init(keyindex); + if (!crypto_private) + return; - *((__le32 *)crc) = getcrc32(payload, length); + if (crypto_ops->set_key(psecuritypriv->dot11DefKey[keyindex].skey, + psecuritypriv->dot11DefKeylen[keyindex], NULL, crypto_private) < 0) + goto free_crypto_private; - arcfour_init(&mycontext, wepkey, 3+keylength); - arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload+length, crc, 4); - } else { - length = pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len; - *((__le32 *)crc) = getcrc32(payload, length); - arcfour_init(&mycontext, wepkey, 3+keylength); - arcfour_encrypt(&mycontext, payload, payload, length); - arcfour_encrypt(&mycontext, payload+length, crc, 4); - - pframe += pxmitpriv->frag_len; - pframe = (u8 *)round_up((size_t)(pframe), 4); - } + for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) { + if (curfragnum + 1 == pattrib->nr_frags) + length = pattrib->last_txcmdsz; + else + length = pxmitpriv->frag_len; + skb = dev_alloc_skb(length); + if (!skb) + goto free_crypto_private; + + skb_put_data(skb, pframe, length); + + memmove(skb->data + 4, skb->data, pattrib->hdrlen); + skb_pull(skb, 4); + skb_trim(skb, skb->len - 4); + + if (crypto_ops->encrypt_mpdu(skb, pattrib->hdrlen, crypto_private)) { + kfree_skb(skb); + goto free_crypto_private; } + + memcpy(pframe, sk
RE: [PATCH] PCI: hv: Fix a __local_bh_enable_ip warning in hv_compose_msi_msg()
> From: Lorenzo Pieralisi > Sent: Friday, June 29, 2018 02:39 > To: Dexuan Cui > On Wed, Jun 13, 2018 at 10:50:05PM +, Dexuan Cui wrote: > > > From: Bjorn Helgaas > > > Sent: Wednesday, June 13, 2018 15:15 > > > > ... > > > > It looks Lorenzo's pci.git tree has not been updated for 3+ weeks. > > > > I guess Lorenzo may be on vacation. > > > > > > > > @Bjorn, can this patch go through your tree? > > > > Should I resubmit it? > > > > > > No need to resubmit it, Lorenzo has been out for a bit, but I'm sure > > > he'll pick this up as he catches up. > > OK, I see. Thanks! > > > > > You might, however, fix the commit log: > > > > > > This is not an issue because hv_pci_onchannelcallback() is not slow, > > > and it not a hot path. > > > > > > This has at least one typo (I think you mean "and *is* not a hot > > > path"). > > Sorry -- yes, it's a typo. I hope Lorenzo can help to fix this, or I can > > resubmit it if Lorenzo or you want me to do it. > > > > > I also don't understand the sentence as a whole because the > > > hv_pci_onchannelcallback() comment says it's called whenever the host > > > sends a packet to this channel, and that *does* sound like a hot path. > > Sorry for not making it clear. > > The host only sends a packet into the channel of the guest when there > > is a change of device configuration (i.e. hot add or remove a device), or > > the host is responding to the guest's request. > > > > The change of device configuration is only triggered on-demand by the > > administrator on the host, and the guest's requests are one-off when > > the device is probed. > > > > So IMO the callback is not a hot path. > > > > > I also don't understand the "hv_pci_onchannelcallback() is not slow" > > > part. In other words, you're saying hv_pci_onchannelcallback() is > > > fast and it's not a hot path. And apparently this has something to do > > > with the difference between local_bh_disable() and local_irq_save()? > > > > > > Bjorn > > Actually in my original internal version of the patch, I did use > > local_irq_save/restore(). > > > > hv_pci_onchannelcallback() itself runs fast, but here since it's in a > > loop (i.e. the while (!try_wait_for_completion(&comp.comp_pkt.host_event) > > loop), IIRC I was asked if I really need local_irq_save/restore(), > > and I answered "not really", so later I switched to > local_bh_disable()/enable(). > > > > However, recently I found that if we enable CONFIG_PROVE_LOCKING=y, > > the local_bh_enable() can trigger a warning because the function > > hv_compose_msi_msg() can be called with local IRQs disabled (BTW, > > hv_compose_msi_msg() can also be called with local IRQS enabled in > > another code path): > > > > IRQs not enabled as expected > > WARNING: CPU: 0 PID: 408 at kernel/softirq.c:162 __local_bh_enable_ip > > > > Despite the warning, the code itself can still work correctly, but IMO we'd > > better switch back to local_irq_save/restore(), and hence I made the patch. > > > > I hope the explanation sounds reasonable. :-) > > Sorry for the delay in replying. I need to understand if you are > preventing a spurious lockdep warning or you are fixing a kernel > bug. From your commit log, I assume the former option but I do > not think that's what you are really doing. Now my understanding is: 1) When hv_compose_msi_msg() is called with local irq ENABLED by the upper level irq code, the current code is good and the lockdep warning is not triggered. 2) When hv_compose_msi_msg() is called with local irq DISABLED by the upper level irq code, the current code *is* buggg: local_bh_enable() can potentially call do_softirq(), which is not supposed to run when local irq is DISABLED. I think the lockdep warning is triggered for this reason. In summary, now I realized the warning is not spurious, and here at the first place I should not use local_bh_disable()/enable(), which are not supposed to be used when local irq can be DISABLED. > Apart from the commit log typos fixes I would like a log that > explains *why* this is not a kernel bug fix rather than a harmless > lockdep warning prevention. > > Lorenzo Now I realized there *is* a bug. I'm going to send a v2 with a new changelog, though the changed code will remain the same. Thanks, -- Dexuan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: rtl8188eu: reorder switch cases and remove default break
Reorder the cases of a switch statement to be in ascending order. Remove unrequired break from default case. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/hal/hal_com.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c b/drivers/staging/rtl8188eu/hal/hal_com.c index b91902cdb34c..b2ea3d435af0 100644 --- a/drivers/staging/rtl8188eu/hal/hal_com.c +++ b/drivers/staging/rtl8188eu/hal/hal_com.c @@ -264,18 +264,17 @@ bool Hal_MappingOutPipe(struct adapter *adapter, u8 numoutpipe) bool result = true; switch (numoutpipe) { + case 1: + one_out_pipe(adapter); + break; case 2: two_out_pipe(adapter, wifi_cfg); break; case 3: three_out_pipe(adapter, wifi_cfg); break; - case 1: - one_out_pipe(adapter); - break; default: result = false; - break; } return result; } -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: rtl8188eu: fix block comments - coding style
Write multiple single line comments as block comments to follow kernel coding style and improve readability. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/hal/hal_com.c | 50 ++--- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c b/drivers/staging/rtl8188eu/hal/hal_com.c index ca26a4f4dd86..7202e1767fc0 100644 --- a/drivers/staging/rtl8188eu/hal/hal_com.c +++ b/drivers/staging/rtl8188eu/hal/hal_com.c @@ -189,11 +189,13 @@ static void two_out_pipe(struct adapter *adapter, bool wifi_cfg) { struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter); - if (wifi_cfg) { /* WMM */ - /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */ - /* 0, 1, 0, 1, 0, 0, 0,0,0}; */ - /* 0:H, 1:L */ - + if (wifi_cfg) { + /* +* WMM +* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA +* 0, 1, 0, 1, 0, 0, 0,0,0 +* 0:H, 1:L +*/ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];/* VO */ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */ @@ -203,12 +205,13 @@ static void two_out_pipe(struct adapter *adapter, bool wifi_cfg) pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */ - - } else {/* typical setting */ - /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */ - /* 1, 1, 0, 0, 0, 0, 0,0,0}; */ - /* 0:H, 1:L */ - + } else { + /* +* typical setting +* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA +* 1, 1, 0, 0, 0, 0, 0,0,0 +* 0:H, 1:L +*/ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];/* VI */ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];/* BE */ @@ -225,11 +228,13 @@ static void three_out_pipe(struct adapter *adapter, bool wifi_cfg) { struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapter); - if (wifi_cfg) {/* for WMM */ - /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */ - /* 1, 2, 1, 0, 0, 0, 0,0,0}; */ - /* 0:H, 1:N, 2:L */ - + if (wifi_cfg) { + /* +* for WMM +* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA +* 1, 2, 1, 0, 0, 0, 0,0,0 +* 0:H, 1:N, 2:L +*/ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */ @@ -239,12 +244,13 @@ static void three_out_pipe(struct adapter *adapter, bool wifi_cfg) pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];/* MGT */ pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];/* HIGH */ pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];/* TXCMD */ - - } else {/* typical setting */ - /* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */ - /* 2, 2, 1, 0, 0, 0, 0,0,0}; */ - /* 0:H, 1:N, 2:L */ - + } else { + /* +* typical setting +* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA +* 2, 2, 1, 0, 0, 0, 0,0,0 +* 0:H, 1:N, 2:L +*/ pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];/* VO */ pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];/* VI */ pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];/* BE */ -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: rtl8188eu: move return type to functions definition line
The return type of a function should be on the same line as the definition. Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/hal/hal_com.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c b/drivers/staging/rtl8188eu/hal/hal_com.c index b2ea3d435af0..ca26a4f4dd86 100644 --- a/drivers/staging/rtl8188eu/hal/hal_com.c +++ b/drivers/staging/rtl8188eu/hal/hal_com.c @@ -44,10 +44,10 @@ void dump_chip_info(struct HAL_VERSION chip_vers) #defineCHAN_PLAN_HW0x80 -u8 /* return the final channel plan decision */ -hal_com_get_channel_plan(struct adapter *padapter, u8 hw_channel_plan, -u8 sw_channel_plan, u8 def_channel_plan, -bool load_fail) +/* return the final channel plan decision */ +u8 hal_com_get_channel_plan(struct adapter *padapter, u8 hw_channel_plan, + u8 sw_channel_plan, u8 def_channel_plan, + bool load_fail) { u8 sw_cfg; u8 chnlplan; -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: mt7621-pinctrl: Replaces "unsigned" with "unsigned int", fixes mixed indentation, and puts spaces after commas.
On Sat, Jun 30, 2018 at 01:17:29PM -0400, Peter Vernia wrote: > Signed-off-by: Peter Vernia The subject is over 72 characters or whatever the limit is and there isn't a commit message. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel