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

From: Bart Van Assche

Date: Thu Oct 22 2026 - 16:51:01 EST


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.