From nobody Sun Dec 14 13:57:03 2025 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 032FE1AD3E0 for ; Thu, 16 Jan 2025 08:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737016493; cv=none; b=fGJQ3WkwtQ3g8JUL58dJ7azI9nHzydvxFZCCiGLfVjAi6aKtm5mBNFy1j8oyBhV94aOnAY/H63HciSC4vL7dfcjN9JoRrUIg0AwOMZ46IJT8aKvRlT0fcsKsAxzEAwmXbPqU0W62YYST0B/qTA4PZlKg3jtxSB7YKN/X+J5vw8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737016493; c=relaxed/simple; bh=LIjmW2FX1zEGqj0YeZsDzNV2nEB9HFE9TnEvmxtVOmM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vvy98qMXz5h2XVgA32wtTSFCukDee488HQWarzubqWbvYf16h//Bb4T4rNBzzNKBwjhm362HRZjkvbUOSUCQrJw2HT8UIpp5ByvzlJgvDNrTLK31z0v8xEfJFrP1YN9FdadfzY+Ymj+nRGOQmUpjRZ6eZhO83V4UEPHhZQkxSeQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=no4QiVI2; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="no4QiVI2" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-21634338cfdso14537435ad.2 for ; Thu, 16 Jan 2025 00:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737016491; x=1737621291; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7KNwF2TEt3KRdmvW9wJLK96ErGUWCHdu1SXXWgMYjIM=; b=no4QiVI228QW59lxM3oNEVBl5FuR7kk+SMIGpcNjNbJoMY3zNFWJd6CEVWD+NA3d/u waO3e3bfSx8614uGGLZJuHOu+50cHrCom496Ob2FdEFkAbSzubL2ojnxcC1McFvZlzW6 uCnqALDPLP8A+7gF9Y9jFqEdcYgMbb4xyve4jO88PkTSvRIN6fX/1/50K7GB9VGFOzow wuOTk6fEgs+NidABcuN5kV7Db22TcpEYNDW8OC7ZMWkzuzaZ/9kR1bzx2AResLnd6FqJ FaVL8+9GHauoYdgYvl1EbJHNJujsGWVVpLC5fwCd7N2Ce+ICMGtRoV4FjRj8c5tTKgj0 WP7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737016491; x=1737621291; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7KNwF2TEt3KRdmvW9wJLK96ErGUWCHdu1SXXWgMYjIM=; b=TkibT8FXZr9qOpVCB+gJnPQVHP3K0AaEqaYhBsgckGIp8bnW1uvMC5i+Pfs+IlQzHC ZyNPJfwgfhBXoJwihSmaAiLGhcuPe+Noxfdn+20dI+JTkLvJNPIpuP0m3f2wkiaZW8ZG poeYuXPrArbT4ecxADXPygVIr83mmwgiyqV9OnUfx7yqllW5WgWIUjot6JJUG8rQ80vI m/oZz/97Zyhl5cgBPMaHl/KpyXGfz76mNkwuknaTHid/DXNUqgawL7IcgyjuUQMph8bc BqUJpPS30eShkZxv0NhOz33482XSsMesrU5neY5+DpCWmshka4jl8yCNwDMfNr0wLDpu E46Q== X-Forwarded-Encrypted: i=1; AJvYcCXBvBF1kpVUD9hlk122tl7aTUJuwLxo1oLO44FXMoAKTYNJmJPeaxTrg/wUMimtkzO0MUsm03eoP12qDK4=@vger.kernel.org X-Gm-Message-State: AOJu0YwYGDLoIaUY6JfMXSCpLRFzpr5uXn26YATqACWrjjUm8NdQqXKZ 7gQ1WgbJfxn0KA8yMNqO4sdTTePJBzDbOp9pxKTor529kcbtxhqew1GoIBfIeDc= X-Gm-Gg: ASbGncv1tD8a8+2XIKbGwQQMvQWXaP1cxSHhxNZQEqT82UQJM9TYxw9Zat7VhERoPxy OuEqNSuc7SEa1zcq1/5JKWoFv+dq+kgJIAXWk89cnxV4+u39LthoGZ5KMehfpR6lVCjZ3KvmCmY +zti0pRFSSO7ePzQu0YTxHtVe7fB2U0eNYhzsFLu0Qp6IA0ObdWqkO5o92cCk7TMx+bmnhKERp4 s9LwhpuETj3OSa2hW7vDlXMuEbRFUTtPJit6AYAfrFwOJSK/0UrqdweA9c= X-Google-Smtp-Source: AGHT+IHrny54ToSeVWMN2zsKMOrjl0BmIDaedi0byUk0NpOqTVW2IMKN3OfazwOByuRgeZtt0iGMvw== X-Received: by 2002:a05:6a00:92a0:b0:72d:9cbc:730d with SMTP id d2e1a72fcca58-72d9cbc7c5amr3212241b3a.11.1737016491063; Thu, 16 Jan 2025 00:34:51 -0800 (PST) Received: from localhost ([122.172.84.139]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72d406a5684sm10372061b3a.165.2025.01.16.00.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 00:34:50 -0800 (PST) From: Viresh Kumar To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross Cc: Viresh Kumar , Rob Herring , Dirk Behme , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rust: device: Use as_char_ptr() to avoid explicit cast Date: Thu, 16 Jan 2025 14:04:43 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: 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 as_char_ptr() to avoid explicit cast. Suggested-by: Alice Ryhl Signed-off-by: Viresh Kumar Reviewed-by: Alice Ryhl --- Rebased over: https://lore.kernel.org/all/e97dcbe0418cc1053fb4bcfac65cc02a0afcdf78.173700= 5078.git.viresh.kumar@linaro.org/ rust/kernel/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs index c775266ae164..db2d9658ba47 100644 --- a/rust/kernel/device.rs +++ b/rust/kernel/device.rs @@ -185,7 +185,7 @@ unsafe fn printk(&self, klevel: &[u8], msg: fmt::Argume= nts<'_>) { /// Checks if property is present or not. pub fn property_present(&self, name: &CStr) -> bool { // SAFETY: By the invariant of `CStr`, `name` is null-terminated. - unsafe { bindings::device_property_present(self.as_raw().cast_cons= t(), name.as_ptr() as *const _) } + unsafe { bindings::device_property_present(self.as_raw().cast_cons= t(), name.as_char_ptr()) } } } =20 --=20 2.31.1.272.g89b43f80a514