[PATCH v3] scsi: arm: Convert acornscsi-io.S to C

Bart Van Assche bvanassche at acm.org
Thu Oct 22 13:49:50 PDT 2026


On 10/22/26 1:30 PM, Breno Rodrigues Alves wrote:
> +	while (length >= 2) {

Shouldn't this "while" be changed into "if"?

> +		u16 v = get_unaligned_le16(buf);
> +		void __iomem *cp = (void __iomem *)card;
> +
> +		writeb(v & 0xff, cp);
> +		writeb((v >> 8) & 0xff, cp + 1);

The above code can be simplified as shown below, isn't it?

		void __iomem *cp = (void __iomem *)card;

		writeb(buf[0], cp);
		writeb(buf[1], cp + 1);

> +	if (length >= 1)
> +		writeb(*buf, (void __iomem *)card);

Isn't the above (void __iomem *) cast superfluous?

Thanks,

Bart.



More information about the linux-arm-kernel mailing list