|
From: | Richard Henderson |
Subject: | Re: [PATCH] softmmu/device_tree: Silence compiler warning with --enable-sanitizers |
Date: | Fri, 7 Jan 2022 12:18:18 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 1/7/22 5:38 AM, Thomas Huth wrote:
diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c index 3965c834ca..9e96f5ecd5 100644 --- a/softmmu/device_tree.c +++ b/softmmu/device_tree.c @@ -564,7 +564,7 @@ int qemu_fdt_add_path(void *fdt, const char *path) return -1; }- while (p) {+ do { name = p + 1; p = strchr(name, '/'); namelen = p != NULL ? p - name : strlen(name); @@ -584,7 +584,7 @@ int qemu_fdt_add_path(void *fdt, const char *path) }parent = retval;- } + } while (p);
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>In addition, the copy between 'path' and 'p' is unnecessary -- one of the variables should be removed. Either rename the parameter to 'p', or rename all uses to 'path'.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |