2021-04-10 13:34:31

by Bryan Brattlof

[permalink] [raw]
Subject: [PATCH] staging: rtl8723bs: remove unnecessary goto jumps

The next instruction for both 'goto exit' jump statements is to
execute the exit jump instructions regardless. We can safely
remove all jump statements from __init rtw_drv_entry()

Signed-off-by: Bryan Brattlof <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 9fd926e1698f..84ac81d19746 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -517,13 +517,9 @@ static int __init rtw_drv_entry(void)
if (ret != 0) {
sdio_drvpriv.drv_registered = false;
rtw_ndev_notifier_unregister();
- goto exit;
}

- goto exit;
-
-exit:
- DBG_871X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
+ DBG_870X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
return ret;
}

--
2.27.0



2021-04-10 13:39:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: rtl8723bs: remove unnecessary goto jumps

On Sat, Apr 10, 2021 at 01:33:09PM +0000, Bryan Brattlof wrote:
> The next instruction for both 'goto exit' jump statements is to
> execute the exit jump instructions regardless. We can safely
> remove all jump statements from __init rtw_drv_entry()
>
> Signed-off-by: Bryan Brattlof <[email protected]>
> ---
> drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> index 9fd926e1698f..84ac81d19746 100644
> --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> @@ -517,13 +517,9 @@ static int __init rtw_drv_entry(void)
> if (ret != 0) {
> sdio_drvpriv.drv_registered = false;
> rtw_ndev_notifier_unregister();
> - goto exit;
> }
>
> - goto exit;
> -
> -exit:
> - DBG_871X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
> + DBG_870X_LEVEL(_drv_always_, "module init ret =%d\n", ret);

Why did you change this line?

thanks,

greg k-h

2021-04-10 14:53:03

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] staging: rtl8723bs: remove unnecessary goto jumps

Hi Bryan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url: https://github.com/0day-ci/linux/commits/Bryan-Brattlof/staging-rtl8723bs-remove-unnecessary-goto-jumps/20210410-213334
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 32abcac8037da5dc570c22abf266cbb92eee9fc9
config: sparc-allyesconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/244bc6c6b650db830cbd316043711fda4f2f34d9
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bryan-Brattlof/staging-rtl8723bs-remove-unnecessary-goto-jumps/20210410-213334
git checkout 244bc6c6b650db830cbd316043711fda4f2f34d9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

drivers/staging/rtl8723bs/os_dep/sdio_intf.c: In function 'rtw_drv_entry':
>> drivers/staging/rtl8723bs/os_dep/sdio_intf.c:522:2: error: implicit declaration of function 'DBG_870X_LEVEL'; did you mean 'DBG_871X_LEVEL'? [-Werror=implicit-function-declaration]
522 | DBG_870X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
| ^~~~~~~~~~~~~~
| DBG_871X_LEVEL
cc1: some warnings being treated as errors


vim +522 drivers/staging/rtl8723bs/os_dep/sdio_intf.c

513
514 sdio_drvpriv.drv_registered = true;
515
516 ret = sdio_register_driver(&sdio_drvpriv.r871xs_drv);
517 if (ret != 0) {
518 sdio_drvpriv.drv_registered = false;
519 rtw_ndev_notifier_unregister();
520 }
521
> 522 DBG_870X_LEVEL(_drv_always_, "module init ret =%d\n", ret);
523 return ret;
524 }
525

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (2.21 kB)
.config.gz (67.42 kB)
Download all attachments