lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241028-iio-add-macro-for-even-identifier-for-differential-channels-v1-0-b452c90f7ea6@baylibre.com>
Date: Mon, 28 Oct 2024 17:38:10 +0100
From: Julien Stephan <jstephan@...libre.com>
To: Jonathan Cameron <jic23@...nel.org>, 
 Lars-Peter Clausen <lars@...afoo.de>, 
 Michael Hennerich <Michael.Hennerich@...log.com>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Julien Stephan <jstephan@...libre.com>
Subject: [PATCH 0/2] iio: events.h: add event identifier macros for
 differential channel

Hello,

This series adds a a new helper macro, IIO_DIFF_EVENT_CODE, to
specifically create event identifiers for differential channel.

Indeed, currently, there are 3 helper macros in iio/events.h to create
event identifiers:
- IIO_EVENT_CODE : create generic event identifier for differential and non
  differential channels
- IIO_MOD_EVENT_CODE : create event identifier for modified (non
  differential) channels
- IIO_UNMOD_EVENT_CODE : create event identifier for unmodified (non
  differential) channels

For differential channels, drivers are expected to use IIO_EVENT_CODE.
However, only one driver in drivers/iio currently uses it correctly,
leading to inconsistent event identifiers for differential channels that
don’t match the intended attributes (such as max1363.c that supports
differential channels, but only uses IIO_UNMOD_EVENT_CODE).

Adding this new macro to prevent such issues in future drivers.
Only one helper is needed for differential channels since they cannot have
modifiers.

Additionally, the descriptions for IIO_MOD_EVENT_CODE and
IIO_UNMOD_EVENT_CODE have been updated to clarify that they are intended
for non-differential channels,

This series also fix ad7280a driver to use the new helper.
However, the current implementation in ad7280a incorrectly sets both
chan1 and chan2 to 0. To maintain compatibility and avoid breaking
existing user space applications, this behavior is preserved for now.

Signed-off-by: Julien Stephan <jstephan@...libre.com>
---
Julien Stephan (2):
      iio: events.h: add event identifier macros for differential channel
      iio: adc: ad7280a: use IIO_DIFF_EVENT_CODE macro helper

 drivers/iio/adc/ad7280a.c  | 14 ++++++--------
 include/linux/iio/events.h | 18 ++++++++++++++++--
 2 files changed, 22 insertions(+), 10 deletions(-)
---
base-commit: 9090ececac9ff1e22fb7e042f3c886990a8fb090
change-id: 20241024-iio-add-macro-for-even-identifier-for-differential-channels-1bd8afdacf42

Best regards,
-- 
Julien Stephan <jstephan@...libre.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ