diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2025-07-04 13:29:38 +0100 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2025-07-20 21:15:10 +0530 |
commit | 663b05a5f745f6b1360f073587bb57fe9af6a40a (patch) | |
tree | 752b5828f654624ce72ef272adb36d42f76af137 /lib/utils | |
parent | edfbc1285dd9ac624665fe9fa5de26437d61c1eb (diff) | |
download | opensbi-663b05a5f745f6b1360f073587bb57fe9af6a40a.zip opensbi-663b05a5f745f6b1360f073587bb57fe9af6a40a.tar.gz opensbi-663b05a5f745f6b1360f073587bb57fe9af6a40a.tar.bz2 |
include: sbi: fix swap errors with newer gcc -Werror=sequence-point
The BSWAPxx() macros are now throwing the following warnings with
newer gcc versions. This is due to throwing an argument in that may
be evaluated more than one (I think) and therefore things like the
example below should be avoided.
Fix by making a set of BSWAPxx() wrappers which specifically only
evaluate 'x' once.
In file included lib/sbi/sbi_mpxy.c:21:
lib/sbi/sbi_mpxy.c: In function ‘sbi_mpxy_write_attrs’:
ib/sbi/sbi_mpxy.c:632:63: error: operation on ‘mem_idx’ may be undefined [-Werror=sequence-point]
632 | attr_val = le32_to_cpu(mem_ptr[mem_idx++]);
| ~~~~~~~^~
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Rahul Pathak <rahul@summations.net>
Reviewed-by: Xiang W <wxjstz@126.com>
Link: https://lore.kernel.org/r/20250704122938.897832-1-ben.dooks@codethink.co.uk
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils')
0 files changed, 0 insertions, 0 deletions