diff options
author | 2023-04-06 10:40:12 -0400 | |
---|---|---|
committer | 2023-04-10 12:26:33 +0100 | |
commit | 46a4cac7f841a2a2cb397bcb2fd24324004c853e (patch) | |
tree | b6810c854dcf84e1bd53c663407159ee5d1dfda4 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | iio: addac: stx104: Fix race condition when converting analog-to-digital (diff) | |
download | wireguard-linux-46a4cac7f841a2a2cb397bcb2fd24324004c853e.tar.xz wireguard-linux-46a4cac7f841a2a2cb397bcb2fd24324004c853e.zip |
iio: addac: stx104: Use define rather than hardcoded limit for write val
The DAC register is 16 bits wide, so the value passed by write_raw()
should be checked against that limit. Rather than hardcoding the 16-bit
maximum value limit, use a define to improve readability and make the
intention of the code clearer. The explicit cast is also avoided by
instead explicitly checking for negative values.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Link: https://lore.kernel.org/r/4c9f4f1b4a270d133be70c82a091351b531b5e3e.1680790580.git.william.gray@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions