summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-11-26 18:27:10 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-11-26 18:27:10 +1100
commit437701274b0e2f816b6f63f4bb6b9525c5f561ee (patch)
treefca177432e28218a3f7127ad54bc849560855a02
parentcf8def92617e3cc554c261ff7c740ba7e76261af (diff)
downloadblackbird-skiboot-437701274b0e2f816b6f63f4bb6b9525c5f561ee.tar.gz
blackbird-skiboot-437701274b0e2f816b6f63f4bb6b9525c5f561ee.zip
Add attribute warn_unused_result to compiler.h and dt_expand_node
This would have thrown a compiler warning for cf8def9 rather than failing at runtime. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--include/compiler.h1
-rw-r--r--include/device.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/include/compiler.h b/include/compiler.h
index ab6e28ea..35bf1652 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -30,6 +30,7 @@
#define __noreturn __attribute__((noreturn))
/* not __const as this has a different meaning (const) */
#define __attrconst __attribute__((const))
+#define __warn_unused_result __attribute__((warn_unused_result))
#if 0 /* Provided by gcc stddef.h */
#define offsetof(type,m) __builtin_offsetof(type,m)
diff --git a/include/device.h b/include/device.h
index 65ceef45..16c26bb0 100644
--- a/include/device.h
+++ b/include/device.h
@@ -18,6 +18,7 @@
#define __DEVICE_H
#include <ccan/list/list.h>
#include <ccan/short_types/short_types.h>
+#include <compiler.h>
/* Any property or node with this prefix will not be passed to the kernel. */
#define DT_PRIVATE "skiboot,"
@@ -187,7 +188,7 @@ void dt_free(struct dt_node *node);
/* Parse an initial fdt */
void dt_expand(const void *fdt);
-int dt_expand_node(struct dt_node *node, const void *fdt, int fdt_node);
+int dt_expand_node(struct dt_node *node, const void *fdt, int fdt_node) __warn_unused_result;
/* Simplified accessors */
u64 dt_prop_get_u64(const struct dt_node *node, const char *prop);
OpenPOWER on IntegriCloud