linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com>
Cc: jbhayana@google.com, lars@metafoo.de, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, Vasyl.Vavrychuk@opensynergy.com
Subject: Re: [PATCH 1/1] iio/scmi: Add reading "raw" attribute.
Date: Thu, 30 Sep 2021 16:26:18 +0100	[thread overview]
Message-ID: <20210930162618.0c53ec33@jic23-huawei> (raw)
In-Reply-To: <18401c96-a88e-c7fa-8f20-56605945891d@opensynergy.com>


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

  parent reply	other threads:[~2021-09-30 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  6:52 [PATCH 0/1] iio/scmi: Add reading "raw" attribute Andriy Tryshnivskyy
2021-09-22  6:52 ` [PATCH 1/1] " Andriy Tryshnivskyy
2021-09-25 14:43   ` Jonathan Cameron
     [not found]     ` <18401c96-a88e-c7fa-8f20-56605945891d@opensynergy.com>
2021-09-30 15:26       ` Jonathan Cameron [this message]
2021-10-01  6:59         ` Andriy Tryshnivskyy

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=20210930162618.0c53ec33@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Vasyl.Vavrychuk@opensynergy.com \
    --cc=andriy.tryshnivskyy@opensynergy.com \
    --cc=jbhayana@google.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).