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

'Wolfram Sang'
2021-09-27T09:25:20Z

[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]

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@sang-engineering.com>

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

Kind regards,

Wolfram

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]