[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <94494815-8835-1faa-441a-ed89358f8048@opensynergy.com>
Date: Fri, 1 Oct 2021 09:59:54 +0300
From: Andriy Tryshnivskyy <andriy.tryshnivskyy@...nsynergy.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: jbhayana@...gle.com, lars@...afoo.de, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, Vasyl.Vavrychuk@...nsynergy.com
Subject: Re: [PATCH 1/1] iio/scmi: Add reading "raw" attribute.
>>>> + /* Use 32-bit value, since practically there is no need in 64 bits */
>>>> + *val = (u32)readings[ch->scan_index].value;
>>> We should check it fits and if doesn't return an error rather than pretending all was fine.
>>>
>> What kind of error to return in the case it does not fit - ENOEXEC (Exec format error) ?
> That one is a bit obscure.
>
> I'd go with either -ERANGE I think as we are reflecting that the clamp to 32 bit
> is not representable.
Thanks for hint. Later I've found -ERANGE also and used it in my next patch versions.
Powered by blists - more mailing lists