diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2024-01-16 22:42:39 +0100 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2024-01-17 11:09:09 +0100 |
commit | fdd84270df0062fad68783eea8b51a6ed87b67cd (patch) | |
tree | f9ffb4c83cf936232efc5dfc4752475b2ab8de91 /src/boot/efi | |
parent | systemctl-is-system-running: display "offline" with --image (diff) | |
download | systemd-fdd84270df0062fad68783eea8b51a6ed87b67cd.tar.xz systemd-fdd84270df0062fad68783eea8b51a6ed87b67cd.zip |
Reorder arguments for calloc()-like functions, part #2
To appease gcc-14's -Wcalloc-transposed-args check.
Follow-up for 2a9ab0974bb290bc66dc84d909c33d23361b0752.
Diffstat (limited to 'src/boot/efi')
-rw-r--r-- | src/boot/efi/util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index aef831d132..6e15a8b85d 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -36,7 +36,7 @@ static inline void *xmalloc(size_t size) { } _malloc_ _alloc_(1, 2) _returns_nonnull_ _warn_unused_result_ -static inline void *xmalloc_multiply(size_t size, size_t n) { +static inline void *xmalloc_multiply(size_t n, size_t size) { assert_se(!__builtin_mul_overflow(size, n, &size)); return xmalloc(size); } @@ -57,7 +57,7 @@ static inline void* xmemdup(const void *p, size_t l) { return memcpy(xmalloc(l), p, l); } -#define xnew(type, n) ((type *) xmalloc_multiply(sizeof(type), (n))) +#define xnew(type, n) ((type *) xmalloc_multiply((n), sizeof(type))) typedef struct { EFI_PHYSICAL_ADDRESS addr; |