iio: adc: ti-ads1015: Add static assert to test if shifted realbits fit into storagebits
authorMarek Vasut <marex@denx.de>
Mon, 28 Mar 2022 19:47:22 +0000 (21:47 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:11:26 +0000 (09:11 +0100)
commit3139ff24e2bc25d619ef822491651ecfb886db90
tree257d92f27870174fd958a4c180ca46d9e9b1581c
parentf1c9ce0ced2d2596bd979933ca9f57fdf8aabdfc
iio: adc: ti-ads1015: Add static assert to test if shifted realbits fit into storagebits

Add compile-time static_assert wrapper to verify that shifted realbits
fit into storagebits. The macro is implemented in a more generic way so
it can be used to verify other values if required.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220328194725.149150-7-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-ads1015.c