From patchwork Mon Jun 4 11:15:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 9099 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 39E3C23E5A for ; Mon, 4 Jun 2012 11:26:06 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id EE589A18106 for ; Mon, 4 Jun 2012 11:26:05 +0000 (UTC) Received: by yenq6 with SMTP id q6so3236636yen.11 for ; Mon, 04 Jun 2012 04:26:05 -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=HM0R0UKK6Kn1PbtL82Yky7MSNCSEDpU//fOdT6rIB14=; b=l1IBKZIe5ZNhu0pG9RUPJXiIDQTY3Lc8lr1TtlxhQL1O+PKS3/JUWE240EsE63yh5Z Nn/L0r/BjHtaMWT1OQR8Ey7UMyyOBdRrTBFnfSHQgZF0GaV2ARUCYuTPWLfmKP0w2BjZ DC4sSsXMPffs3aAk4kgDPGvR5Kab4ajPB33g9/vn4lEi2qY6louB1k04g6bXJ1OKvYHg 1UUDYpVThG6NhL1DJXJBUS+z3b6aIo/DJLl6kyxATcXCu9qK8Z2VedQMqL+jyyrYPQ2l DMcTIMqy37GrxJYzqpTfnPP2RHj113mXlNZW0TivLlh878sv2Y29Wib3FDEqsudGAiyF Njdw== Received: by 10.50.160.198 with SMTP id xm6mr7631356igb.0.1338809165146; Mon, 04 Jun 2012 04:26:05 -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.231.24.148 with SMTP id v20csp100630ibb; Mon, 4 Jun 2012 04:26:04 -0700 (PDT) Received: by 10.68.222.165 with SMTP id qn5mr13952122pbc.14.1338809164517; Mon, 04 Jun 2012 04:26:04 -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 ro10si15864992pbc.222.2012.06.04.04.26.04 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jun 2012 04:26:04 -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 h15so6669829dan.37 for ; Mon, 04 Jun 2012 04:26:04 -0700 (PDT) Received: by 10.68.237.202 with SMTP id ve10mr29668103pbc.54.1338809164095; Mon, 04 Jun 2012 04:26:04 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pd9sm13008771pbc.26.2012.06.04.04.26.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jun 2012 04:26:03 -0700 (PDT) From: Sachin Kamat To: devicetree-discuss@lists.ozlabs.org Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] of: Fix null pointer related warnings in base.c file Date: Mon, 4 Jun 2012 16:45:05 +0530 Message-Id: <1338808505-2028-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnSFRhXlXQBTRGT8dQ39JBfK10fWPV6Baizpf0oxVrLN6IwZS+T7YCy5nLJPincfsRhKvgH 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 != NULL; pp = pp->next) { if (of_prop_cmp(pp->name, name) == 0) { - if (lenp != 0) + if (lenp != NULL) *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 != NULL; pp = pp->next) { if (of_prop_cmp(pp->name, prop_name) == 0) { of_node_get(np); goto out;