diff options
author | J. Neuschäfer <j.ne@posteo.net> | 2024-12-11 23:25:25 +0100 |
---|---|---|
committer | Caleb Connolly <caleb.connolly@linaro.org> | 2025-01-22 16:43:54 +0100 |
commit | e288366364c39f684a0c4a0ea9336f0873cb9b67 (patch) | |
tree | d5a4f523117cd239e7688c88b583a06604d6e24b /drivers/fpga/fpga-uclass.c | |
parent | d22fe8f2aaf976481e1195791cadacf8c259ee4c (diff) |
cmd: ufetch: Fix type mismatch on 32-bit
On 32-bit architectures, LAST_LINE (_LAST_LINE - 1UL) is 64 bits long,
but size_t (from ARRAY_SIZE(...)) is 32 bits. This results in a warning
because the max() macro expects the same type on both sides:
cmd/ufetch.c: In function ‘do_ufetch’:
include/linux/kernel.h:179:24: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
179 | (void) (&_max1 == &_max2); \
| ^~
cmd/ufetch.c:92:25: note: in expansion of macro ‘max’
92 | int num_lines = max(LAST_LINE + 1, ARRAY_SIZE(logo_lines));
| ^~~
Fix this by casting LAST_LINE to size_t.
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Link: https://lore.kernel.org/r/20241211-ufetch-v2-1-2b5432ffaeb1@posteo.net
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Diffstat (limited to 'drivers/fpga/fpga-uclass.c')
0 files changed, 0 insertions, 0 deletions