lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] staging: r8188eu: remove unwanted variable implementation
On Wed, Nov 02, 2022 at 01:48:18AM +0530, Deepak R Varma wrote:
> Local variables intended as the function return value are
> initialized but their value does not change during function
> execution. The initial value assigned to the variable is simply
> returned to the caller. This makes the variable declaration
> unnecessary and the initial value can be directly returned.
>
> Following table lists the initial commits when the variables were first
> introduced but have not been used since inception:
>
> Variable Function File Inception Commit
> ret rtw_sta_flush r8188eu/core/rtw_ap.c [1]
> ret amsdu_to_msdu r8188eu/core/rtw_recv.c [2]
> ret rtw_p2p_set r8188eu/os_dep/ioctl_linux.c [3]
>
> [1] 'commit 9a7fe54ddc3a ("staging: r8188eu: Add source files for new driver - part 1")'
> [2] 'commit 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5")'
> [3] 'commit a2c60d42d97c ("staging: r8188eu: Add files for new driver - part 16")'
>
> However, local variable pull of the function update_txdesc from file
> r8188eu/hal/rtl8188eu_xmit.c was in use prior to introduction of
> commit ID [4] 7bdedfef085bb65. The clean-up associated with this
> commit left the variable pull redundant.
>
> [4] 'commit 7bdedfef085b ("staging: r8188eu: Remove mp, a.k.a. manufacturing process, code")'
>
> The patch is produced using the following coccicheck options:
> COCCI=./scripts/coccinelle/misc/returnvar.cocci
> M=driver/staging/r8188eu/
> MODE=patch
>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
>
> Changes in v2:
> 1. Include reason for why the variable declarations are not useful. Suggested
> by Julia Lawall <julia.lawall@inria.fr>

Does not apply to my tree at all :(

Please rebase and resubmit.

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-11-02 08:30    [W:0.222 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site