Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp767090lqe; Sun, 7 Apr 2024 02:55:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjytl3AjOeWNYiAFMUV3Cvxp32uWV2uDrt7FRqKVCdqOSImsLzdLq6bYQ+Rj6J1AUVUHVRSmwMyRLoSL59yI7IuqAX7qLnYqTJOzz84Q== X-Google-Smtp-Source: AGHT+IGOoUXOJaapuf/mm0CakKG3N/nasgCK5WaHkVj0RqHpoH9cNnXkFh9Uv0OEBNzz60sKq1fo X-Received: by 2002:a05:6a21:8cc7:b0:1a3:a039:d11b with SMTP id ta7-20020a056a218cc700b001a3a039d11bmr8301078pzb.24.1712483699829; Sun, 07 Apr 2024 02:54:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712483699; cv=pass; d=google.com; s=arc-20160816; b=S7il51PCwgZpY7BiiwaWfhA5D5Gi+Ip8GKQdTVS+sCC8YNuHGDQeSe/IyV2phgz0i3 /95nypz0gju+2ExPBOuod/ZEMjlU1isbxDvEaVI4N+mAwZRnKO+Uqhbv1z8yf0HeJbAy ZuvlPGBhDrF6MtMUPp3ACVYhpEiroz75Uvke2hg0b6i/Egjd3HTeOxSy6wE8fdyDWKBn LV8nyD0A29DVcyL0rnM2y+P6FoCOqZA1q/XzcKBaatncT8XLaZ+qMKMpemfx4oji+FY9 6eBefavYwTD2fPVng3QHsI3FnO8TQS8B1KIuQKzWwhj97VpXwrBlOyjI4wXbz0b78IkF 7tXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=8YZS8eu/oWRcKM7mzkufE33UHJldzqwP/IUT97Ck+U8=; fh=lO+3lTSuJk3Ih5lt8xfvTVzi8d2qSzEmTikflhdm7zU=; b=GpODaCbVu84VhOLNb+wcooghownhSJw1M2TGkzSyqFruvTrJyAfCQIuuG1w5xZ9jMo 9BnksaXY307PybZTcrobIPESz4ckhKgiyVexHpYaKN0EThsUXAjXvhkmQ3rUmoSTr/o7 nU1BSfo5gV0ymrmnqJ5lfqLkXjc5tmLH/9LPGLitz3FYoTYC7Qqguf/i9dDN2tEhVF2K 8CfRWDlvA0rKGLlHPM4HyubtOf6P6vXdC7y2XtgwJP2QJflmCBoTZA+n5Vrm4z6g6qi3 Vb4ajpxpSkc+AxLftTLmU/sAJUC5zgp/Ku8MXJU41yBC+K2Bu0W2H+ubrNNzWlsohJuL c60Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=MYK1Z1b2; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-134313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 15-20020a63154f000000b005dc8a2e4179si4402432pgv.624.2024.04.07.02.54.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 02:54:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=MYK1Z1b2; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-134313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 51DE0B21891 for ; Sun, 7 Apr 2024 09:54:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F5561CAA6; Sun, 7 Apr 2024 09:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="MYK1Z1b2" Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (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 D79AF101E2 for ; Sun, 7 Apr 2024 09:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712483670; cv=none; b=IGJ/2Rufjkn23hFWEfHAVJPCqWUlip9YM9qmxFQ2kGMvfjZNB4n3CaHTS39g2qJkYiPxIaBksFE7DAkOeZXAx4PCmD856PB1gN/00Ex0ILH/GMh8EJuXX47Wnz1VtPK5XE4FLy+vqHan/wCTiUWNWGofHmrEK4/200h5XPoqIxU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712483670; c=relaxed/simple; bh=rJcdmdSVaCU80ztqbZrjQkcR0aAJtLC4psVNrXmv+os=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iKnL1IBDK51EMqSKzts10H9bhratuujYsZjvI1dTJB9F+0vFAMe3WEcss1eXaq9hAt9hVu4fEX94JhouNK4MnE7cV/BhwImsuzpA/tYtFMda1gVfKKpWsZy9zSkx5GsbiwfEUSgAmTr2j3sQzGMChMYLoEH4ygFYT40XwOYfAB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=MYK1Z1b2; arc=none smtp.client-ip=185.70.43.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1712483666; x=1712742866; bh=8YZS8eu/oWRcKM7mzkufE33UHJldzqwP/IUT97Ck+U8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=MYK1Z1b2S7tyd+lWOKFF1lJUt5Nf0YKgLQis4kkW0p0q3IGOs263WaOyQAJFKuCO+ U0Pwn5PPgZ0CpQKxJICDRSoa0nr6hrnYBgXUztWL35ZHiGJBxvojxRDNPLpIiDQ/Ep d9RJY7NqWtRYfqZSuXBxMuEIIryPMP6WCbmMZkYbK6WPhXdTS9xosvMi95FkEIZHbN kjTwMtbzo+XSbSobQDoX6+i3+NfslCtKPb4toLrlWdYXcICviA/RBLY1nnJUa6vtrs 2p8fjvGMvtPuO5B+UNLXWCOoDITUXsVf4E18RCeHMWfbCitY/WzRGheZEBkuMP3463 bzpeG9vAp0VSw== Date: Sun, 07 Apr 2024 09:54:22 +0000 To: Viresh Kumar , "Rafael J. Wysocki" , Miguel Ojeda , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl From: Benno Lossin Cc: linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , rust-for-linux@vger.kernel.org, Manos Pitsidianakis , Erik Schilling , =?utf-8?Q?Alex_Benn=C3=A9e?= , Joakim Bech , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 3/3] cpufreq: Add Rust based cpufreq-dt driver Message-ID: <4ff5f30b-f2b8-4625-b3cd-ac08e4ffb068@proton.me> In-Reply-To: <1792467a772b7a8355c6d0cb0cbacfbffff08afd.1712314032.git.viresh.kumar@linaro.org> References: <1792467a772b7a8355c6d0cb0cbacfbffff08afd.1712314032.git.viresh.kumar@linaro.org> Feedback-ID: 71780778:user:proton 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: quoted-printable On 05.04.24 13:09, Viresh Kumar wrote: > +// Finds exact supply name from the OF node. > +fn find_supply_name_exact(np: *mut bindings::device_node, name: &str) ->= Option { > + let sname =3D CString::try_from_fmt(fmt!("{}-supply", name)).ok()?; > + > + // SAFETY: The OF node is guaranteed by the C code to be valid. > + let pp =3D unsafe { bindings::of_find_property(np, sname.as_ptr() as= *mut _, ptr::null_mut()) }; Drivers should avoid calling `unsafe` code as much as possible. They also should not be calling `bindings` code directly. Please write (or find) abstractions for these `unsafe` calls. --=20 Cheers, Benno > + if pp.is_null() { > + None > + } else { > + CString::try_from_fmt(fmt!("{}", name)).ok() > + } > +}