Skip to content

iio: Introduce and use value of π

Andy Shevchenko chrome-platform linux-iio linux-media lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 6 repliesIn review
  2. v16 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- redone to avoid unneeded calculations
- collected tags (Hans)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6media: vidtv: Rename PI definition to PI_SAMPLESdrivers/media/test-drivers/vidtv/vidtv_s302m.c+3 -32 replies
2/6units: Add 32- and 64-bit signed values of πinclude/linux/units.h+6 -04 replies
3/6media: dvb-frontends: atbm8830: Convert to use PI definitiondrivers/media/dvb-frontends/atbm8830.c+3 -20 replies
4/6iio: cros_ec_sensors: Convert to use PI definitiondrivers/iio/common/cros_ec_sensors/cros_ec_sensors.c+2 -10 replies
5/6iio: frequency: ad9523: Convert to use PI definitiondrivers/iio/frequency/ad9523.c+3 -20 replies
6/6iio: position: iqs624-pos: Convert to use PI definitiondrivers/iio/position/iqs624-pos.c+2 -10 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchHans Verkuil
1/6A-b
2/6
3/6A-b
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/6] iio: Introduce and use value of π

There are a few drivers that use value of π (small Greek PI) of different precision. Instead of hard coding over and over convert them to use a defined constant, which one of the patches in this series introduces. No functional changes involved.

Note, the respective IIO macros are not converted yet by this series.

All of the converted files were checked in disassembled format before and after the change to see that the value:
a) pre-calculated at compile-time;
b) is the same that is expected.

I didn't put the power-of-10 into the definition names as now they are the maximum that fits the respective signed type.

Series is supposed to go via IIO tree.

Changelog v2:
- redone to avoid unneeded calculations
- collected tags (Hans)

v1: <[email protected]>

Andy Shevchenko (6):
media: vidtv: Rename PI definition to PI_SAMPLES
units: Add 32- and 64-bit signed values of π
media: dvb-frontends: atbm8830: Convert to use PI definition
iio: cros_ec_sensors: Convert to use PI definition
iio: frequency: ad9523: Convert to use PI definition
iio: position: iqs624-pos: Convert to use PI definition

 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 3 ++-
 drivers/iio/frequency/ad9523.c                       | 5 +++--
 drivers/iio/position/iqs624-pos.c                    | 3 ++-
 drivers/media/dvb-frontends/atbm8830.c               | 5 +++--
 drivers/media/test-drivers/vidtv/vidtv_s302m.c       | 6 +++---
 include/linux/units.h                                | 6 ++++++
 6 files changed, 19 insertions(+), 9 deletions(-)
Signature · 1 line
2.50.1