[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210713183903.GH4098@sirena.org.uk>
Date: Tue, 13 Jul 2021 19:39:03 +0100
From: Mark Brown <broonie@...nel.org>
To: Apurva Nandan <a-nandan@...com>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
Pratyush Yadav <p.yadav@...com>,
Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH 2/2] spi: cadence-quadspi: Fix check condition for DTR ops
On Tue, Jul 13, 2021 at 12:57:42PM +0000, Apurva Nandan wrote:
> + f_pdata->dtr = op->cmd.dtr &&
> + (op->addr.dtr || !op->addr.nbytes) &&
> + (op->data.dtr || !op->data.nbytes);
I'm not sure anyone reading this code is going to figure out what it's
doing without thinking about it, the combination of writing the bytes
check with a !, putting it after the check for .dtr and not having any
comments is a bit obscure. Something like
(op->addr.nbytes && op.addr.dtr)
might be a bit clearer, or a comment explicitly spelling it out.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists