Linux-IIO Archive on
 help / color / Atom feed
From: Lars-Peter Clausen <>
To: Christian Eggers <>,
	Andy Shevchenko <>
Cc: Rob Herring <>,
	Jonathan Cameron <>,
	Jonathan Cameron <>,
	Hartmut Knaack <>,
	Peter Meerwald-Stadler <>,
	linux-iio <>,
	devicetree <>,
	Linux Kernel Mailing List <>
Subject: Re: [PATCH v5 2/2] iio: light: as73211: New driver
Date: Tue, 4 Aug 2020 10:34:51 +0200
Message-ID: <> (raw)
In-Reply-To: <2356337.HYKpEJ1Wej@n95hx1g2>

On 8/4/20 9:40 AM, Christian Eggers wrote:
> On Sunday, 2 August 2020, 20:02:35 CEST, Andy Shevchenko wrote:
>> Thanks for an update, my comments below.
> Thanks for the review. Please see below for my questions.
> Best regards
> Christian
>> On Sun, Aug 2, 2020 at 7:40 PM Christian Eggers <> wrote:
>>> Datasheet:
>>> b302-c2fd-e30a-c98df87616df
>> Do we need the UUID after the document file name?
> I have send AMS an inquiry. Not sure whether I will get an answer. I will wait
> a few days until sending v6.
>>> +#define AS73211_OFFSET_TEMP (-66.9)
>>> +#define AS73211_SCALE_TEMP  0.05
>> In the kernel we don't do float arithmetic. How these are being used?
> Does this restriction also apply for compile time constants? I am quite
> sure that all calculations using these defines will be evaluated at compile
> time. If found a number of other places where probably the same is done:
> find . -name '*.c' | xargs grep "#define.*[0-9]\.[0-9]" | grep -v '"' | grep -v "\/\*.*[0-9]\.[0-9]"

I believe it is implementation defined. The compiler is free to generate 
floating math and do the conversion at runtime. Although it is probably 
safe to assume that no reasonable compiler will do this for your code. 
If only we had constexpr in C, then there was a way to make it 
guaranteed that the conversion happens during compile time.

But I agree with you, it would be nice to have a cleaner way of 
declaring fixed point numbers without having to pay attention to how 
many 0s you have to put after the least significant digit.

      parent reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 16:37 [PATCH v5 0/2] iio: light: Support AMS AS73211 digital XYZ sensor Christian Eggers
2020-08-02 16:37 ` [PATCH v5 1/2] dt-bindings: iio: light: add AMS AS73211 support Christian Eggers
2020-08-02 16:37 ` [PATCH v5 2/2] iio: light: as73211: New driver Christian Eggers
2020-08-02 18:02   ` Andy Shevchenko
2020-08-04  7:40     ` Christian Eggers
2020-08-04  8:28       ` Andy Shevchenko
2020-08-04  8:34       ` Lars-Peter Clausen [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-IIO Archive on

Archives are clonable:
	git clone --mirror linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ \
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone