diff options
author | Roberto Vargas <roberto.vargas@arm.com> | 2018-02-12 12:36:17 +0000 |
---|---|---|
committer | Roberto Vargas <roberto.vargas@arm.com> | 2018-02-28 17:18:46 +0000 |
commit | 7fabe1a89903cab4919304faa085ee6eaaec5c9d (patch) | |
tree | 140db3931433edf3ac1724eef7db426614afa42a /include/lib/el3_runtime/pubsub.h | |
parent | 9fb8af33c40f21becde99fc15db73b1f4d82059c (diff) |
Fix MISRA rule 8.4 in common code
Rule 8.4: A compatible declaration shall be visible when
an object or function with external linkage is defined.
Change-Id: I26e042cb251a6f9590afa1340fdac73e42f23979
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Diffstat (limited to 'include/lib/el3_runtime/pubsub.h')
-rw-r--r-- | include/lib/el3_runtime/pubsub.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/lib/el3_runtime/pubsub.h b/include/lib/el3_runtime/pubsub.h index 9a854808..2c8a1967 100644 --- a/include/lib/el3_runtime/pubsub.h +++ b/include/lib/el3_runtime/pubsub.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -49,9 +49,12 @@ * Have the function func called back when the specified event happens. This * macro places the function address into the pubsub section, which is picked up * and invoked by the invoke_pubsubs() function via. the PUBLISH_EVENT* macros. + * + * The extern declaration is there to satisfy MISRA C-2012 rule 8.4. */ #define SUBSCRIBE_TO_EVENT(event, func) \ - pubsub_cb_t __cb_func_##func##event __pubsub_section(event) = func + extern pubsub_cb_t __cb_func_##func##event __pubsub_section(event); \ + pubsub_cb_t __cb_func_##func##event __pubsub_section(event) = (func) /* * Iterate over subscribed handlers for a defined event. 'event' is the name of |