Skip to content

iio: gts: Simplify available scales building

Matti Vaittinen linux-iio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iio: gts: Simplify using __freedrivers/iio/industrialio-gts-helper.c+63 -452 replies
2/3iio: gts: split table-building functiondrivers/iio/industrialio-gts-helper.c+42 -240 replies
3/3iio: gts: simplify scale table builddrivers/iio/industrialio-gts-helper.c+42 -672 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] iio: gts: Simplify available scales building

Simplify the available scales building.

Building the available scales tables looks confusing. It has also been a source of a few memory leaks.

https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/

Attempt making it a bit less error prone by simplifying some error paths using __free(kfree) from the cleanup.h. Try doing this without introducing variables in the middle of a function while also improving the logic of the functions. This is possble by splitting the long scale building logic in a couple of different, well purposed functions, and finally streamlining the logic a bit by taking out one extra 'total gains to scales'-conversion.

Inspired by the discussion here:
https://lore.kernel.org/lkml/[email protected]/

Matti Vaittinen (3):
iio: gts: Simplify using __free
iio: gts: split table-building function
iio: gts: simplify scale table build

 drivers/iio/industrialio-gts-helper.c | 171 ++++++++++++++------------
 1 file changed, 91 insertions(+), 80 deletions(-)

base-commit: a61ff7eac77e86de828fe28c4e42b8ae9ec2b195

Signature · 1 line
2.47.0