Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp774344lqe; Sun, 7 Apr 2024 03:18:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTNAjUpw3QSbOwtULk1eSsU+3XcSxZXkGrCSenDohD+Qh6P4X66bDIZaUA7+bnE9RN1Pd9DUyk3bzC4KIkFg9EGcbFmw3tAiMr1m3GJQ== X-Google-Smtp-Source: AGHT+IF3YsgfSylL/4DQtUZ4I7qoe0sQeH2xvApPzM0HBUcoKO5PgTTJ7Q4ZpHQ/76Irlypfhuut X-Received: by 2002:a05:6512:4d1:b0:515:9c73:e29a with SMTP id w17-20020a05651204d100b005159c73e29amr4714763lfq.66.1712485094935; Sun, 07 Apr 2024 03:18:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712485094; cv=pass; d=google.com; s=arc-20160816; b=qRGnplnDUjNmU4azckCs378ZtzZXrQAPuyU0EO363UAdCQB1uo0EDA1vD2kpAktuTO l17Ty9j302RyUbzkEvowSqntjRgF3sRKqKJ7ShB3hV4WBvfv9IYiaxsUXNWXSQ0Fw06E seljX+rHXgfjbWy7LaOEyjImTPeakpyu38xu444pxqm7U/3Lqf8zjCPrfYqi9ICliELD 35mtO98Mjv600vQbgS4jgl3ItuQNQZx6JAsA86bWrXq79L6vobnE7INhT4VxCMyU6wuf EdodNpu7hwzscqDo2Zwh9pAQ17V1jJvYpPYWAsm6IUBix86kEB3RT2iyutMwwd2nvpfb QL1g== 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=O29HBNf2ylU05p6urIS325zaON00H83jAr3bRLHuDus=; fh=lO+3lTSuJk3Ih5lt8xfvTVzi8d2qSzEmTikflhdm7zU=; b=OPEQlTeSJk38STnr6yPnxJZYNL3yWqYcuXWnAZZlTzYCBoH/Gv6PE30h+gH0ctum7a 5ZUX7YrExomrqOwRr8QwSuVaciJAhUST7zq11ZvQPzwvvASrCx9g1c5BMwLVtLYQRf3X RCUGOFYscXwsLVlajAhZuAAL4V4AtWF+7Zrh7b+BdJV/l7mNuhtIzlWdDkHly5rHBBJm EOO7RKGClZSDbLK9jdBqxZrj+9UYcbzBFnsqOJo+aILTVldDZQ5bHdKOOa0xU9j2ivkw vTV2Gb3/iC6VNABSCZUGcpSHraZKz60I9ob770yIGr7BaBzunzo7UJ/Cj5vEbo8KzJkK wuuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=sxa7bzw2fvhc3ioreindctqiwm.protonmail header.b="ke+OHFQ/"; 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-134325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134325-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hq22-20020a1709073f1600b00a51cb3e6c59si639790ejc.517.2024.04.07.03.18.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 03:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=sxa7bzw2fvhc3ioreindctqiwm.protonmail header.b="ke+OHFQ/"; 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-134325-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134325-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A56761F21694 for ; Sun, 7 Apr 2024 10:18:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A27FB1B5A4; Sun, 7 Apr 2024 10:18:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="ke+OHFQ/" Received: from mail-40131.protonmail.ch (mail-40131.protonmail.ch [185.70.40.131]) (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 687F217550; Sun, 7 Apr 2024 10:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712485085; cv=none; b=hsjz3m0NUy//pIQYMebtyKQwk/Dta+HQZYmluOLDQsd82YhPiVAKa2RNkXMQnCqn1IxMRxXMSBu1dryCTGLL1mmxOq7D546AldEiEWUgnIPogKu3WPAKxp0Yql0VabqRCs7K8KWG4o9I0KwxXPwNQ+my9Ki6y2QRD9vOGGPVzL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712485085; c=relaxed/simple; bh=PyzTbx+EV6uWhguY3E9lMN77MG5Dy/bTtQbGz1gti+w=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XRon2cFjhcGcYH09J5Yu2xPeLCS2wiRVTzdQAvMo4NJ6rVciCb8EPhUqyUA0Z4gdy2fqx+ZkoSFUoVvmklnY1b98vILEdLKROSwCqPk/LOmv56u4RcRAcrwmXuD4KvKaU+fEfCx++E3UTFuZsHz9Or6fDiGPJe96RNymJTrCIOw= 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=ke+OHFQ/; arc=none smtp.client-ip=185.70.40.131 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=sxa7bzw2fvhc3ioreindctqiwm.protonmail; t=1712485080; x=1712744280; bh=O29HBNf2ylU05p6urIS325zaON00H83jAr3bRLHuDus=; 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=ke+OHFQ/1+90MhQrbMijafNQVoXGtkbC3xHr7bZqlVz2VzMazx7jqgD24er9PZmOu pDf78eAlOsmXSK0pikaqX00fttn7yWvZdS/XXgmoVNPTKyyPYh1vTI6arG3zUaG5X2 kXTuPPXv0WQF0eaXQiUKQQbKFwCgeKNcGDrEPhtN4TNKwmG+2b6rQEnPrlkKG9LMoP LJNONaYvi9zA89gK0Wg7YU1qZ24cHV0BS1WJw9uQizbefXnDKqJcZ4iQhkLsbERZvy 6ujujOTbTVMX6s5VKLyYdqcnfX6ceXWLpvcRxPBaGm47TEYIemXmIX3QIgXe5xTv8v E9GxjE5BPUiFg== Date: Sun, 07 Apr 2024 10:17:52 +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: <8c4f2053-acbc-4f4a-93de-18f149c80869@proton.me> In-Reply-To: <4ff5f30b-f2b8-4625-b3cd-ac08e4ffb068@proton.me> References: <1792467a772b7a8355c6d0cb0cbacfbffff08afd.1712314032.git.viresh.kumar@linaro.org> <4ff5f30b-f2b8-4625-b3cd-ac08e4ffb068@proton.me> 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 07.04.24 11:54, Benno Lossin wrote: > 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() a= s *mut _, ptr::null_mut()) }; >=20 > 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. Having re-read the cover letter, I see that you are already aware of this. If you need any help with creating the abstractions, feel free to reach out! --=20 Cheers, Benno