From patchwork Wed Jun 27 04:14:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 9643 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 079D823F31 for ; Wed, 27 Jun 2012 04:26:55 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by fiordland.canonical.com (Postfix) with ESMTP id DD4EFA18AFF for ; Wed, 27 Jun 2012 04:26:54 +0000 (UTC) Received: by lbbgj3 with SMTP id gj3so1165746lbb.11 for ; Tue, 26 Jun 2012 21:26:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=GfBRAk5FbMRMP52URHdvhqG/j5/wjkXi2mO6AsnhOhk=; b=LLEzdHxlWNxYb10uBqSdyy5SuT0bX3tkDpa9GVClDxjJKqZXQtaawBO2uyr2GD9aJ3 HVlVm50mmI4e9MaUXS7hAtdSqYeRvtynsbrJRPoCfy5GjYmhqAF3AuB6i3zM1AkKvVwh LdKicQFqWXSIza2DuEBoCsDwmwCtK4xfyKtuOOeh3eqQuu6Bbl6rtIN0dPxxKhE/Yt2W rujynrzF2G94E8na2ER25PALDWVtL7CWVYeMJ/Z9vAbWS5WTmsbj/Ba2tQfdxM7TFK88 F8V751NBTawmLy7tTrLiYv7UbroBkI2deI9PTG+OKVhKscdBxlypXidDyPCNx/s4IKH3 v+QA== Received: by 10.112.36.97 with SMTP id p1mr8779070lbj.37.1340771214488; Tue, 26 Jun 2012 21:26:54 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.148.101 with SMTP id tr5csp35991lab; Tue, 26 Jun 2012 21:26:53 -0700 (PDT) Received: by 10.68.236.129 with SMTP id uu1mr59002214pbc.77.1340771212644; Tue, 26 Jun 2012 21:26:52 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id vh4si18621085pbc.353.2012.06.26.21.26.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jun 2012 21:26:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by danh15 with SMTP id h15so967955dan.37 for ; Tue, 26 Jun 2012 21:26:51 -0700 (PDT) Received: by 10.68.236.34 with SMTP id ur2mr60206708pbc.108.1340771211541; Tue, 26 Jun 2012 21:26:51 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id he9sm13893570pbc.68.2012.06.26.21.26.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Jun 2012 21:26:50 -0700 (PDT) From: Sachin Kamat To: devicetree-discuss@lists.ozlabs.org Cc: rob.herring@calxeda.com, grant.likely@secretlab.ca, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH][Resend] of: Fix null pointer related warnings in base.c file Date: Wed, 27 Jun 2012 09:44:45 +0530 Message-Id: <1340770485-22670-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlyxp2Yi0mhHUJPJVEbTohW5UWfv4H38g7tYIPlEqSi5BKmz0hU8N/aQpudBTEZUontkjek Fixes the following sparse warnings: drivers/of/base.c:176:41: warning: Using plain integer as NULL pointer drivers/of/base.c:178:37: warning: Using plain integer as NULL pointer drivers/of/base.c:500:49: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat --- drivers/of/base.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index d9bfd49..2031aa1 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np, return NULL; read_lock(&devtree_lock); - for (pp = np->properties; pp != 0; pp = pp->next) { + for (pp = np->properties; pp; pp = pp->next) { if (of_prop_cmp(pp->name, name) == 0) { - if (lenp != 0) + if (lenp) *lenp = pp->length; break; } @@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from, read_lock(&devtree_lock); np = from ? from->allnext : allnodes; for (; np; np = np->allnext) { - for (pp = np->properties; pp != 0; pp = pp->next) { + for (pp = np->properties; pp; pp = pp->next) { if (of_prop_cmp(pp->name, prop_name) == 0) { of_node_get(np); goto out;