diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-11-03 20:59:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-03 20:59:57 +0000 |
commit | f9a6db0f4804834930c4d4facfade0d850491eab (patch) | |
tree | 98809458ed84c61299f2e1a141cec2f67eb8a2fc | |
parent | 157650c792a1d053120571576d3841cbebd02329 (diff) | |
parent | 2614ea3ed6ad5f671d0dd026e3d66ce7652f601b (diff) | |
download | arm-trusted-firmware-f9a6db0f4804834930c4d4facfade0d850491eab.tar.gz |
Merge pull request #1151 from JoelHutton/jh/MISRA-Mandatory
Change sizeof to use type of struct not function
-rw-r--r-- | include/lib/el3_runtime/cpu_data.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/lib/el3_runtime/cpu_data.h b/include/lib/el3_runtime/cpu_data.h index c0c3a199..bd787ce9 100644 --- a/include/lib/el3_runtime/cpu_data.h +++ b/include/lib/el3_runtime/cpu_data.h @@ -141,17 +141,17 @@ void init_cpu_ops(void); #define set_cpu_data(_m, _v) _cpu_data()->_m = _v #define get_cpu_data_by_index(_ix, _m) _cpu_data_by_index(_ix)->_m #define set_cpu_data_by_index(_ix, _m, _v) _cpu_data_by_index(_ix)->_m = _v - +/* ((cpu_data_t *)0)->_m is a dummy to get the sizeof the struct member _m */ #define flush_cpu_data(_m) flush_dcache_range((uintptr_t) \ - &(_cpu_data()->_m), \ - sizeof(_cpu_data()->_m)) + &(_cpu_data()->_m), \ + sizeof(((cpu_data_t *)0)->_m)) #define inv_cpu_data(_m) inv_dcache_range((uintptr_t) \ - &(_cpu_data()->_m), \ - sizeof(_cpu_data()->_m)) + &(_cpu_data()->_m), \ + sizeof(((cpu_data_t *)0)->_m)) #define flush_cpu_data_by_index(_ix, _m) \ flush_dcache_range((uintptr_t) \ &(_cpu_data_by_index(_ix)->_m), \ - sizeof(_cpu_data_by_index(_ix)->_m)) + sizeof(((cpu_data_t *)0)->_m)) #endif /* __ASSEMBLY__ */ |