]> git.proxmox.com Git - qemu.git/commitdiff
device tree: Fix cppcheck warning
authorStefan Weil <sw@weilnetz.de>
Mon, 10 Jun 2013 20:12:25 +0000 (22:12 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 11 Jun 2013 19:45:44 +0000 (23:45 +0400)
Fix this cppcheck warning:

Checking device_tree.c...
device_tree.c:216: style:
 Checking if unsigned variable 'r' is less than zero.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
device_tree.c

index 56af24b397282bbecb14c3cb37cd21bbdf968e39..69be9da8e408c93b9fb6fb587f0871a5754949a5 100644 (file)
@@ -213,7 +213,7 @@ uint32_t qemu_devtree_get_phandle(void *fdt, const char *path)
     uint32_t r;
 
     r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
-    if (r <= 0) {
+    if (r == 0) {
         fprintf(stderr, "%s: Couldn't get phandle for %s: %s\n", __func__,
                 path, fdt_strerror(r));
         exit(1);