From patchwork Fri Jun 14 10:50:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 251342 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B86E42C008F for ; Fri, 14 Jun 2013 20:59:21 +1000 (EST) Received: from localhost ([::1]:46382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnRix-0006kt-M9 for incoming@patchwork.ozlabs.org; Fri, 14 Jun 2013 06:59:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnRfB-0001WF-EK for qemu-devel@nongnu.org; Fri, 14 Jun 2013 06:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnRfA-0005pX-6R for qemu-devel@nongnu.org; Fri, 14 Jun 2013 06:55:25 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:47571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnRf9-0005pM-W8; Fri, 14 Jun 2013 06:55:24 -0400 Received: from gandalf.tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by isrv.corpit.ru (Postfix) with ESMTP id 480184165A; Fri, 14 Jun 2013 14:55:23 +0400 (MSK) Received: by gandalf.tls.msk.ru (Postfix, from userid 1000) id 9E8CB51D; Fri, 14 Jun 2013 14:50:47 +0400 (MSK) From: Michael Tokarev To: Anthony Liguori Date: Fri, 14 Jun 2013 14:50:29 +0400 Message-Id: <1371207042-17980-14-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1371207042-17980-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1371207042-17980-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Stefan Weil , Michael Tokarev , qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 13/26] device tree: Fix cppcheck warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Stefan Weil 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 Signed-off-by: Michael Tokarev --- device_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);