From nobody Mon Dec 1 22:07:42 2025 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A385418FDDB for ; Sun, 30 Nov 2025 00:26:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764462371; cv=none; b=HBAzqrftJGGyewn3rAUNZ532ERlNCK46ddCk+hKyBVK+110ydU76ZFZsstVadHuXoRGY7GdTUtLQr9jc7JSXwrTsNWb531ce8Hh7jgg2dx9wYfIXgMD7yzw1S7AIfZgAUJoPubh3mf8Fd0ZdFT3voey4msZkjce+x33U5qKIAYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764462371; c=relaxed/simple; bh=DXrds2QZnhQeiB4twO/hRWkLmhmFyQh2ldJMznZxjoo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Fv3J8m3u56y6BFZVzIIC4Myui2YKeCiUldQ9SP7bKB57in9WvGMuArIaAGDXcEW+1Q9vwyswqCwOWvkyvFOz+n/i2RRDa/ZT1+PT22W33jWzZoavQIy7fpoXvRf0GQinCKEzwTd6KbkaeAAx1KzqkJvRBygqujBx1316RkNQPKc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=fxB9i6Z8; arc=none smtp.client-ip=220.197.31.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="fxB9i6Z8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=tChOrQVQnuoEXPQAWzmzpnvp45On0v+E3PDuWpK7JCc=; b=fxB9i6Z89BS8rTTf5oPSZLN0kx2Yw85eQRcuJpO1CNfP71aLvNaCb4SCu7ksL8 Ju9aVc2Zu1Z/QxF00VTkM4qEQiKBbSp843KqqhYoLvhkMH3k46yijyXrFTUpbD3d z+/LzxtNcFohFOJhpeX2zDlRgK4R1vvySodZdttU2nbPs= Received: from rom-ubuntu.. (unknown []) by gzga-smtp-mtada-g1-0 (Coremail) with SMTP id _____wDHJ_oEjytprB1qDg--.24827S2; Sun, 30 Nov 2025 08:25:40 +0800 (CST) From: Yufeng Wang To: "Michael S . Tsirkin" , Jason Wang , Xuan Zhuo , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Yufeng Wang , Vincent Mailhol , Arnaldo Carvalho de Melo , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Yuedong Wang , Yuexuan Wang , Haimei Qu <545714393@qq.com> Subject: [PATCH][v2] tools: virtio/linux/compiler.h add __must_check define. Date: Sun, 30 Nov 2025 08:25:38 +0800 Message-ID: <20251130002538.14875-1-r4o5m6e8o@163.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wDHJ_oEjytprB1qDg--.24827S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7KrWUAw18uF1ktr4ftF1xuFg_yoW8AFWxp3 WDury5GF48ur1fC3WfG3Wa9ry7uws3CryxKFy7uw1UCFy3tF1Iq3ZIkF1ayrZFv3yvkayF kr15Xryjka9rZaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pROzstUUUUU= X-CM-SenderInfo: 3uurkzkwhy0qqrwthudrp/xtbCzgUKf2krjwWBEAAA3n Port over the definition of __must_check and SIZE_MAX, make us can build to= ols/virtio. cc -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../..= /usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -= fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h -m= function-return=3Dthunk -fcf-protection=3Dnone -mindirect-branch-register -= pthread -c -o virtio_ring.o ../../drivers/virtio/virtio_ring.c In file included from ../include/linux/bits.h:32, from ../include/linux/bitops.h:14, from ../include/linux/log2.h:11, from ./linux/kernel.h:14, from ./linux/scatterlist.h:4, from ./linux/virtio.h:4, from ../../drivers/virtio/virtio_ring.c:6: ../include/linux/overflow.h:82:15: error: unknown type name =E2=80=98__must= _check=E2=80=99 82 | static inline __must_check size_t array_size(size_t a, size_t b) Fixes: fc92099902fb ("tools headers: Synchronize linux/bits.h with the kern= el sources") Signed-off-by: Yufeng Wang Tested-by: Yuedong Wang Tested-by: Yuexuan Wang Tested-by: Haimei Qu <545714393@qq.com> --- tools/virtio/linux/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/virtio/linux/compiler.h b/tools/virtio/linux/compiler.h index 204ef0e9f542..0a620a6777aa 100644 --- a/tools/virtio/linux/compiler.h +++ b/tools/virtio/linux/compiler.h @@ -11,6 +11,12 @@ =20 #define __aligned(x) __attribute((__aligned__(x))) =20 +#ifndef __must_check +# define __must_check +#endif //__must_check + +#define SIZE_MAX (~(size_t)0) + /** * data_race - mark an expression as containing intentional data races * --=20 2.43.0