lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 27 Aug 2023 19:09:55 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Mehdi Djait <mehdi.djait.k@...il.com>,
        Matti Vaittinen <mazziesaccount@...il.com>,
        krzysztof.kozlowski+dt@...aro.org, robh+dt@...nel.org,
        lars@...afoo.de, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v8 6/7] iio: accel: kionix-kx022a: Add a function to
 retrieve number of bytes in buffer


> > > > > I see. I think my confusion can be easily cured by renaming the callback to
> > > > >
> > > > >         get_amount_bytes_in_fifo()
> > > > >
> > > > > or
> > > > >
> > > > >         get_bytes_in_fifo()
> > > > >
> > > > > or alike.  
> > > >
> > > > or leave it as is. The function is documented:  
> > >  
> > > > + * @get_fifo_bytes: function pointer to get number of bytes in the FIFO buffer  
> > >
> > > Do you find it unambiguous? I do not.
> > >
> > > Still needs more words to explain if it's a capacity of FIFO or is it amount of
> > > valid bytes for the current transfer or what?  
> > 
> > how about change the description to:
> > function pointer to get amount  of acceleration data bytes currently
> > stored in the sensor's FIFO buffer
> > 
> > and change the function to "get_amount_bytes_in_fifo()"  
> 
> Sounds good to me, thank you!
> 
Bikeshedding time ;)

I don't like "amount" in this - it ends up adding little meaning
and to me it is ugly English.  It's making it clear that we are dealing
with some sort of count but that is already true of get_bytes_in_fifo()
So to my reading it adds nothing wrt to removing ambiguity.

get_number_of_bytes_in_fifo() flows better but also adds nothing over
get_bytes_in_fifo()

You could make it clear it is something that changes over time.

get_current_bytes_in_fifo()

Which at least implies it changes - though it doesn't rule out a weird
variable max size fifo.

get_fifo_bytes_available() might be the clearest option and is the one
I would prefer.  It's still a little messy as it could mean
'number of bytes of data that haven't been used yet in the fifo and
 are available for samples in the future'.

Sigh.  Maybe least ambiguous is something longer like.

get_fifo_bytes_available_to_read()
get_fifo_bytes_available_out()

Honestly I don't care that much what you go with :)

Jonathan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ