diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2017-02-28 10:58:25 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2017-04-18 10:36:02 +0100 |
commit | 239b085caab4cfd38708d5d1a7de8eb14bb952c7 (patch) | |
tree | b2e762b9a073d76366abc05d978f3ef18dcc6819 /drivers/arm | |
parent | 3d21c9452d4d5e17f545848bc4641274cdd6aa26 (diff) |
TZC: rename included C file to a header
C files shouldn't be included into others. This file only contains some
macros and functions that can be made `static inline`, so it is ok to
convert it into a header file.
This is the only occurrence of a C file being included in another one in
the codebase instead of using a header, other occurrences are a way of
achieving backwards-compatibility.
Functions therein have been qualified as `inline`.
Change-Id: I88fe300f6d85a7f0740ef14c9cb8fa54849218e6
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'drivers/arm')
-rw-r--r-- | drivers/arm/tzc/tzc400.c | 4 | ||||
-rw-r--r-- | drivers/arm/tzc/tzc_common_private.h (renamed from drivers/arm/tzc/tzc_common_private.c) | 11 | ||||
-rw-r--r-- | drivers/arm/tzc/tzc_dmc500.c | 4 |
3 files changed, 12 insertions, 7 deletions
diff --git a/drivers/arm/tzc/tzc400.c b/drivers/arm/tzc/tzc400.c index ca088c32..8c6f8ba6 100644 --- a/drivers/arm/tzc/tzc400.c +++ b/drivers/arm/tzc/tzc400.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,7 +33,7 @@ #include <mmio.h> #include <stddef.h> #include <tzc400.h> -#include "tzc_common_private.c" +#include "tzc_common_private.h" /* * Macros which will be used by common core functions. diff --git a/drivers/arm/tzc/tzc_common_private.c b/drivers/arm/tzc/tzc_common_private.h index 8b1ddf49..df10a1ee 100644 --- a/drivers/arm/tzc/tzc_common_private.c +++ b/drivers/arm/tzc/tzc_common_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -28,6 +28,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifndef __TZC_COMMON_PRIVATE_H__ +#define __TZC_COMMON_PRIVATE_H__ + #include <arch.h> #include <arch_helpers.h> #include <mmio.h> @@ -191,7 +194,7 @@ } #if DEBUG -static unsigned int _tzc_read_peripheral_id(uintptr_t base) +static inline unsigned int _tzc_read_peripheral_id(uintptr_t base) { unsigned int id; @@ -203,7 +206,7 @@ static unsigned int _tzc_read_peripheral_id(uintptr_t base) } #ifdef AARCH32 -static unsigned long long _tzc_get_max_top_addr(int addr_width) +static inline unsigned long long _tzc_get_max_top_addr(int addr_width) { /* * Assume at least 32 bit wide address and initialize the max. @@ -233,3 +236,5 @@ static unsigned long long _tzc_get_max_top_addr(int addr_width) #endif /* AARCH32 */ #endif + +#endif /* __TZC_COMMON_PRIVATE_H__ */ diff --git a/drivers/arm/tzc/tzc_dmc500.c b/drivers/arm/tzc/tzc_dmc500.c index 24e587c1..93ae9202 100644 --- a/drivers/arm/tzc/tzc_dmc500.c +++ b/drivers/arm/tzc/tzc_dmc500.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -33,7 +33,7 @@ #include <mmio.h> #include <tzc_dmc500.h> #include "tzc_common.h" -#include "tzc_common_private.c" +#include "tzc_common_private.h" /* * Macros which will be used by common core functions. |