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]
Date:   Thu, 4 Jan 2018 11:42:14 -0800
From:   Nicolin Chen <nicoleotsuka@...il.com>
To:     "Maciej S. Szmigiero" <mail@...iej.szmigiero.name>
Cc:     timur@...i.org, broonie@...nel.org, linux-kernel@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, alsa-devel@...a-project.org,
        lgirdwood@...il.com, fabio.estevam@....com, caleb@...me.org,
        arnaud.mouiche@...oxia.com, lukma@...x.de, kernel@...gutronix.de
Subject: Re: [PATCH v1 03/15] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro

On Mon, Jan 01, 2018 at 10:29:24PM +0100, Maciej S. Szmigiero wrote:

> > @@ -445,16 +445,10 @@ static void fsl_ssi_config(struct fsl_ssi *ssi, bool enable,
> >  	bool tx = &ssi->regvals[TX] == vals;

> > +	/* Check if the opposite stream is active */
> > +	aactive = ssi->streams & BIT(!tx);
> 
> I don't think that hardcoding an implicit assumption here that RX == 0,
> TX == 1 is a good thing.
> If in the future, for any reason, somebody changes values of these macros
> this code will silently break.
> 
> I would instead change this line into something like
> "aactive = ssi->streams & (tx ? BIT(RX) : BIT(TX));" or similar.

You have a point. I could add a "bool dir" to make it clear. Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ