Patchwork [PULL,13/26] device tree: Fix cppcheck warning

login
register
mail settings
Submitter Michael Tokarev
Date June 14, 2013, 10:50 a.m.
Message ID <1371207042-17980-14-git-send-email-mjt@msgid.tls.msk.ru>
Download mbox | patch
Permalink /patch/251342/
State New
Headers show

Comments

Michael Tokarev - June 14, 2013, 10:50 a.m.
From: Stefan Weil <sw@weilnetz.de>

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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/device_tree.c b/device_tree.c
index 56af24b..69be9da 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -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);