Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Rodrigo Alencar via B4 Relay
	<devnull+rodrigo.alencar.analog.com@kernel.org>,
	rodrigo.alencar@analog.com, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Dmitry Antipov <dmantipov@yandex.ru>
Subject: Re: [PATCH v7 2/8] iio: core: add fixed point parsing with 64-bit parts
Date: Mon, 2 Mar 2026 11:33:42 +0200	[thread overview]
Message-ID: <aaVZdgvZhaWDgU2X@ashevche-desk.local> (raw)
In-Reply-To: <ct2r5wvvfowqcfe44fawbi4blkjpfle7etvaunwbsxevejsr2s@3g43wru5n6jh>

On Mon, Mar 02, 2026 at 09:19:42AM +0000, Rodrigo Alencar wrote:
> On 26/03/02 10:27AM, Andy Shevchenko wrote:
> > On Sun, Mar 01, 2026 at 12:23:40PM +0000, Jonathan Cameron wrote:
> > > On Mon, 23 Feb 2026 12:41:45 +0200
> > > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > > On Mon, Feb 23, 2026 at 12:37 PM Rodrigo Alencar
> > > > <455.rodrigo.alencar@gmail.com> wrote:
> > > > > On 26/02/23 11:06AM, Andy Shevchenko wrote:  
> > > > > > On Sun, Feb 22, 2026 at 05:29:12PM +0000, Jonathan Cameron wrote:  

...

> > > > > > It all depends on the series from Dmitry Antipov.
> > > > > > Can somebody help reviewing the patch 1 there?
> > > > > > https://lore.kernel.org/linux-hardening/20260212125628.739276-1-dmantipov@yandex.ru/  
> > 
> > FWIW, Andrew picked them up for Linux Next. Please, test!
> 
> The patch looks ok, but I am not seeing it solving my problem here.
> Here is the v8:
> https://lore.kernel.org/linux-hardening/aZXDSbyH8tWmTPPL@smile.fi.intel.com/T/#t
> 
> I would have to use simple_strtoull() and it would clamp the value at
> ULLONG_MAX in case of overflow, but it would not say that an overflow
> happened. Would that be fine? I understand that addressing the FIXME
> in simple_strntoull() is not a subject of this patch.
>  
> > > > > can we push for the exposure of that function to kernel modules?
> > > > > We have discussed that in v6, and I understand that:
> > > > >
> > > > > EXPORT_SYMBOL_FOR_MODULES(_parse_integer_limit, "industrialio");
> > > > > in lib/kstrtox.c;
> > > > >
> > > > > #include "../../lib/kstrtox.h"
> > > > > in drivers/iio/industrialio-core.c
> > > > >
> > > > > is not a good call...  
> > > > 
> > > > Yep, because it's a temporary band-aid. The proper solution is to have
> > > > shared code provided by the lib/. So, the wrapper to parse 64-bit out
> > > > from the constant string literal should be part of the lib/ in the
> > > > result.
> > > > 
> > > > > > When it's in, we can continue on this one. TL;DR: for me this is on hold.
> > > > > > But if you see the need to have the driver being in IIO, please add a big
> > > > > > fat FIXME to make sure we will get this all being sorted out in the
> > > > > > (nearest?) future.  
> > > > >
> > > > > I could add the FIXME into iio_safe_strntou64() doc header. It explains
> > > > > the context:
> > > > >  
> > > > > > + * The implementation of this function is similar to _parse_integer_limit()
> > > > > > + * available in lib/kstrtox.h, but that header/function is not available to be
> > > > > > + * used in kernel modules. Hence, this implementation may need to change or
> > > > > > + * removed to reuse a new suitable helper that is properly exposed.  
> > > > 
> > > > Up to Jonathan, I hope we can move the above mentioned series forward.
> > > > Without that, as I pointed out, this one sounds to me suboptimal and
> > > > unneeded double effort.
> > > > 
> > > I don't want to hold this series for another cycle, but we are still
> > > fairly early in this one, so some focus on moving that forwards seems
> > > sensible.  If we are running out of time, we can fallback to a loud
> > > FIXME and a plan to move to the generic version in the library next cycle.
> > > So let's set a rough deadline of rc5 and see how things are going then.
> > 
> > Taking into account the above, can we actually develop something
> > based on that?  Or at least having a temporary solution for this
> > cycle followed up by the better one for the next?
> 
> As mentioned above, I am not sure how consume what Andrew has over there.
> It seems address lib/ internal stuff. The interfaces are still the same.

I think it will be third time I'm repeating that this needs a wrapper in the
lib/. Just add the one (like with safe_strtoull() naming schema) with properly
formed prototype that returns an error and the result in different variables

int safe_strtoull(..., *result)
{
	...
}
EXPORT_SYMBOL_GPL(safe_strtoull);

(Also some test cases have to be added.)

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-02  9:33 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 15:02 [PATCH v7 0/8] ADF41513/ADF41510 PLL frequency synthesizers Rodrigo Alencar via B4 Relay
2026-02-16 15:02 ` [PATCH v7 1/8] dt-bindings: iio: frequency: add adf41513 Rodrigo Alencar via B4 Relay
2026-02-16 15:02 ` [PATCH v7 2/8] iio: core: add fixed point parsing with 64-bit parts Rodrigo Alencar via B4 Relay
2026-02-22 17:29   ` Jonathan Cameron
2026-02-23  9:06     ` Andy Shevchenko
2026-02-23 10:37       ` Rodrigo Alencar
2026-02-23 10:41         ` Andy Shevchenko
2026-03-01 12:23           ` Jonathan Cameron
2026-03-02  8:27             ` Andy Shevchenko
2026-03-02  9:19               ` Rodrigo Alencar
2026-03-02  9:33                 ` Andy Shevchenko [this message]
2026-03-02 10:13                   ` Rodrigo Alencar
2026-03-02 10:20                     ` Andy Shevchenko
2026-02-16 15:02 ` [PATCH v7 3/8] iio: test: add kunit test for fixed-point parsing Rodrigo Alencar via B4 Relay
2026-02-22 17:34   ` Jonathan Cameron
2026-02-16 15:02 ` [PATCH v7 4/8] iio: frequency: adf41513: driver implementation Rodrigo Alencar via B4 Relay
2026-02-16 15:02 ` [PATCH v7 5/8] iio: frequency: adf41513: handle LE synchronization feature Rodrigo Alencar via B4 Relay
2026-02-16 15:02 ` [PATCH v7 6/8] iio: frequency: adf41513: features on frequency change Rodrigo Alencar via B4 Relay
2026-02-16 15:02 ` [PATCH v7 7/8] docs: iio: add documentation for adf41513 driver Rodrigo Alencar via B4 Relay
2026-02-16 15:02 ` [PATCH v7 8/8] Documentation: ABI: testing: add common ABI file for iio/frequency Rodrigo Alencar via B4 Relay

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=aaVZdgvZhaWDgU2X@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=455.rodrigo.alencar@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+rodrigo.alencar.analog.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=dmantipov@yandex.ru \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rodrigo.alencar@analog.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox