From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f176.google.com (mail-dy1-f176.google.com [74.125.82.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4B71399031 for ; Fri, 26 Jun 2026 20:31:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782505904; cv=none; b=iF0OeJiUIJpFRSJjNJ23ysnea0jpyMFMcxq6U3WPUSZX/5fT/2egzHrFDqsvKG11F7fHOVIRiqd7cOfBZ1gPNtXJ2elpDaXX2PYtD+OS/EY+Gn2bWoRiYDcx8gC7x3Wx0ozCDs8jXjqJtRuPa6SqpoCLu/E0/H7FFdX0cyLOSRs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782505904; c=relaxed/simple; bh=8COOnbZMJUxF4xVAYNoIlb7bDxzTG9J03+R0KaoyutE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=sBGO3ex/eD2zZyFsnNsvIGUE3gf3mABKV9zwyo3r5Glzj5kC7xTP0cRWe7jI03caogF1KNfB24JBFawz4R4hwPr0ghSUNw0CPfWIxcZYMI08nGVRIyX6OySdYZvjVJQfphaUKUM9cs1OEsNwQwlt13D08wi03dnTxYU4vcwi+Bo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RIYHK+8W; arc=none smtp.client-ip=74.125.82.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RIYHK+8W" Received: by mail-dy1-f176.google.com with SMTP id 5a478bee46e88-30bf132969bso2157265eec.0 for ; Fri, 26 Jun 2026 13:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782505902; x=1783110702; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=saLU0AoA9Cmy1VJ6xB3QXKeFOZEGeKiaAK6r/QB287s=; b=RIYHK+8W1lur2g/OqyILUgWtB99o8VsTMh4Y4lUo8Qa3qSVD0gNiUxd0+VDL7VuMOc czE/reXvEu3akGeg+ySOerOcnDj6Q6II6POolDgaNJIB65tbck587m5BRrqWaqXG7hc7 1CzCa6MgLwx+LxfErg/HAH/yuP92YOv6GwCicCDIzYoT7EiNT4V+muUpsBu+dgUy7sLj ph7FbZ+WUTnkWh9nMZrqg25JB3sYPqOTSvK5X6teT45HmlpXaP3Grkntes/ebk51A40c ko/R2+zb2D14emMP0DcpD6kphKJqBn9mhOdA4mJtTLrYYsyP97Q+ITroi3KllT9jpINk A9hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782505902; x=1783110702; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=saLU0AoA9Cmy1VJ6xB3QXKeFOZEGeKiaAK6r/QB287s=; b=XGgKTuizgywEpqlt6pFFXGwL0fF7oVMOL5Z+3v1Xu90Ru03PCGa6rFCjky12/199Bj 8cbuQausQhQpfQ6StYXmqtlqCA3JOyXmqctwFiw9OefoeLH4Gqqt/G9S2am3oBeKJNAE fw7a8yZioOaph6ha0iGElXThQo786OWNjomgJxpKXPx36KXloWnCgWKkOtAb4+3q8nKM t0o5EG5SRBQHnS9ZmgTHinvMuz4kuw4wPvvkVEzs6N8qMPFCajM2COu5+TYQkFTGZd3n VL1/vTFO2m2BhihWQ6ZUV1lm8CNl9aqdHsjX5mq1erVoT1dnyNIBT4y51CzRX2/H8Thy Tbyw== X-Forwarded-Encrypted: i=1; AHgh+RparbvNFCZzlPJ/wVTY32ZTCAgISFERXIkEmiXkV2hs1Rh43OUgrAylcgWZRs40JeGhu8X15S7qe6BgKkQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzpBKx6TEe8mBG5yfgNH6maJPPTvQg+YY611Eh+nY0pDLaq+iQv KwVrPS2eYIJ9fqyanyhhANWrvAtbIR3vBtSkJ3tK6Y/rDjyph1YxbdI= X-Gm-Gg: AfdE7cklulSO2QdjYwnlsWN/zn+iCooUDCnLrBbUikpUE77TJ6QJOQLWcQA+FghjdRO 1OqErjIgDO5k/Qrl3JUfmdj00zc+3dIC9mXINC4O9+3zL6SrHyPEw5d6Ld6Izgm1Fl+9GQZMIML CaazzVByUgYJwQ/xaVU+MzGQ5CPC56G54O23EFPwfRRG6xRc47B4rZtZnWif1IWkT9deiFg2vOm Ty4dl79o03B651i9s/6d3S7KigNVRAasyuanhSloQ0hAQ4s51bIxXG4tEMvMCXWBV09HnD3lskL t2hvqtx7Zud8UwuZ0vfZhvtg9fuTX2j5/y2bepqG2hIt36CTTKBHM+guoOf/DwHezkubHhG0c6r 0ZMjrZGP6IM4j4/9HP+OzekiuJJPGM7IfR+0Zk/KbWzfoudlbAc1EYCNli5TAHYubcQHbqVDnTL QpCgSueTXIquBoBWAnx+YvcBuaGqD60rUBv+EWxeknwBjehufA/+ZxM2jqif53Qqqf X-Received: by 2002:a05:7300:7246:b0:304:630d:e4ec with SMTP id 5a478bee46e88-30c84dc428cmr8616976eec.28.1782505901801; Fri, 26 Jun 2026 13:31:41 -0700 (PDT) Received: from localhost.localdomain ([186.158.238.108]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30c7c58831asm22580134eec.13.2026.06.26.13.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 13:31:41 -0700 (PDT) From: =?UTF-8?q?Nicol=C3=A1s=20Antinori?= To: Joerg Roedel , Will Deacon Cc: =?UTF-8?q?Nicol=C3=A1s=20Antinori?= , Alexandre Courbot , Alice Ryhl , Andreas Hindborg , Benno Lossin , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Boqun Feng , Daniel Almeida , Danilo Krummrich , Gary Guo , Miguel Ojeda , =?UTF-8?q?Onur=20=C3=96zkan?= , Robin Murphy , Shuah Khan , Tamir Duberstein , Trevor Gross , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, iommu@lists.linux.dev, linux-kernel-mentees@lists.linux.dev Subject: [PATCH] rust: iommu: replace core::mem::zeroed with pin_init::zeroed Date: Fri, 26 Jun 2026 17:31:19 -0300 Message-ID: <20260626203122.713317-1-nico.antinori.7@gmail.com> X-Mailer: git-send-email 2.47.3 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: 8bit All types in `bindings` implement `Zeroable` if they can. This enables using `pin_init::zeroed()` for `io_pgtable_cfg` initialization instead of relying on `..unsafe { core::mem::zeroed() }`. This change improves readability and removes an unnecessary unsafe block. Link: https://github.com/Rust-for-Linux/linux/issues/1189 Suggested-by: Benno Lossin Signed-off-by: Nicolás Antinori --- rust/kernel/iommu/pgtable.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/kernel/iommu/pgtable.rs b/rust/kernel/iommu/pgtable.rs index c88e38fd938a..8faa1d8d9fad 100644 --- a/rust/kernel/iommu/pgtable.rs +++ b/rust/kernel/iommu/pgtable.rs @@ -102,8 +102,7 @@ pub unsafe fn new_raw(dev: &Device, config: Config) -> Result