From nobody Mon Dec 1 20:57:20 2025 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 5168A32D0D4 for ; Mon, 1 Dec 2025 15:52:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764604346; cv=none; b=QqxoOmCgPBQY/9DkcxmRjPSn8fN3OhTWM7wftzfY7IgEmpEVqtfWEk9XvfkPSPfw+NtX0V2yrzF7GoO7vOU8P+I9cM40qV9GzRQD29qrDuXdmq41XeU1cStkje0Yprj2jleAcMUML08FZABCiaQ/mk95W8ukmhhUMGXelo6fZwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764604346; c=relaxed/simple; bh=XGyeeigAK9L746tngnKMOCKOk5BQ+hWN4+EJTlSpqSk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IjiaAyx+UDGbIB8eMbDEGk5+zdCu2BXmFl0qP1K65pPSPT4rYaT/EZFvuKv96dIYiq+PpxfdL/d6BxEfpkV4BC+qrSSXRpS6Uz9jH+wX2S1T4nypmENcpsrY05V96Gr6+YZOgcq7dGXFYW93YWIYX1AX2ijmc17jKgf9WtPqrOE= 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=ImMRwE8b; arc=none smtp.client-ip=209.85.214.174 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="ImMRwE8b" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-298287a26c3so52330245ad.0 for ; Mon, 01 Dec 2025 07:52:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764604345; x=1765209145; 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=pVKsqLAjHiedCsMTkQj6KU9uWiG9cI4IM21lpckerh0=; b=ImMRwE8b/Fjc5hCvvFAs4/MtNwNQvIsehrcYoQ34UMRmy88hdHkudaz7hVav3ODsF0 +g4Bwwgn8XF0hCzld0EGWArZ3iqa1lsew9wgUzez6dRoFp4z/8BNBv0MAd0vLJ4BvAsH /o5/8ChQ6MPoYk+/b57KvLOMxJKHLUq4cEygNReIukWJOoHUQoqpmWzRx3GPy3MMrrdu OqhhpXUemzCDpYHlGAVjJCHyUzIXi1nNBXgKmeuEHcHMx2VhRZZwrChRUqlGNoT2GdeP SM1HM+C7Tmxw76LMztzqmx5uZKIqX5ZtFNiohpc+Mw/AHos0s8VOn3ds4VarKXEzR2Ym hwkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764604345; x=1765209145; 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=pVKsqLAjHiedCsMTkQj6KU9uWiG9cI4IM21lpckerh0=; b=aQtWvkQ2b2pEyXj7AVkZSJolBzlo3rsNLWzGS2w869Nht4BBhROw//R8ZSBOJrW8Yf ZPkkauI+AQogZC5lrRxDiI62Oj338ohQDWAk/8D+I/QJAM6VioWAiav3eApkZh1/OciA T+9JTre6pqTMbBZd/MvRS20h/+DCbUUWcguE+ZSVhrNLeYhOiLQWPBHyymlj18NhoYUR NnDBKZYp8I3Ig3CJ1I2MxoVsqDdCBdJVnyuXO5zm3j7g50UeKR5csUKBfQnqlYVtlIt+ xmNLWvch3EZ6N+xFVwwJQcvaLpPmrM5hZPoL8AbBwPwcY3E1olff2427uTqe71hpKju3 oVTA== X-Forwarded-Encrypted: i=1; AJvYcCWu4K0Do0J2akIcyGmyLDKOC2c1ZyOMExcQZMEeNp8w/9g/gxZbOwfbl3kSS2sDRo7TEg5IyADTkcrp1Ww=@vger.kernel.org X-Gm-Message-State: AOJu0YyHgWONdqmIRg8R++yQZWWFnYfkwtn3twSLbYMGzjxTRRUDHw1N CMjPvBiaXZh2AZWpgGR79k2aITIl5bo63+plXB96nFsIY0ysQPdZ/Rdu X-Gm-Gg: ASbGncv6SpfjRvtxvjbewX7ph/Ah2Mh02vNghPWGJ2h9X2cz4+aH5iRWA6Y5So0pmm8 94X4DpDyT2gG1Tr81bhN3GT2Snt3AlP0jRuhTbGDTXsb0IZhD46tQFVDG0uOiQcwWx/i7idYEPe y+3aBmnFbxFKyaSD4lcjMaLPOF7glc0ur6F97ODiMHT7+KjVBfFuWftHV5QGeqZdiF7/XJMBnH+ 6YeTB4IZWYKoar9cH7nx+Chdw61q1uLycYWfO3wdaz1zUpVC0qezBhgK+oYo2Lu70CpOf8Oou3l RzDRiUKKyXva6wAgePCKUobHQXQuKKHSW6QCfrLZ5HJ8fL/DBvCxna0Fp4IXf0uigsokD5onSnN 2zm9gN8iwJ1yV5o0A3Im7+6SI1i4+xfAjjJmZNpBWRZkNekSiP0uy03xkq1og1ovsaHRy3OW5Rw /qiSxaY9w4yfplmObvxEQJdakzGXuD1PmUdsxT9V4/YKBP0qeCGXmEHOsGSiN8b898 X-Google-Smtp-Source: AGHT+IGat4VhF83+oMq7CNZLZBFhrHJD09jfouaostnsMQaYHnfRxI2M9f052yuItSKVu6dT7hxfmw== X-Received: by 2002:a17:902:f641:b0:295:395c:ebf9 with SMTP id d9443c01a7336-29b6bf80942mr448394395ad.55.1764604344552; Mon, 01 Dec 2025 07:52:24 -0800 (PST) Received: from atharv-HP-Pavilion-x360-2-in-1-Laptop-14-ek1xxx.. ([103.216.213.160]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bceb5442csm125777105ad.85.2025.12.01.07.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 07:52:24 -0800 (PST) From: Atharv Dubey To: "Rafael J . Wysocki" Cc: Len Brown , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , linux-acpi@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Atharv Dubey Subject: [PATCH v2] rust: acpi: replace manual zero-initialization with `pin_init::zeroed()` Date: Mon, 1 Dec 2025 21:22:10 +0530 Message-ID: <20251201155210.22710-1-atharvd440@gmail.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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use `pin_init::zeroed()` instead of `core::mem::zeroed()` for initializing `acpi_device_id`. This removes an explicit unsafe block and aligns ACPI initialization with the pin-init conversion used across the Rust tree. Link: https://github.com/Rust-for-Linux/linux/issues/1189 Signed-off-by: Atharv Dubey --- rust/kernel/acpi.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/kernel/acpi.rs b/rust/kernel/acpi.rs index 37e1161c1298..cc98b36b90a0 100644 --- a/rust/kernel/acpi.rs +++ b/rust/kernel/acpi.rs @@ -40,8 +40,7 @@ pub const fn new(id: &'static CStr) -> Self { let src =3D id.to_bytes_with_nul(); build_assert!(src.len() <=3D Self::ACPI_ID_LEN, "ID exceeds 16 byt= es"); // Replace with `bindings::acpi_device_id::default()` once stabili= zed for `const`. - // SAFETY: FFI type is valid to be zero-initialized. - let mut acpi: bindings::acpi_device_id =3D unsafe { core::mem::zer= oed() }; + let mut acpi: bindings::acpi_device_id =3D pin_init::zeroed(); let mut i =3D 0; while i < src.len() { acpi.id[i] =3D src[i]; --=20 2.43.0