lkml.org 
[lkml]   [2021]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] iio/scmi: Add reading "raw" attribute.
From
Date

>>>> + /* 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.

\
 
 \ /
  Last update: 2021-10-01 09:00    [W:0.061 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site