Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Sean Nyekjaer <sean@geanix.com>,
	Marcelo Schmitt <marcelo.schmitt1@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/2] iio: accel: fxls8962af: Fix temperature calculation
Date: Sun, 4 May 2025 16:46:54 +0100	[thread overview]
Message-ID: <20250504164654.1ecf7215@jic23-huawei> (raw)
In-Reply-To: <CAHp75VehpQdxFDXE8L0TeaOxHBTHNorOZ95rL48kQAiViAJ_zg@mail.gmail.com>

On Fri, 2 May 2025 17:19:44 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Fri, May 2, 2025 at 9:15 AM Sean Nyekjaer <sean@geanix.com> wrote:
> >
> > According to spec temperature should be returned in milli degrees Celsius.
> > Add in_temp_scale to calculate from Celsius to milli Celsius.  
> 
> ...
> 
> > +/* Raw temp channel scale */
> > +#define FXLS8962AF_TEMP_SCALE                  1000  
> 
> Wouldn't constants from units.h be helpful here?

Whilst you are just continuing local style, I'm not sure
these defines really bring much at all given the TEMP_SCALE
one for instance is only used in one place which is
explicitly getting the temperature scale.  It's not a magic
number that needs a define. It's a number that means it's own
value :)

Using MILLI there would be a nice bit of self documentation
though.
> 
> >  #define FXLS8962AF_AUTO_SUSPEND_DELAY_MS       2000  
> 
> (2 * MSEC_PER_SEC)
> 
> This gives immediately that we want 2 seconds of delay.
> 
True but not part of this patch so that would be a nice
little follow up.  Possibly dropping this define in favour
of using that inline.

Jonathan



  reply	other threads:[~2025-05-04 15:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02  6:15 [PATCH v2 0/2] iio: accel: fxls8962af: Fix temperature readings Sean Nyekjaer
2025-05-02  6:15 ` [PATCH v2 1/2] iio: accel: fxls8962af: Fix temperature calculation Sean Nyekjaer
2025-05-02 14:19   ` Andy Shevchenko
2025-05-04 15:46     ` Jonathan Cameron [this message]
2025-05-03 13:41   ` Marcelo Schmitt
2025-05-02  6:15 ` [PATCH v2 2/2] iio: accel: fxls8962af: Fix sign temperature scan element Sean Nyekjaer
2025-05-03 13:57   ` Marcelo Schmitt
2025-05-04 15:49     ` Jonathan Cameron

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=20250504164654.1ecf7215@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt1@gmail.com \
    --cc=sean@geanix.com \
    --cc=stable@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