All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Rameshbabu <sergeantsagara@protonmail.com>
To: Wren Turkal <wt@penguintechs.org>
Cc: linux-pci@vger.kernel.org, rust-for-linux@vger.kernel.org,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>
Subject: Re: [PATCH] rust: pci: fix documentation related to Device instances
Date: Sat, 05 Jul 2025 07:05:33 +0000	[thread overview]
Message-ID: <87ldp3kthk.fsf@protonmail.com> (raw)
In-Reply-To: <954c0915-25d9-4bc3-ac82-452650902a3c@penguintechs.org>

On Sun, 29 Jun, 2025 00:14:18 -0700 "Wren Turkal" <wt@penguintechs.org> wrote:
> On 6/28/25 10:57 PM, Rahul Rameshbabu wrote:
>> Device instances in the pci crate represent a valid struct pci_dev, not a struct
>> device.
>>
>> Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
>> ---
>>
>> Notes:
>>      Notes:
>>
>>      I noticed this while working on my HID abstraction work and figured it would be
>>      a small fixup I could send afterwards.
>>
>>      Link: https://lore.kernel.org/rust-for-linux/20250629045031.92358-2-sergeantsagara@protonmail.com/
>>
>>   rust/kernel/pci.rs | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
>> index 6b94fd7a3ce9..af25a3fe92e5 100644
>> --- a/rust/kernel/pci.rs
>> +++ b/rust/kernel/pci.rs
>> @@ -254,7 +254,7 @@ pub trait Driver: Send {
>>   ///
>>   /// # Invariants
>>   ///
>> -/// A [`Device`] instance represents a valid `struct device` created by the C portion of the kernel.
>> +/// A [`Device`] instance represents a valid `struct pci_dev` created by the C portion of the kernel.
>
> Should this not just be a "a valid pci device" and let the type in the
> function definition speak for the type instead of duplicating the type
> name in the  doc comment?
>

My theory is that this comment is explicitly done for folks reading this
code from the C side. Rust tuple structs are not exactly a common
semantic in other programming languages. That said, I am open to
changing the comments if Danillo or others think that would be better as
well. Either way, I appreciate you taking the time to respond.

>>   #[repr(transparent)]
>>   pub struct Device<Ctx: device::DeviceContext = device::Normal>(
>>       Opaque<bindings::pci_dev>,

-- 
Thanks,

Rahul Rameshbabu


  reply	other threads:[~2025-07-05  7:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-29  5:57 [PATCH] rust: pci: fix documentation related to Device instances Rahul Rameshbabu
2025-06-29  7:14 ` Wren Turkal
2025-07-05  7:05   ` Rahul Rameshbabu [this message]
2025-07-05 11:11   ` Danilo Krummrich
2025-06-29  7:15 ` Wren Turkal
2025-06-29  7:20   ` Wren Turkal
2025-07-05 11:14 ` Danilo Krummrich
2025-07-06  4:02   ` Rahul Rameshbabu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ldp3kthk.fsf@protonmail.com \
    --to=sergeantsagara@protonmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=dakr@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wt@penguintechs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.