- 20 Apr, 2022 11 commits
-
-
Michael Straube authored
The local variables fw_version, fw_subversion, fw_signature in rtl8188e_firmware_download() are only used in one place. Use the assigned values directly and remove the variables to make the code shorter and cleaner. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220417175441.13830-7-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Use sizeof() instead of hardcoding the firmware header size and add a compile time check to ensure struct rt_firmware_hdr has the correct size. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220417175441.13830-6-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Rename the fields of struct rt_firmware_hdr to avoid camel case. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220417175441.13830-5-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Remove unnecessary comments from struct rt_firmware_hdr. While at it align the in-line comments. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220417175441.13830-4-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Convert the u32 fields of struct rt_firmware_hdr to __le32 for consistency. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220417175441.13830-3-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The size of struct rt_firmware_hdr is 36 bytes. $ pahole -C rt_firmware_hdr drivers/staging/r8188eu/r8188eu.o struct rt_firmware_hdr { __le16 Signature; /* 0 2 */ u8 Category; /* 2 1 */ u8 Function; /* 3 1 */ __le16 Version; /* 4 2 */ u8 Subversion; /* 6 1 */ /* XXX 1 byte hole, try to pack */ u16 Rsvd1; /* 8 2 */ u8 Month; /* 10 1 */ u8 Date; /* 11 1 */ u8 Hour; /* 12 1 */ u8 Minute; /* 13 1 */ __le16 RamCodeSize; /* 14 2 */ u8 Foundry; /* 16 1 */ u8 Rsvd2; /* 17 1 */ /* XXX 2 bytes hole, try to pack */ __le32 SvnIdx; /* 20 4 */ u32 Rsvd3; /* 24 4 */ u32 Rsvd4; /* 28 4 */ u32 Rsvd5; /* 32 4 */ /* size: 36, cachelines: 1, members: 17 */ /* sum members: 33, holes: 2, sum holes: 3 */ /* last cacheline: 36 bytes */ }; But the header in the firmware file is only 32 bytes long. The hexdump of rtl8188eufw.bin shows that the field Rsvd1 should be u8 instead of __le16. OFFSET rtl8188eufw.bin ----------------------------------------------------------- 0x00000000 E1 88 10 00 0B 00 01 00 01 21 11 27 30 36 00 00 0x00000010 2D 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x00000000 E1 88 10 00 0B 00 01 00 01 21 11 27 30 36 00 00 ^ ^ ^ ^ ^ ^ Subversion Rsvd1 Month Date Hour Minute With the change of field Rsvd1 from __le16 to u8 the structure has the correct size 32. $ pahole -C rt_firmware_hdr drivers/staging/r8188eu/r8188eu.o struct rt_firmware_hdr { __le16 Signature; /* 0 2 */ u8 Category; /* 2 1 */ u8 Function; /* 3 1 */ __le16 Version; /* 4 2 */ u8 Subversion; /* 6 1 */ u8 Rsvd1; /* 7 1 */ u8 Month; /* 8 1 */ u8 Date; /* 9 1 */ u8 Hour; /* 10 1 */ u8 Minute; /* 11 1 */ __le16 RamCodeSize; /* 12 2 */ u8 Foundry; /* 14 1 */ u8 Rsvd2; /* 15 1 */ __le32 SvnIdx; /* 16 4 */ u32 Rsvd3; /* 20 4 */ u32 Rsvd4; /* 24 4 */ u32 Rsvd5; /* 28 4 */ /* size: 32, cachelines: 1, members: 17 */ /* last cacheline: 32 bytes */ The wrong size had no effect because the header size is hardcoded to 32 where it is used in the code and the fields after Subversion are not used. Fixes: 7884fc0a ("staging: r8188eu: introduce new include dir for RTL8188eu driver") Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220417175441.13830-2-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Adrien Thierry authored
Fix issue reported by checkpatch: CHECK: struct mutex definition without comment FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835.h:64: Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220414181622.102049-6-athierry@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Adrien Thierry authored
Fix issue reported by checkpatch: CHECK: struct mutex definition without comment FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c:14: Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220414181622.102049-5-athierry@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Adrien Thierry authored
Fix issue reported by checkpatch: CHECK: No space is necessary after a cast FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:240: Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220414181622.102049-4-athierry@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Adrien Thierry authored
Fix issue reported by checkpatch: CHECK: Lines should not end with a '(' FILE: drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c:85: Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220414181622.102049-3-athierry@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Adrien Thierry authored
Explain SND_BCM2835 config option in more detail to fix checkpatch warning: WARNING: please write a help paragraph that fully describes the config symbol FILE: drivers/staging/vc04_services/bcm2835-audio/Kconfig:2 Signed-off-by: Adrien Thierry <athierry@redhat.com> Link: https://lore.kernel.org/r/20220414181622.102049-2-athierry@redhat.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 14 Apr, 2022 16 commits
-
-
Colin Ian King authored
Don't populate the read-only array EWC11NHTCap on the stack but instead make it static const. Also makes the object code a little smaller. Remove comment. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20220414103650.297396-1-colin.i.king@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Aliya Rahmani authored
Added tabs for indent to fix the checkpatch error. Signed-off-by: Aliya Rahmani <aliyarahmani786@gmail.com> Link: https://lore.kernel.org/r/20220413204648.60358-1-aliyarahmani786@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Aliya Rahmani authored
Remove redundant parentheses reported by checkpatch. Signed-off-by: Aliya Rahmani <aliyarahmani786@gmail.com> Link: https://lore.kernel.org/r/20220413182303.34807-1-aliyarahmani786@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Aliya Rahmani authored
Remove the unnecessary space immediately after a cast. Identified by checkpatch: CHECK: No space is necessary after a cast. Signed-off-by: Aliya Rahmani <aliyarahmani786@gmail.com> Link: https://lore.kernel.org/r/20220413113531.31224-1-aliyarahmani786@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
pkg_newalloc in struct recv_buf is not used. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413200742.276806-5-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Use structs and functions from ieee80211.h in mgt_dispatcher to parse the incoming frame. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413200742.276806-4-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
All that the _mgt_dispatcher function does is to call a function from a function pointer. It's not worth having a separate function for this. Merge _mgt_dispatcher into mgt_dispatcher. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413200742.276806-3-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Replace the driver-specific GetPriority macro with ieee80211_get_tid, which does exactly the same thing. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413200742.276806-2-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
rtw_get_passing_time_ms and rtw_systime_to_ms are not used any more. Remove them. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-9-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Remove the loop in rtw_pwr_wakeup that waits while the system is suspended. pwrpriv->bInSuspend is set in rtw_suspend and cleared in rtw_resume. These functions are the .suspend and .resume functions of the struct usb_driver for r8188eu. A usb_driver's suspend and resume functions are called when the entire system goes into suspend or runtime suspend. All of the code paths for rtw_pwr_wakeup start at ioctl handlers. We can remove the loop that checks bInSuspend. It's not possible to call an ioctl while the entire system is suspended. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-8-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Clean up the code in rtw_pwr_wakeup that sets pwrpriv->ips_deny_time. Make ips_deny_time an unsigned long, this type is used by the kernel functions that process jiffies. Remove the temporary variable ips_deffer_ms and use RTW_PWR_STATE_CHK_INTERVAL directly. There's no need to set ips_deny_time twice, it's sufficient to set it at the end of rtw_pwr_wakeup. Use time_before to check if ips_deny_time should be updated. We can now remove rtw_ms_to_systime, this function is not used any more. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-7-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Use the kernel functions to set a timeout and to check if it's expired. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-6-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Summarize two if statements in rtw_pwr_wakeup and place the constants on the right side of the comparison. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-5-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
It's sufficient to check pwrpriv->ps_processing as part of the while-loop. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-4-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
rtw_pwr_wakeup should return _SUCCESS or _FAIL. Replace false with _FAIL in one place and reformat the if-statement. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-3-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
Simplify the conditions for a loop in rtw_pwr_wakeup that waits while the system is suspended. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220413193654.258507-2-martin@kaiser.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 13 Apr, 2022 13 commits
-
-
Michael Straube authored
Store the address and the data pointer for calls to rtw_writeN() and rtw_write8() in local variables. This avoids long lines and improves readability. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220412185754.8695-7-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The variables i and offset in block_write() are set in the code before they are used. Remove the unneeded initializations. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220412185754.8695-6-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
For cleaner code and improved readability we can reduce the number of local variables in block_write(). Use a single variable for block size, number of blocks and remaining size. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220412185754.8695-5-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The second parameter of write_fw(), page_write() and block_write() is a void pointer, but we always pass an u8 pointer. We can convert this parameter to an u8 pointer. The pointer is not changed in the functions, so we can safely remove the local variable bufferPtr. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220412185754.8695-4-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Rename the parameter buffSize of block_write() to avoid camel case. buffSize -> size Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220412185754.8695-3-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Correct a macro spelling mistake in rtw_fw.c. MAX_REG_BOLCK_SIZE -> MAX_REG_BLOCK_SIZE Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220412185754.8695-2-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Duoming Zhou authored
There is a deadlock in rtw_joinbss_event_prehandle(), which is shown below: (Thread 1) | (Thread 2) | _set_timer() rtw_joinbss_event_prehandle()| mod_timer() spin_lock_bh() //(1) | (wait a time) ... | rtw_join_timeout_handler() | _rtw_join_timeout_handler() del_timer_sync() | spin_lock_bh() //(2) (wait timer to stop) | ... We hold pmlmepriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtw_joinbss_event_prehandle() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_bh(), which could let timer handler to obtain the needed lock. What`s more, we change spin_lock_bh() to spin_lock_irq() in _rtw_join_timeout_handler() in order to prevent deadlock. Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Link: https://lore.kernel.org/r/20220409072135.74248-1-duoming@zju.edu.cnSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Duoming Zhou authored
There is a deadlock in rtw_joinbss_event_prehandle(), which is shown below: (Thread 1) | (Thread 2) | _set_timer() rtw_joinbss_event_prehandle()| mod_timer() spin_lock_bh() //(1) | (wait a time) ... | _rtw_join_timeout_handler() del_timer_sync() | spin_lock_bh() //(2) (wait timer to stop) | ... We hold pmlmepriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtw_joinbss_event_prehandle() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_bh(), which could let timer handler to obtain the needed lock. What`s more, we change spin_lock_bh() to spin_lock_irq() in _rtw_join_timeout_handler() in order to prevent deadlock. Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Link: https://lore.kernel.org/r/20220409064953.67420-1-duoming@zju.edu.cnSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Duoming Zhou authored
There is a deadlock in rtw_surveydone_event_callback(), which is shown below: (Thread 1) | (Thread 2) | _set_timer() rtw_surveydone_event_callback()| mod_timer() spin_lock_bh() //(1) | (wait a time) ... | rtw_scan_timeout_handler() del_timer_sync() | spin_lock_bh() //(2) (wait timer to stop) | ... We hold pmlmepriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtw_surveydone_event_callback() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_bh(), which could let timer handler to obtain the needed lock. What`s more, we change spin_lock_bh() in rtw_scan_timeout_handler() to spin_lock_irq(). Otherwise, spin_lock_bh() will also cause deadlock() in timer handler. Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Link: https://lore.kernel.org/r/20220409061836.60529-1-duoming@zju.edu.cnSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mahak Gupta authored
Adhere to linux coding style. Reported by checkpatch: spaces preferred around that '{operator}'. Signed-off-by: Mahak Gupta <mahak_g@cs.iitr.ac.in> Link: https://lore.kernel.org/r/20220413054517.6343-1-mahak_g@cs.iitr.ac.inSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jaehee Park authored
Remove the optional remove callback for the soc_codec_dev_gbaudio structure. The only place it is referenced is snd_soc_component_remove() which is only called if the sound_component pointer is non-null. The null function pointers here can be optionally ommitted. When a sound component is registered this way, the remove callback is optional. We can safely remove the whole gbcodec_remove function, which used to be an empty function with a void return type. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jaehee Park <jhpark1013@gmail.com> Link: https://lore.kernel.org/r/12037ae2502ad7d0311bcdf2178c3d2156293236.1649824370.git.jhpark1013@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jaehee Park authored
Correct a spelling typo from 'Atleast' to 'At least' in comment. Issue found by checkpatch. Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Jaehee Park <jhpark1013@gmail.com> Link: https://lore.kernel.org/r/2feb03de97ca4dbd27c22cf40f8e185f7dfaae29.1649824370.git.jhpark1013@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mahak Gupta authored
Else is not necessary after return and break statements, hence remove it. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Mahak Gupta <mahak_g@cs.iitr.ac.in> Link: https://lore.kernel.org/r/20220413052759.4859-1-mahak_g@cs.iitr.ac.inSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-