From d59b95a4cc0fdfd67745f7c6e5c098e95c3bd70a Mon Sep 17 00:00:00 2001
From: Yogesh Tyagi <yogesh.tyagi@intel.com>
Date: Wed, 11 Feb 2026 21:40:28 +0800
Subject: [PATCH] Suppress sign-conversion warning only for ioctl calls

Add targeted #pragma directives to suppress -Wsign-conversion warnings
only around specific ioctl() calls where musl's unsigned long macros
are converted to int. This preserves the warning for the rest of the
codebase where it can catch real bugs.

The ioctl macro/function signature mismatch is a known harmless
difference between glibc and musl - the bit pattern is preserved.

Upstream-Status: Pending
Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
---
 src/linux/mei.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/linux/mei.c b/src/linux/mei.c
index 3a500ce..9778608 100644
--- a/src/linux/mei.c
+++ b/src/linux/mei.c
@@ -193,8 +193,11 @@ static inline int __mei_connect(struct mei *me, struct mei_connect_client_data *
 	int rc;
 
 	errno = 0;
+	#pragma GCC diagnostic push
+	#pragma GCC diagnostic ignored "-Wsign-conversion"
 	rc = ioctl(me->fd, IOCTL_MEI_CONNECT_CLIENT, d);
 	me->last_err = errno;
+	#pragma GCC diagnostic pop
 	return rc == -1 ? -me->last_err : 0;
 }
 
@@ -204,8 +207,11 @@ static inline int __mei_connect_vtag(struct mei *me,
 	int rc;
 
 	errno = 0;
+	#pragma GCC diagnostic push
+	#pragma GCC diagnostic ignored "-Wsign-conversion"
 	rc = ioctl(me->fd, IOCTL_MEI_CONNECT_CLIENT_VTAG, d);
 	me->last_err = errno;
+	#pragma GCC diagnostic pop
 	return rc == -1 ? -me->last_err : 0;
 }
 
@@ -225,8 +231,11 @@ static inline int __mei_notify_get(struct mei *me)
 	int rc;
 
 	errno = 0;
+	#pragma GCC diagnostic push
+	#pragma GCC diagnostic ignored "-Wsign-conversion"
 	rc = ioctl(me->fd, IOCTL_MEI_NOTIFY_GET, &notification);
 	me->last_err = errno;
+	#pragma GCC diagnostic pop
 	return rc == -1 ? -me->last_err : 0;
 }
 
-- 
2.37.3

