From nobody Fri Oct 3 14:29:31 2025 Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (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 B9104314A79 for ; Fri, 29 Aug 2025 15:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756480222; cv=none; b=K0yriLVvnPeNu2utVf/BU5dchSXy3Q11NCeuk+Lo1KOB4Q9gXGu13rHTUzL/JJGaIMsz3nyL8MYVFDou0PubUhuQpTUJNWN9qef9N4KqcIQSSG/sr+N2FsNBbzZw0/l7oI6pba8QTt8H97TMcd1VCYLqvdOgAmbU8wSP/B2zzfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756480222; c=relaxed/simple; bh=qsV/u9Nwr0h7M/C3VeO1oeIS2ynCNx5VPqSz8xyvcZI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ezJUMKU6Kyx8ESPRf8GCrkUyp3w8HAj1/He/fypgoictRCS+0HwLZJ+WT5hbAsJR3xgYn+/mTuFITrmzfc43vmM6lzRnkaceca6Vy0WdT+vNpDZuUX+XtRHClMAdjFyAs1OnC9klGiGThiuJ6w8owVg7KvKP+pLxqU/yqTq7f7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alyssa.is; spf=pass smtp.mailfrom=alyssa.is; dkim=pass (2048-bit key) header.d=alyssa.is header.i=@alyssa.is header.b=OvGqZzsx; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=WansO7sm; arc=none smtp.client-ip=202.12.124.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alyssa.is Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alyssa.is Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alyssa.is header.i=@alyssa.is header.b="OvGqZzsx"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="WansO7sm" Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 9CD171D001E7; Fri, 29 Aug 2025 11:10:18 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Fri, 29 Aug 2025 11:10:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1756480218; x=1756566618; bh=5O3s3cpJyL9ApAILIp2T0 tGI4d5H31t5BPcHpcF2ayA=; b=OvGqZzsx/FzdATbJoy0unXrm8eWlKJfc0OMiG MWVXwBK5LHIDIwz3bfF7R0bvL9wFqFaA/NZsfoVRs7jwC94cdVfNR85Yz0xNznrc owpw+EILrx5OnfhGsxCnxHu0wFjryXOc076zRQv/JTztKO0yI4hrp8xbqH1cqXHk mOOcP+a3BztT2oyZgCw2P8BUgzfqqE6nrK/R2vn8vsouDKOIfINU19qtuiNN379i 7Ws5LUKl0YAjndvXcvSy6SCOiMHzRqDW14JVZPnhR0V2uMejhb1LDOqpZtqGMqMG YCQk/dckKvO/MuPyJYsIoma4Bjr1l9NiHqw2KiV8BivuFqF9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1756480218; x=1756566618; bh=5O3s3cpJyL9ApAILIp2T0tGI4d5H31t5BPc HpcF2ayA=; b=WansO7smqDH58YZ0VWJCiw5PO+2UgGn4QVRtzvzn2NB5r4qUS7x sRPhndFcfDK3ZODb8xeRwYF4ikHC3XxgIEWup2eH2vWW1HK6eOhKOnx8gUpOai7C UQkqVIhzMPzZrWB3Vm2VMNicRLOtFbd74wq8+/+capo3YcSWZFiRKOypUKcehZd4 vQKPAfo1zEN5y+GdLnKT6OiFIWQ3ytaR6B7ZUa4d9Hz3dGWDa1V/tjLal/JKA3d7 7W/KqIDZMU2AXO10sJ1zmyv/rIZQCEEeIQYFtbXXmrhLDr8Yo163Y4y+crbIj8Ts NgfvJsQ6txQMdnksP4xtQA/EkcHHrpoD7kQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddukeegvddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepueefiedvhe ffveegieejjeevgfejjeduveekffeiveeuvedvtedvhfelieeutdfgnecuffhomhgrihhn pehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthhtohepiedpmhho uggvpehsmhhtphhouhhtpdhrtghpthhtohepgihurghniihhuhhosehlihhnuhigrdgrlh hisggrsggrrdgtohhmpdhrtghpthhtohepvhhirhhtuhgrlhhiiigrthhiohhnsehlihhs thhsrdhlihhnuhigrdguvghvpdhrtghpthhtohepvghpvghrvgiimhgrsehrvgguhhgrth drtghomhdprhgtphhtthhopehjrghsohifrghnghesrhgvughhrghtrdgtohhmpdhrtghp thhtohepmhhsthesrhgvughhrghtrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrh hnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 29 Aug 2025 11:10:17 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 214EE14F3423; Fri, 29 Aug 2025 17:10:06 +0200 (CEST) From: Alyssa Ross To: "Michael S. Tsirkin" Cc: Jason Wang , Xuan Zhuo , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] virtio_config: clarify output parameters Date: Fri, 29 Aug 2025 17:09:44 +0200 Message-ID: <20250829150944.233505-1-hi@alyssa.is> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This was ambiguous enough for a broken patch (206cc44588f7 ("virtio: reject shm region if length is zero")) to make it into the kernel, so make it clearer. Link: https://lore.kernel.org/r/20250816071600-mutt-send-email-mst@kernel.o= rg/ Signed-off-by: Alyssa Ross Reviewed-by: Stefan Hajnoczi --- include/linux/virtio_config.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 8bf156dde554..7427b79d6f3d 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -193,14 +193,15 @@ static inline bool virtio_has_feature(const struct vi= rtio_device *vdev, } =20 static inline void virtio_get_features(struct virtio_device *vdev, - u64 *features) + u64 *features_out) { if (vdev->config->get_extended_features) { - vdev->config->get_extended_features(vdev, features); + vdev->config->get_extended_features(vdev, features_out); return; } =20 - virtio_features_from_u64(features, vdev->config->get_features(vdev)); + virtio_features_from_u64(features_out, + vdev->config->get_features(vdev)); } =20 /** @@ -326,11 +327,11 @@ int virtqueue_set_affinity(struct virtqueue *vq, cons= t struct cpumask *cpu_mask) =20 static inline bool virtio_get_shm_region(struct virtio_device *vdev, - struct virtio_shm_region *region, u8 id) + struct virtio_shm_region *region_out, u8 id) { if (!vdev->config->get_shm_region) return false; - return vdev->config->get_shm_region(vdev, region, id); + return vdev->config->get_shm_region(vdev, region_out, id); } =20 static inline bool virtio_is_little_endian(struct virtio_device *vdev) base-commit: 07d9df80082b8d1f37e05658371b087cb6738770 --=20 2.50.1