From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 7C1B91096F for ; Sun, 23 Nov 2025 13:16:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763903790; cv=none; b=R6W3QMfOfx/Sz81XerDFMwekH2hKRcFZb/VQjRbAACJ+vba9kVSf5NEHyFwV7EWb0+h2cOK6/yKonIBArYYDz4QtlWofnk5gDZiJ0hEX5CtqT3d9WkhVCO0r6Kl2Ev1UAMJ1b1C6aMQM5LAA6LXgxUSC1N0JNm7g1ybvoCUtcF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763903790; c=relaxed/simple; bh=54vi7KmAT+1m3az/BKhHowS24K4TkexlSujhLJMigzM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nvLZ97uMu9aU/8HY8Dg8dWfW/1Rof+HgHvR+HadLYao35Am3jrOSoaSQJY7f7f01MBr9Jy2IaeoV1GTz2xblm/g0Y4gNExQ7UUmsd0zC3QsC+PndfWOjb/01CBb8zTDwhQMNiPqVKgpu+GRYxK8sHJulz6kGbRdsEt0GUglXSE4= 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=hdGVhLps; arc=none smtp.client-ip=209.85.128.42 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="hdGVhLps" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-477a219db05so20987065e9.2 for ; Sun, 23 Nov 2025 05:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763903787; x=1764508587; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vWsYIQ2Ggbhbzka70Nij3a4arpdwqNARnWCMeN/qSWA=; b=hdGVhLpsx71DM1Z2KF42+GUYyGncfHK5SG5TXv0FOOE1O/WCejhBl+C4QRB1p0pCH9 NZXgjYZKYWyyAGnytkKrexyaObgps6FfMTwmBKyHPA5/glfwCTzaKmlpPef5JXryC3ex x7uDoLz1qiihOJ12d0V6IFHIJyaqux2mAz0MvL12ch4Z3Opf34zJwFBP6oggUWwO4FmN 4SimP4S0BLIkHLhXT0ifKPi9HEhXgt8u0lIvD/90TB+CUuOUffMRcjAzi6nTnv1pi/e4 Eib4LPc5ReLsKckISK8SqFeZRk7DVitCXlMVCwAb1wHpPV6w/wvgAYycjvtG/dU3QX2x HXHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763903787; x=1764508587; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vWsYIQ2Ggbhbzka70Nij3a4arpdwqNARnWCMeN/qSWA=; b=IspgejNuuL5g9lYV/ndMmgdrQU+1o/jECx3q03nhegrx9cGVYzsqq1Cj6SiY+sIWN5 zmiboXTi8YIU+gdLMbsbPgHhaYCyTZt9/Ck06CjZq7+kBB/1QbtvZP2eovShwfKp8PZ3 XYZmVIC/Tf+da4Z2/7jdbckf5H7KV65HnpbsR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:600c:840f:b0:477:632a:fd67 with SMTP id 5b1f17b1804b1-477c10d6d13mr93671615e9.12.1763903786586; Sun, 23 Nov 2025 05:16:26 -0800 (PST) Received: from ?IPV6:2a06:5906:2618:cb00:f1a3:6462:6c03:ec0e? ([2a06:5906:2618:cb00:f1a3:6462:6c03:ec0e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fb919bsm22549569f8f.34.2025.11.23.05.16.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 23 Nov 2025 05:16:26 -0800 (PST) Message-ID: <7bd3232c-90cc-4e71-8aed-2ac911cb20f9@gmail.com> Date: Sun, 23 Nov 2025 13:16:24 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 05/10] rust: kernel: Update ARef and AlwaysRefCounted imports to use sync::aref To: Shankari Anand , Greg Kroah-Hartman , =?UTF-8?Q?Arve_Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Danilo Krummrich , Alice Ryhl , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Alexandre Courbot , "Rafael J . Wysocki" , Miguel Ojeda , Alex Gaynor , Michal Wilczynski Cc: Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Trevor Gross , Daniel Almeida , Abdiel Janulgue , Robin Murphy , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, rust-for-linux@vger.kernel.org, linux-pwm@vger.kernel.org References: <20251123092438.182251-1-shankari.ak0208@gmail.com> <20251123092438.182251-6-shankari.ak0208@gmail.com> Content-Language: en-US From: Igor Korotin In-Reply-To: <20251123092438.182251-6-shankari.ak0208@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello Shankari On 11/23/2025 9:24 AM, Shankari Anand wrote: > Update call sites in `i2c.rs` to import `ARef` and > `AlwaysRefCounted` from `sync::aref` instead of `types`. > > This aligns with the ongoing effort to move `ARef` and > `AlwaysRefCounted` to sync. > > Suggested-by: Benno Lossin > Link: https://github.com/Rust-for-Linux/linux/issues/1173 > Signed-off-by: Shankari Anand > --- > rust/kernel/i2c.rs | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/rust/kernel/i2c.rs b/rust/kernel/i2c.rs > index 1aee46f59460..c50ca464d87c 100644 > --- a/rust/kernel/i2c.rs > +++ b/rust/kernel/i2c.rs > @@ -17,10 +17,8 @@ > of, > prelude::*, > str::CStrExt as _, > - types::{ > - AlwaysRefCounted, > - Opaque, // > - }, // > + sync::aref::AlwaysRefCounted, > + types::Opaque, // > }; > > use core::{ > @@ -32,7 +30,7 @@ > }, // > }; > > -use kernel::types::ARef; > +use kernel::sync::aref::ARef; > > /// An I2C device id table. > #[repr(transparent)] > @@ -408,7 +406,7 @@ pub fn get(index: i32) -> Result> { > kernel::impl_device_context_into_aref!(I2cAdapter); > > // SAFETY: Instances of `I2cAdapter` are always reference-counted. > -unsafe impl crate::types::AlwaysRefCounted for I2cAdapter { > +unsafe impl crate::sync::aref::AlwaysRefCounted for I2cAdapter { NIT: This module already imports `AlwaysRefCounted`, so please use the imported name instead of the full path for consistency. > fn inc_ref(&self) { > // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. > unsafe { bindings::i2c_get_adapter(self.index()) }; Thanks Igor