From nobody Mon Dec 1 22:36:22 2025 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 695E62773CB for ; Sat, 29 Nov 2025 12:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764419288; cv=none; b=oWu3Y28jDc3IuBadCUl9BDieuoMY6jIRGw97OskTTBwDDpo4ts7EVdakFHwQ/cOei9X+5ON68cUx4iaocaeVdf32TayU/32kWUxB8/ZB7/XKSt+tWP5j/Erx4sNWA1xvks15sibQ6L4vXXn65UzmLvacQwHQJduQhYHwQ5GEqEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764419288; c=relaxed/simple; bh=jMfOtC5ltGOwo2zw8E6WHyb2hwdx1JI37MEhkcm6d/Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oyK2gPww9An4mQPvvPzpgqud6vfRJQ/bA9p82PtAs/2DEWY5dAxMOxZpltoeiGNyYofTo6CPUM65FwQiGsjuoSeIWTBBnttjjJQbEH5tPbFI6u4VcUlUE0v64nnbsqUsesBUG+BEIWo1QfSuXVg7fqd1ugfs6eFbHpwMVES3Lo0= 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=VmYkdeOU; arc=none smtp.client-ip=209.85.214.182 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="VmYkdeOU" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-298456bb53aso35051305ad.0 for ; Sat, 29 Nov 2025 04:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764419286; x=1765024086; 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=Y3V2gkPbQh4TVJJCmUT97AnhOY1sd61+QDFcFJfctTo=; b=VmYkdeOUJ10fKSocWbZ6RFrJMMTexnjIlZcmrk7bXYDxh+6kEzoMO6AsS3z3dz+yld 2Ns4jQhJywiBEl8Rq2M5KC+kdVkvnyJD4tq69U9ba932apAFb7m/HHwJymrTUWd+Mmgj CD4+FjPZxt+XfADd6bzcvQZJOhejNk/UNEJNtyYYqgp5hy3Zb+cI1FwvLB2vZ+i9DFFl 9OLxyll8+EO6NzYWZq67GgpX6Vv4UVoHmNIZ7Z5ubNlE1g0+diGzes1XNtenVqDYc9qQ jZrSW+9lFBkVEzrMB+aQhkDicvmHhhzwIozLnLoajlb20cW82/j5tvNtHBblFS5kYw/7 sHlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764419286; x=1765024086; 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=Y3V2gkPbQh4TVJJCmUT97AnhOY1sd61+QDFcFJfctTo=; b=FLZkpiwR75JdHGiWOmtocfFdtcbe+ZzJMDeeLA9PpH71bLdmcZxL/5Xu0KzI8QEdXg MDJPCLZ32xWrfUd/cK8EH3M/C6mkXxLly6vjAUmyOFHmaHpXFXsFZ2cBaW54NPE32v1n asW0S79g7Bx5OiQqnNFv2cll49oXHM1Z8NMhu49Zse9KqlZrLSL9NHfC6HxKf2TbviQE Zryfl4CDZWBCK4xZxd4ute7ZxbV7A4CroveJLmE1YHyCnFsRtlyixkkwFskaiizL6sHH F0B7YTmoksIGuxXRMklrGi+e905mGJnmUhlt6ofU/HP+jFCNzaPDvGuwrmieKL730PJH 1hEA== X-Forwarded-Encrypted: i=1; AJvYcCXLmkHhbZInGqU0GEbEiLw34xLqYfJJjW87rQjtYsoIfjPrU0HttbQrKzPU4y29Kkp1NPufp3e4rvqCIYk=@vger.kernel.org X-Gm-Message-State: AOJu0Yyv9DYGS/zYypJ3kvcEAM2G3/fE2rRripMq5oSdiDdhd4gSji8b jSC+mgVSz2n3sk2Q1PvEc5t+8YBBPCzx8NsrvPNxwtwehc3GDK9YVLgE X-Gm-Gg: ASbGnctEJuFe5zFjabUR5UtBIwVy+qi34tM+NpWI478jBCCyVyaMy0ZB33+F4MUbZoF 8Qt6U1Z0tBocx9B2afBaG628XCdE3tJkZlaK9QNizVXoi9mpooFJWY0HGxCYH4MhmA9Cu0Ge/LF JLLG/rgdZrcJ9JD5v/pIoSYu/iPoLDhFqShOww6cwgJTq6vwDcCj68DyN1y/+pDkp5nTHFPHlCd bwZRL18PB1/WJagRgSvA5Yfy4qfl55bBrfcEA1fd5FZaBLki7CMl0Pk7GSEp9Lpq4CLWRbFZ+qC Is29rKz+gIxw7i3XHRP9Dq8MDXgENaCZHZC/2ox7dcxlccpraRsDwrCV28WddddyYA2yHqbOJ+t Iwi6dty8rApQ8kDtDqCNKTIliQZiRKMuSBTXCX2pOyjskvxGsfErdY8plGSeuj8QPsYFXvPXE7X 4XUCPRQe0Hl9n1JLqkpx7to4YQDEW8Jy5GenltpDoFF9bbpEbepb6W+wzOnfg34cCdGLOnEFjb/ KE= X-Google-Smtp-Source: AGHT+IHKLnLhy8FVoq7dwSlGJpH3A/bWswuLjr4boQ+kvg66h9DT70NLcNVgAxqb9q/+gSLGJHGy8A== X-Received: by 2002:a17:90b:3848:b0:341:719b:768e with SMTP id 98e67ed59e1d1-34733e4cccfmr25699841a91.2.1764419285623; Sat, 29 Nov 2025 04:28:05 -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 d2e1a72fcca58-7d15fb14876sm7911260b3a.62.2025.11.29.04.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Nov 2025 04:28:05 -0800 (PST) From: Atharv Dubey To: rafael@kernel.org, lenb@kernel.org Cc: ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org, a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org, linux-acpi@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Atharv Dubey Subject: [PATCH] rust: acpi: replace manual zero-initialization with `pin_init::zeroed()` Date: Sat, 29 Nov 2025 17:57:53 +0530 Message-ID: <20251129122753.23022-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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/kernel/acpi.rs b/rust/kernel/acpi.rs index 37e1161c1298..9b8efa623130 100644 --- a/rust/kernel/acpi.rs +++ b/rust/kernel/acpi.rs @@ -39,9 +39,7 @@ impl DeviceId { 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