Re: [PATCH V4 4/8] libgpiod: Add rust wrapper crate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 27, 2022 at 06:08:09PM +0800, Kent Gibson wrote:
> > > > +
> > > > +    /// Get the edge event buffer size for the request config.
> > > > +    pub fn get_event_buffer_size(&self) -> u32 {
> > > > +        unsafe { bindings::gpiod_request_config_get_event_buffer_size(self.config) as u32 }
> > > > +    }
> > > 
> > > You might want to note that this just reads the value from the config.
> > > The actual value used by the kernel is not made available to user space.
> > 
> > Do you want me to add these two comments for the above two routines ?
> > 
> 
> Not add verbatim.  Maybe work them in.
> Probably should look at revising the C API comments and then just mirror that.
> 

Just to be clear, I don't think we want to get into the details as to how
the kernel interprets that setting, so that is just informational for
you in case you find the kernel doesn't buffer exactly the number you
expected.  The description for the set covers the case where you might
get less than you expected.  But in some cases you may get more.

The key difference is that the C API description says:
 @return Edge event buffer size setting from the request config.
                                ^^^^^^^
which indicates you are getting the setting value back, not whatever the
buffer size in the kernel actually is.
That is missing from the one-liner description, which is all you copied.
So if you are going to condense it to one line then add "setting" in
there.

Cheers,
Kent.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux