[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67123003-9987-492f-b9ab-718e5dab0acc@sirena.org.uk>
Date: Mon, 24 Jun 2024 15:29:37 +0100
From: Mark Brown <broonie@...nel.org>
To: Witold Sadowski <wsadowski@...vell.com>
Cc: linux-kernel@...r.kernel.org, linux-spi@...r.kernel.org,
devicetree@...r.kernel.org, robh@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
pthombar@...ence.com
Subject: Re: [PATCH v9 4/9] spi: cadence: Add Marvell SDMA operations
On Wed, Jun 19, 2024 at 07:17:10AM -0700, Witold Sadowski wrote:
> +static void m_ioreadq(void __iomem *addr, void *buf, int len)
> +{
> + u64 tmp_buf;
> +
> + while (len) {
> + tmp_buf = readq(addr);
> + memcpy(buf, &tmp_buf, len > 8 ? 8 : len);
> + len = len > 8 ? len - 8 : 0;
> + buf += 8;
> + }
> +}
Wouldn't it be more efficient and readable to only do the memcpy() for
the trailing bytes and just do this memcpy() for the final word?
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists