aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2020-02-28 10:22:05 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-02-28 10:22:05 +0000
commit562abecf986185816c0a3ebde65a84f7b160c38f (patch)
tree8f6a2ae183e869f91be837013231abe78750b3b5 /include
parent624852017b083fbec954e42041a6600ec9500b63 (diff)
parent845db72261658ec8f1f3c10b0f7408b19fb91a7e (diff)
downloadplatform_external_arm-trusted-firmware-562abecf986185816c0a3ebde65a84f7b160c38f.tar.gz
platform_external_arm-trusted-firmware-562abecf986185816c0a3ebde65a84f7b160c38f.tar.bz2
platform_external_arm-trusted-firmware-562abecf986185816c0a3ebde65a84f7b160c38f.zip
Merge "fconf: Fix misra issues" into integration
Diffstat (limited to 'include')
-rw-r--r--include/lib/fconf/fconf.h6
-rw-r--r--include/lib/object_pool.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/include/lib/fconf/fconf.h b/include/lib/fconf/fconf.h
index f58ff5710..0401e5c06 100644
--- a/include/lib/fconf/fconf.h
+++ b/include/lib/fconf/fconf.h
@@ -14,9 +14,9 @@
#define FCONF_REGISTER_POPULATOR(name, callback) \
__attribute__((used, section(".fconf_populator"))) \
- const struct fconf_populator name##__populator = { \
- .info = #name, \
- .populate = callback \
+ const struct fconf_populator (name##__populator) = { \
+ .info = (#name), \
+ .populate = (callback) \
};
/*
diff --git a/include/lib/object_pool.h b/include/lib/object_pool.h
index 0f85331a8..66e8c4780 100644
--- a/include/lib/object_pool.h
+++ b/include/lib/object_pool.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -56,13 +56,13 @@ struct object_pool {
*/
static inline void *pool_alloc_n(struct object_pool *pool, size_t count)
{
- if (pool->used + count > pool->capacity) {
+ if ((pool->used + count) > pool->capacity) {
ERROR("Cannot allocate %zu objects out of pool (%zu objects left).\n",
count, pool->capacity - pool->used);
panic();
}
- void *obj = (char *)(pool->objects) + pool->obj_size * pool->used;
+ void *obj = (char *)(pool->objects) + (pool->obj_size * pool->used);
pool->used += count;
return obj;
}