aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-12-05staging: r8188eu: simplify update_sta_support_rate paramsMartin Kaiser1-1/+1
The update_sta_support_rate function takes a pointer to information elements and the total length of all these elements. Use our variables for pointer and length instead of calculating them manually. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: use ie buffer in update_beacon_infoMartin Kaiser3-10/+6
The update_beacon_info function parses information elements of a beacon message. It should take the pointer to the information elements and their total length, not the entire beacon message. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: pass only ies to process_p2p_ps_ieMartin Kaiser2-10/+10
The process_p2p_ps_ie function parses the information elements of a beacon message and extracts p2p-related info. process_p2p_ps_ie does not receive a pointer to the information elements as one would expect. Instead it receives a pointer to the timestamp field in the beacon message. process_p2p_ps_ie increments this pointer by _BEACON_IE_OFFSET_ to jump to the start of the information elements (and decreases the buffer length accordingly). This is clumsy and hard to understand. Rewrite this such that process_p2p_ps_ie takes a pointer to the information elements and the total length of all elements. Check up-front that the total length is not negative. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: replace GetAddr2Ptr callsMartin Kaiser1-4/+3
Get the source address of a beacon frame from our struct ieee80211_mgmt instead of using the driver's internal GetAddr2Ptr helper. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: read timestamp from ieee80211_mgmtMartin Kaiser1-19/+2
Read the 64-bit timestamp from struct ieee80211_mgmt instead of parsing the beacon message ourselves. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: replace one GetAddr3Ptr callMartin Kaiser1-1/+2
Define a struct ieee80211_mgmt in the OnBeacon function. Use it to replace one GetAddr3Ptr call. This is a tiny step towards making GetAddr3Ptr obsolete. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: greybus: loopback_test: Remove extra blank linesJack Schofield1-13/+0
Clean up extra uses of blank lines that do not follow the kernel coding style. Issue reported by checkpatch. Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Jack Schofield <[email protected]> Link: https://lore.kernel.org/r/51edbcc7583d64d3fe5a203d3a8649a695ef4a75.1669872193.git.schofija@oregonstate.edu Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: greybus: loopback_test: Remove void function return statementJack Schofield1-1/+0
Void function return statement is not useful in this case. Issue reported by checkpatch. Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Jack Schofield <[email protected]> Link: https://lore.kernel.org/r/5d465d56a6e3de2cb9d2f34377cbb82678cc67b1.1669872193.git.schofija@oregonstate.edu Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: greybus: loopback_test: Add blank line after declaration.Jack Schofield1-0/+1
Declarations are to be followed by a blank line. Add to follow Linux Kernel coding style. Issue reported by checkpatch. Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Jack Schofield <[email protected]> Link: https://lore.kernel.org/r/048967b5c3b157e19ccf4608f71da8418fc31877.1669872193.git.schofija@oregonstate.edu Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: use ieee80211 helper for protected bitMartin Kaiser2-4/+1
Use ieee80211_has_protected to check if the "protected" bit is set. Remove the r8188eu driver's internal macro for this check. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: simplify the checks for zero addressMartin Kaiser1-3/+2
In function ap2sta_data_frame, we can use is_zero_ether_addr to check for all-zero ethernet addresses. Both pattrib->bssid and mybssid are 16-bit aligned. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: fix the number of probereq retriesMartin Kaiser2-15/+9
issue_probereq_ex sends a probe request and retries if this fails. There's no point in making the number of retries configurable. Hard-code the value that's used by issue_probereq_ex's only caller. Simplify the code to check the loop condition only once. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: remove wait_ms parameterMartin Kaiser2-7/+7
Remove the wait_ms parameter from function issue_probereq_ex. There's only one caller, who requests a waiting time of 1 ms. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: r8188eu: drop return value from issue_probereq_exMartin Kaiser2-11/+4
The only caller of issue_probereq_ex does not check the return value. We can remove it and make issue_probereq_ex a void function. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()YueHaibing1-1/+1
The skb is delivered to netif_rx() in rtllib_monitor_rx(), which may free it, after calling this, dereferencing skb may trigger use-after-free. Found by Smatch. Fixes: 94a799425eee ("From: wlanfae <[email protected]> [PATCH 1/8] rtl8192e: Import new version of driver from realtek") Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192e: Remove unused variable int_logPhilipp Hortmann3-20/+0
int_log is initialized and incremented but never evaluated. Remove resulting dead code. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/e2edcde052cc3c47e6e6b94d09e460b8cf6a49a8.1669156825.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192e: Remove unused variable ChannelAccessSettingPhilipp Hortmann1-12/+0
ChannelAccessSetting is never used. Remove resulting dead code. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/b88a31954532f47a4caf9abfcad8e20b32a618cc.1669156825.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192e: Remove unused variable initialized_at_probePhilipp Hortmann2-2/+0
initialized_at_probe is initialized and never used. Remove resulting dead code. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/4855b2dd5b7296b0eb10e697f605fb820e1dfc7b.1669156825.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192e: Remove unused variable skb_aggQPhilipp Hortmann3-5/+0
skb_aggQ is initialized, never used and purged. Remove resulting dead code. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/3197be3cb412eea1c662a5bec1b1afda2cee675d.1669156825.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192e: Remove unchanged variable AcmMethodPhilipp Hortmann4-12/+0
AcmMethod is initialized and never changed. The evaluation will always have the same result. Remove resulting dead code. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/7d73a66184e13d5f8d4af7d21564032247a7e923.1669156825.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-12-05staging: rtl8192u: Fix use after free in ieee80211_rx()Dan Carpenter1-1/+3
We cannot dereference the "skb" pointer after calling ieee80211_monitor_rx(), because it is a use after free. Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/Y33BArx3k/aw6yv/@kili Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22staging: iio: ade7854: Convert to i2c's .probe_new()Uwe Kleine-König1-3/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22staging: olpc_dcon: Convert to i2c's .probe_new()Uwe Kleine-König1-2/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22staging: most: i2c: Convert to i2c's .probe_new()Uwe Kleine-König1-2/+2
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_paddingUmang Jain1-15/+15
mmal_fmt.remove_padding is defined as a boolean type hence, use boolean values for it instead of 0/1 integers. This enhances code readability. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_useUmang Jain2-4/+4
In commit 7967656ffbfa ("coding-style: Clarify the expectations around bool") the check to dis-allow bool structure members was removed from checkpatch.pl. It promotes bool structure members to store boolean values. This enhances code readability. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22Revert "staging: mmal-vchiq: Avoid use of bool in structures"Umang Jain2-8/+8
This reverts commit 640e77466e69d9c28de227bc76881f5501f532ca. In commit 7967656ffbfa ("coding-style: Clarify the expectations around bool") the check to dis-allow bool structure members was removed from checkpatch.pl. It promotes bool structure members to store boolean values. This enhances code readability. Signed-off-by: Umang Jain <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22staging: gdm724x: Replace macro GDM_TTY_READY with static inline functionBrent Pappas1-5/+8
Replace the macro GDM_TTY_READY with a static inline function to follow the Linux kernel coding style. Signed-off-by: Brent Pappas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-22staging: vme_user: Fix possible UAF in tsi148_dma_list_addGaosheng Cui1-0/+1
Smatch report warning as follows: drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add() warn: '&entry->list' not removed from list In tsi148_dma_list_add(), the error path "goto err_dma" will not remove entry->list from list->entries, but entry will be freed, then list traversal may cause UAF. Fix by removeing it from list->entries before free(). Fixes: b2383c90a9d6 ("vme: tsi148: fix first DMA item mapping") Signed-off-by: Gaosheng Cui <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename pHTInfoPhilipp Hortmann14-307/+307
Rename variable pHTInfo to ht_info to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/88cdc0ef393c92cb2102a66893c5320e8c8606df.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename InterruptLog, RxCounter and bHwRfOffActionPhilipp Hortmann5-13/+13
Rename variable InterruptLog to int_log, RxCounter to rx_ctr and bHwRfOffAction to hw_rf_off_action to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/82ea07ddd894ac9b863ce90ddb9ba78065bd1f4e.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename bFilterSour.., CCKPresentAt.. and ResetProg..Philipp Hortmann8-43/+43
Rename variable bFilterSourceStationFrame to fltr_src_sta_frame, CCKPresentAttentuation to cck_present_attn and ResetProgress to rst_progress to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/25ab52350a4a3249a1f76b28eea10c44e2f9552d.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename bNetPromisc.., IntelPromiscu.. and bPromiscu..Philipp Hortmann6-25/+25
Rename variable bNetPromiscuousMode to net_promiscuous_md, IntelPromiscuousModeInfo to intel_promiscuous_md_info and bPromiscuousOn to promiscuous_on to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/69d9998a30ce2286c3ae6cb4510174e1255b3f9e.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename LinkDetectInfoPhilipp Hortmann6-55/+55
Rename variable LinkDetectInfo to link_detect_info to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/48d043893fa755490e810af204e5b7ad2ba606de.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename RFInProgres.., bEnableHT and RegChannelPlanPhilipp Hortmann8-24/+24
Rename variable RFInProgressTimeOut to rf_in_progress_timeout, bEnableHT to enable_ht and RegChannelPlan to reg_chnl_plan to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/aa3b8fd4a51fc9b1c32566cd079590bf11a9190d.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename pPSCPhilipp Hortmann6-60/+60
Rename variable pPSC to psc to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/47ded8a906e55d6f09b51cd8f2dfb78b7b92c1cc.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename Regdot11TxHT.., dot11HTOpera.. and RegHTSuppRa..Philipp Hortmann5-19/+19
Rename variable Regdot11TxHTOperationalRateSet to reg_dot11tx_ht_oper_rate_set, dot11HTOperationalRateSet to dot11ht_oper_rate_set and RegHTSuppRateSet to reg_ht_supp_rate_set to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/0c87e7ffc94be1c26f6400f5e12419f2df0418a3.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename Regdot11HTOper.., bSupportM.. and PowerSaveCo..Philipp Hortmann7-31/+31
Rename variable Regdot11HTOperationalRateSet to reg_dot11ht_oper_rate_set, bSupportMode to support_mode and PowerSaveControl to pwr_save_ctrl to avoid CamelCase which is not accepted by checkpatch. Fix unnecessary parentheses warning from checkpatch when used with this variables. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/1ef7fd22b4a037c4d1f8685065ce7916b6f0930b.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: rtl8192e: Rename bTxDisableRate.., RegMaxLPSAwa.. and bTxUseD..Philipp Hortmann7-34/+34
Rename variable bTxDisableRateFallBack to tx_dis_rate_fallback, RegMaxLPSAwakeIntvl to reg_max_lps_awake_intvl and bTxUseDriverAssingedRate to tx_use_drv_assinged_rate to avoid CamelCase which is not accepted by checkpatch. Signed-off-by: Philipp Hortmann <[email protected]> Link: https://lore.kernel.org/r/092eb2dc73d37daf851ea9ef9cb7e4df6f766845.1668313325.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: r8188eu: binstallGrpkey is set to _FAILMichael Straube1-1/+1
The variable binstallGrpkey is set to _FAIL which is defined as 0. Use false to set the variable to get rid of another use of _FAIL. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Michael Straube <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: r8188eu: convert _rtw_init_xmit_priv() to common error logicMichael Straube3-22/+10
Convert the function _rtw_init_xmit_priv() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Michael Straube <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: r8188eu: convert rtw_xmit_resource_alloc() to common error logicMichael Straube1-9/+8
Convert the function rtw_xmit_resource_alloc() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Michael Straube <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: r8188eu: convert aes_cipher() to voidMichael Straube1-3/+1
The function aes_cipher() returns always _SUCCESS and its callers do not use the return value. So we can convert the return type to void and get rid of another use of _SUCCESS. Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Michael Straube <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-17staging: r8188eu: rename three functionsMichael Straube3-14/+14
Prefix the names of the following functions with the driver name. The original names are bad for the global namespace. While at it, convert is_IBSS_empty() to all lower case to follow kernel coding style. is_client_associated_to_ap() is_client_associated_to_ibss() is_IBSS_empty() Suggested-by: Greg Kroah-Hartman <[email protected]> Tested-by: Philipp Hortmann <[email protected]> # Edimax N150 Signed-off-by: Michael Straube <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-09staging: rtl8192u: remove redundant macro definitionsDeepak R Varma1-61/+0
Several ieee80211_* symbol names are extended with _rsl tag using macros. This is done to avoid a conflict when a similar symbol is already in use in another part of kernel and may lead to conflicts. However, most of these base symbol names are not found to being used anywhere in the code and hence are not useful today. These symbols are not used outside of the module and hence can be safely removed. The code continues to use the original symbol names. Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Deepak R Varma <[email protected]> Link: https://lore.kernel.org/r/17f69a042e215c484931a0327fdf7775eea5f918.1667930292.git.drv@mailo.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-09staging: fieldbus: use sysfs_emit() in show functionsDeepak R Varma1-10/+7
The show() methods should only use sysfs_emit() when formatting values to be returned to the user space. Ref: Documentation/filesystems/sysfs.rst Issue identified by coccicheck. Signed-off-by: Deepak R Varma <[email protected]> Link: https://lore.kernel.org/r/Y2uEIzebbM/Fs5Jz@qemulion Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-09staging: ks7010: Avoid clashing function prototypesGustavo A. R. Silva1-122/+126
When built with Control Flow Integrity, function prototypes between caller and function declaration must match. These mismatches are visible at compile time with the new -Wcast-function-type-strict in Clang[1]. Fix a total of 27 warnings like these: drivers/staging/ks7010/ks_wlan_net.c:2415:2: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, struct iw_point *, char *)' to 'iw_handler' (aka 'int (*)(struct net_device *, struct iw_request_info *, union iwreq_data *, char *)') converts to incompatible function type [-Wcast-function-type-strict] (iw_handler)ks_wlan_get_firmware_version,/* 3 KS_WLAN_GET_FIRM_VERSION */ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ks_wlan_net Wireless Extension handler callbacks (iw_handler) use a union for the data argument. Actually use the union and perform explicit member selection in the function body instead of having a function prototype mismatch. There are no resulting binary differences before/after changes. These changes were made partly manually and partly with the help of Coccinelle. Link: https://reviews.llvm.org/D134831 [1] Signed-off-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/8d2ceee1248b5a76e9b6c379f578e65482c91168.1667934775.git.gustavoars@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-09drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in ↵Duoming Zhou1-1/+1
rtw_join_timeout_handler The rtw_join_timeout_handler() is a timer handler that runs in atomic context, but it could call msleep(). As a result, the sleep-in-atomic-context bug will happen. The process is shown below: (atomic context) rtw_join_timeout_handler _rtw_join_timeout_handler rtw_do_join rtw_select_and_join_from_scanned_queue rtw_indicate_disconnect rtw_lps_ctrl_wk_cmd lps_ctrl_wk_hdl LPS_Leave LPS_RF_ON_check msleep //sleep in atomic context Fix by removing msleep() and replacing with mdelay(). Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Signed-off-by: Duoming Zhou <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-08staging: r8188eu: drop removal/stop check in dump_mgntframe_and_wait_ackMartin Kaiser1-3/+0
We can remove the checks for bDriverStopped and bSurpriseRemoved in dump_mgntframe_and_wait_ack. The code path from this function looks like dump_mgntframe_and_wait_ack rtl8188eu_mgnt_xmit rtw_dump_xframe loop over all fragments rtw_write_port is called for each fragment. bSurpriseRemoved and bDriverStopped are checked in rtw_write_port. Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-08staging: r8188eu: drop another removal/stop checkMartin Kaiser1-3/+0
There's no need to check bDriverStopped and bSurpriseRemoved in issue_probereq_ex. The code path looks like issue_probereq_ex _issue_probereq dump_mgntframe or dump_mgntframe_and_wait_ack All paths from dump_mgntframe check the two variables. dump_mgntframe_and_wait_ack contains a check as well. Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>