Re: [PATCH] memory: renesas-rpc-if: Avoid unaligned bus access for HyperFlash

From: 'Wolfram Sang'
Date: Mon Sep 27 2021 - 05:25:20 EST


Hi Andrew,

> It could make sense if "from" would not change along the function.

Yes. And using a pointer to unsigned long would neither make the code a
lot more readable, I am afraid.

> I don't like #ifdef's inside the function body too, but the problem is that
> "__raw_readq" is defined in arch/arm64/include/asm/io.h unconditionally,
> but in include/asm-generic/io.h under "#ifdef CONFIG_64BIT" only.

I see. Bad luck then :(

> I looked through the whole kernel code too, and unfortunately didn't find
> any similar code that could be re-used or had some parts, extractable as
> a common helper. That's why I ended up with a local custom function,
> at least so far, until it could be found useful by somebody else ;)

Thanks for confirming you also had a look.

Okay, the function is not exactly pretty, but my comments have been
addressed and it fixes a serious bug, so:

Reviewed-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

Still, if someone has ideas how to make the function more readable, we
could incrementally improve it.

Kind regards,

Wolfram

Attachment: signature.asc
Description: PGP signature