Re: [PATCH v9 4/9] spi: cadence: Add Marvell SDMA operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux