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: <20190121171323.GK8620@lunn.ch>
Date:   Mon, 21 Jan 2019 18:13:23 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Igor Russkikh <Igor.Russkikh@...antia.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Nikita Danilov <Nikita.Danilov@...antia.com>
Subject: Re: [PATCH net 5/5] net: aquantia: added err var into AQ_HW_WAIT_FOR
 construct

On Mon, Jan 21, 2019 at 02:53:53PM +0000, Igor Russkikh wrote:
> From: Nikita Danilov <nikita.danilov@...antia.com>
> 
> David noticed this define was hiding 'err' variable
> reference. Thats confusing and counterintuitive.
> 
> Adding err argument explicitly for better visibility
> that err is changed inside macro.
> 
> Signed-off-by: Nikita Danilov <nikita.danilov@...antia.com>
> Signed-off-by: Igor Russkikh <igor.russkikh@...antia.com>
> ---
>  .../ethernet/aquantia/atlantic/aq_hw_utils.h   |  4 ++--
>  .../aquantia/atlantic/hw_atl/hw_atl_a0.c       |  8 ++++----
>  .../aquantia/atlantic/hw_atl/hw_atl_b0.c       |  4 ++--
>  .../aquantia/atlantic/hw_atl/hw_atl_utils.c    | 18 +++++++++---------
>  .../atlantic/hw_atl/hw_atl_utils_fw2x.c        | 10 +++++-----
>  5 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h
> index dc88a1221f1d..ca1d20d64a39 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h
> +++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h
> @@ -23,7 +23,7 @@
>  
>  #define AQ_HW_SLEEP(_US_) mdelay(_US_)
>  
> -#define AQ_HW_WAIT_FOR(_B_, _US_, _N_) \
> +#define AQ_HW_WAIT_FOR(_B_, _US_, _N_, _err_) \
>  do { \
>  	unsigned int AQ_HW_WAIT_FOR_i; \
>  	for (AQ_HW_WAIT_FOR_i = _N_; (!(_B_)) && (AQ_HW_WAIT_FOR_i);\
> @@ -31,7 +31,7 @@ do { \
>  		udelay(_US_); \
>  	} \
>  	if (!AQ_HW_WAIT_FOR_i) {\
> -		err = -ETIME; \
> +		*(_err_) = -ETIME; \
>  	} \
>  } while (0)

Hi Igor

How about throwing this horrible macro away and using one of the
readx_poll_timeout() variants.

	     Andrew

Powered by blists - more mailing lists