openrisc/boot: Remove unnecessary initialisation in memcpy().
PATCH 1/1 openrisc/boot: Remove unnecessary initialisation in memcpy().
'd' and 's' are initialised later with 'dest_w' and 'src_w', so we need not initialise them before that.
--- arch/openrisc/lib/memcpy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/openrisc/lib/memcpy.c +1 -1
@@ -101,7 +101,7 @@ void *memcpy(void *dest, __const void *src, __kernel_size_t n)*/ void *memcpy(void *dest, __const void *src, __kernel_size_t n) { -unsigned char *d = (unsigned char *)dest, *s = (unsigned char *)src; +unsigned char *d, *s;uint32_t *dest_w = (uint32_t *)dest, *src_w = (uint32_t *)src;/* If both source and dest are word aligned copy words */
Signature · 1 line
2.30.2
Stafford Horne
maintainerQuoted 4 lines · Kuniyuki Iwashima
'd' and 's' are initialised later with '
dest_w' and 'src_w', so we need not initialise them before that.Signed-off-by Kuniyuki Iwashima <[email protected]>
This looks fine to me. I will queue this for the next release.
Just curious why are you working on OpenRISC?
-Stafford
Quoted 20 lines
--- arch/openrisc/lib/memcpy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/openrisc/lib/memcpy.c +1
-1@@ -101,7 +101,7 @@ void *memcpy(void *dest, __const void *src, __kernel_size_t n)*/ void *memcpy(void *dest, __const void *src, __kernel_size_t n) { -unsigned char *d = (unsigned char *)dest, *s = (unsigned char *)src; +unsigned char *d, *s;uint32_t *dest_w = (uint32_t *)dest, *src_w = (uint32_t *)src;/* If both source and dest are word aligned copy words */ Signature · 1 line
2.30.2
From: Stafford Horne <[email protected]> Date: Mon, 24 Jan 2022 08:27:54 +0900
Quoted 7 lines · Kuniyuki Iwashima
Quoted 4 lines
'd' and 's' are initialised later with '
dest_w' and 'src_w', so we need not initialise them before that.Signed-off-by Kuniyuki Iwashima <[email protected]>This looks fine to me. I will queue this for the next release.
Thank you.
Quoted 2 lines
Just curious why are you working on OpenRISC?
While reading memcpy() variants, I found a nit to fix in x86 boot-time memcpy() [0]. While I'm at it, I just started reading all arch ones ;)
[0]: https://lore.kernel.org/lkml/20220123015807.45005-1-kuniyu at amazon.co.jp/
Quoted 22 lines
-Stafford
Quoted 19 lines
--- arch/openrisc/lib/memcpy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/openrisc/lib/memcpy.c +1
-1@@ -101,7 +101,7 @@ void *memcpy(void *dest, __const void *src, __kernel_size_t n)*/ void *memcpy(void *dest, __const void *src, __kernel_size_t n) { -unsigned char *d = (unsigned char *)dest, *s = (unsigned char *)src; +unsigned char *d, *s;uint32_t *dest_w = (uint32_t *)dest, *src_w = (uint32_t *)src;/* If both source and dest are word aligned copy words */ Signature · 1 line
2.30.2
Stafford Horne
maintainerQuoted 14 lines · Kuniyuki Iwashima
From: Stafford Horne <[email protected]> Date: Mon, 24 Jan 2022 08:27:54 +0900Quoted 7 lines · Kuniyuki Iwashima
Quoted 4 lines
'd' and 's' are initialised later with '
dest_w' and 'src_w', so we need not initialise them before that.Signed-off-by Kuniyuki Iwashima <[email protected]>This looks fine to me. I will queue this for the next release.
Thank you.
Quoted 1 line
Quoted 6 lines
Quoted 1 line
Just curious why are you working on OpenRISC?
While reading
memcpy()variants, I found a nit to fix in x86 boot-timememcpy()[0]. While I'm at it, I just started reading all arch ones ;)[0]: https://lore.kernel.org/lkml/20220123015807.45005-1-kuniyu at amazon.co.jp/
Got it.
Thanks again!