public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: use sizeof() in memchunk_cmdline_override
@ 2026-04-23 12:04 Thorsten Blum
  2026-04-24 11:05 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-04-23 12:04 UTC (permalink / raw)
  To: Rich Felker, John Paul Adrian Glaubitz
  Cc: Thorsten Blum, linux-sh, linux-kernel

Replace the hard-coded string length with 'sizeof("memchunk.") - 1' and
remove the comment.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/sh/mm/consistent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index 0de206c1acfe..8f3a5bcbccfe 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -23,7 +23,7 @@ static void __init memchunk_cmdline_override(char *name, unsigned long *sizep)
 	int k = strlen(name);
 
 	while ((p = strstr(p, "memchunk."))) {
-		p += 9; /* strlen("memchunk.") */
+		p += sizeof("memchunk.") - 1;
 		if (!strncmp(name, p, k) && p[k] == '=') {
 			p += k + 1;
 			*sizep = memparse(p, NULL);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-24 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-23 12:04 [PATCH] sh: use sizeof() in memchunk_cmdline_override Thorsten Blum
2026-04-24 11:05 ` Geert Uytterhoeven
2026-04-24 11:15   ` Thorsten Blum
2026-04-24 17:10     ` Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox