From b598df479a11b96bc6be97e554c46c7eb6927400 Mon Sep 17 00:00:00 2001 From: Yogesh Tyagi Date: Fri, 6 Feb 2026 00:05:37 +0800 Subject: [PATCH] Fix sign-conversion warnings with musl ioctl musl's ioctl request macros (_IOC) expand to unsigned long values, causing sign-conversion warnings when passed to ioctl() which expects an int as the request parameter. This issue occurs when building with -Werror -Wsign-conversion flags on musl-based systems, causing compilation failures. Cast the IOCTL_MEI_* macros explicitly to int in three locations: - IOCTL_MEI_CONNECT_CLIENT in __mei_connect() - IOCTL_MEI_CONNECT_CLIENT_VTAG in __mei_connect_vtag() - IOCTL_MEI_NOTIFY_GET in __mei_notify_get() This maintains compatibility with both glibc (where _IOC expands to int) and musl (where it expands to unsigned long). Signed-off-by: Yogesh Tyagi --- src/linux/mei.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/linux/mei.c b/src/linux/mei.c index 21cdee0..0e4d6e6 100644 --- a/src/linux/mei.c +++ b/src/linux/mei.c @@ -197,7 +197,7 @@ static inline int __mei_connect(struct mei *me, struct mei_connect_client_data * int rc; errno = 0; - rc = ioctl(me->fd, IOCTL_MEI_CONNECT_CLIENT, d); + rc = ioctl(me->fd, (int)IOCTL_MEI_CONNECT_CLIENT, d); me->last_err = errno; return rc == -1 ? -me->last_err : 0; } @@ -208,7 +208,7 @@ static inline int __mei_connect_vtag(struct mei *me, int rc; errno = 0; - rc = ioctl(me->fd, IOCTL_MEI_CONNECT_CLIENT_VTAG, d); + rc = ioctl(me->fd, (int)IOCTL_MEI_CONNECT_CLIENT_VTAG, d); me->last_err = errno; return rc == -1 ? -me->last_err : 0; } @@ -229,7 +229,7 @@ static inline int __mei_notify_get(struct mei *me) int rc; errno = 0; - rc = ioctl(me->fd, IOCTL_MEI_NOTIFY_GET, ¬ification); + rc = ioctl(me->fd, (int)IOCTL_MEI_NOTIFY_GET, ¬ification); me->last_err = errno; return rc == -1 ? -me->last_err : 0; }