lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJFziyZHnbsWdTFn@kroah.com>
Date:   Tue, 4 May 2021 18:17:15 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Bryan Brattlof <hello@...anbrattlof.com>
Cc:     linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: use generic kernel error codes

On Tue, May 04, 2021 at 04:07:48PM +0000, Bryan Brattlof wrote:
> The current _FAIL and _SUCCESS error codes are defined as:
> 
>         #define _FAIL    0
> 	#define _SUCCESS 1
> 
> which adds complexity (and confusion) when interacting with other
> submodules in the kernel. These definitions can be removed and replaced
> with the kernel's generic error codes.
> 
> Signed-off-by: Bryan Brattlof <hello@...anbrattlof.com>
> ---
>  drivers/staging/rtl8723bs/include/drv_types.h |  2 +-
>  drivers/staging/rtl8723bs/os_dep/sdio_intf.c  | 11 +++++------
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
> index 83d43e5726dd..5b702ff432ae 100644
> --- a/drivers/staging/rtl8723bs/include/drv_types.h
> +++ b/drivers/staging/rtl8723bs/include/drv_types.h
> @@ -385,7 +385,7 @@ struct adapter {
>  	void *xmitThread;
>  	void *recvThread;
> 
> -	u32 (*intf_init)(struct dvobj_priv *dvobj);
> +	int (*intf_init)(struct dvobj_priv *dvobj);
>  	void (*intf_deinit)(struct dvobj_priv *dvobj);
>  	int (*intf_alloc_irq)(struct dvobj_priv *dvobj);
>  	void (*intf_free_irq)(struct dvobj_priv *dvobj);
> diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> index d2bf444117b8..e26c51d847b6 100644
> --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> @@ -112,7 +112,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
>  	}
>  }
> 
> -static u32 sdio_init(struct dvobj_priv *dvobj)
> +static int sdio_init(struct dvobj_priv *dvobj)
>  {
>  	struct sdio_data *psdio_data;
>  	struct sdio_func *func;
> @@ -139,12 +139,11 @@ static u32 sdio_init(struct dvobj_priv *dvobj)
>  	psdio_data->tx_block_mode = 1;
>  	psdio_data->rx_block_mode = 1;
> 
> +	return err;
> +
>  release:
>  	sdio_release_host(func);
> -
> -	if (err)
> -		return _FAIL;
> -	return _SUCCESS;
> +	return err;
>  }

You just changed the logic here, are you SURE that was ok to do?


> 
>  static void sdio_deinit(struct dvobj_priv *dvobj)
> @@ -186,7 +185,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct sdio_func *func)
>  	psdio = &dvobj->intf_data;
>  	psdio->func = func;
> 
> -	if (sdio_init(dvobj) != _SUCCESS)
> +	if (sdio_init(dvobj) < 0)
>  		goto free_dvobj;
> 
>  	rtw_reset_continual_io_error(dvobj);
> 
> base-commit: 9ccce092fc64d19504fa54de4fd659e279cc92e7
> --
> git-series 0.9.1
> 
> 

And that's all to remove the need for these crazy error values?  If so,
why not also remove the #defines for them as well?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ