devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	sudeep.holla-5wv7dgnIgG8@public.gmane.org,
	lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org,
	mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	ahs3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	erik.veijola-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: [PATCH v3 1/8] ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node
Date: Fri, 21 Jul 2017 14:39:30 +0300	[thread overview]
Message-ID: <1500637177-16095-2-git-send-email-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <1500637177-16095-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

The is_acpi_data_node() function takes a struct fwnode_handle pointer as
its argument. The validity of the pointer is first checked. Extend the
check to cover error values as is done by similar is_acpi_node() and
is_acpi_device_node() functions.

Signed-off-by: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 include/acpi/acpi_bus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 68bc6be..7569123 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -414,7 +414,7 @@ static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwno
 
 static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
 {
-	return fwnode && fwnode->type == FWNODE_ACPI_DATA;
+	return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_ACPI_DATA;
 }
 
 static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-07-21 11:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21 11:39 [PATCH v3 0/8] Remove fwnode type field, constify property fwnode arguments Sakari Ailus
     [not found] ` <1500637177-16095-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-21 11:39   ` Sakari Ailus [this message]
2017-07-21 11:59     ` [PATCH v3 1/8] ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node Andy Shevchenko
2017-07-21 12:12       ` Andy Shevchenko
2017-07-21 11:39   ` [PATCH v3 4/8] ACPI: Constify acpi_bus helper functions, switch to macros Sakari Ailus
2017-07-21 11:52   ` [PATCH v3 0/8] Remove fwnode type field, constify property fwnode arguments Rafael J. Wysocki
2017-07-21 12:33     ` Andy Shevchenko
     [not found]       ` <1500640389.29303.177.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-21 12:29         ` Rafael J. Wysocki
2017-07-24 20:28           ` Rafael J. Wysocki
2017-08-08  9:32             ` Sakari Ailus
2017-08-09  0:53               ` Rafael J. Wysocki
2017-08-09  8:47                 ` Sakari Ailus
2017-08-09  8:50                   ` Sakari Ailus
2017-08-09 23:27                     ` Rafael J. Wysocki
2017-07-21 11:39 ` [PATCH v3 2/8] device property: Get rid of struct fwnode_handle type field Sakari Ailus
2017-07-21 11:39 ` [PATCH v3 3/8] ACPI: Prepare for constifying acpi_get_next_subnode() fwnode argument Sakari Ailus
2017-07-21 12:30   ` Andy Shevchenko
2017-07-21 11:39 ` [PATCH v3 5/8] ACPI: Constify internal fwnode arguments Sakari Ailus
2017-07-21 11:39 ` [PATCH v3 6/8] device property: Constify argument to pset fwnode backend Sakari Ailus
2017-07-21 11:39 ` [PATCH v3 7/8] device property: Constify fwnode property API Sakari Ailus
2017-07-21 11:39 ` [PATCH v3 8/8] device property: Introduce fwnode_property_get_reference_args Sakari Ailus
     [not found]   ` <1500637177-16095-9-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-21 12:06     ` Andy Shevchenko
2017-07-21 12:11   ` [PATCH v3.1 " Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500637177-16095-2-git-send-email-sakari.ailus@linux.intel.com \
    --to=sakari.ailus-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=ahs3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=erik.veijola-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sudeep.holla-5wv7dgnIgG8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).