Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: core: switch info_mask fields to unsigned long to match find_bit helpers

for_each_set_bit()/find_*_bit() expect arrays of unsigned long (see
include/linux/find.h), but industrialio-core passed const long * into
iio_device_add_info_mask_type{,_avail}().

These masks are used purely as bit arrays and are populated via BIT()
(1UL << n). Switch the info_mask_* fields and the corresponding function
parameters to unsigned long so the types match the helpers. This removes
sparse warnings about signedness mismatches (seen with 'make C=1'
CF='-Wsparse-all') without changing behavior or struct layout.

No functional change intended.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Junjie Cao <junjie.cao@intel.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250820004755.69627-1-junjie.cao@intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Junjie Cao and committed by
Jonathan Cameron
60ad9a07 21feb435

+10 -10
+2 -2
drivers/iio/industrialio-core.c
··· 1244 1244 static int iio_device_add_info_mask_type(struct iio_dev *indio_dev, 1245 1245 struct iio_chan_spec const *chan, 1246 1246 enum iio_shared_by shared_by, 1247 - const long *infomask) 1247 + const unsigned long *infomask) 1248 1248 { 1249 1249 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1250 1250 int i, ret, attrcount = 0; ··· 1274 1274 static int iio_device_add_info_mask_type_avail(struct iio_dev *indio_dev, 1275 1275 struct iio_chan_spec const *chan, 1276 1276 enum iio_shared_by shared_by, 1277 - const long *infomask) 1277 + const unsigned long *infomask) 1278 1278 { 1279 1279 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1280 1280 int i, ret, attrcount = 0;
+8 -8
include/linux/iio/iio.h
··· 271 271 unsigned int num_ext_scan_type; 272 272 }; 273 273 }; 274 - long info_mask_separate; 275 - long info_mask_separate_available; 276 - long info_mask_shared_by_type; 277 - long info_mask_shared_by_type_available; 278 - long info_mask_shared_by_dir; 279 - long info_mask_shared_by_dir_available; 280 - long info_mask_shared_by_all; 281 - long info_mask_shared_by_all_available; 274 + unsigned long info_mask_separate; 275 + unsigned long info_mask_separate_available; 276 + unsigned long info_mask_shared_by_type; 277 + unsigned long info_mask_shared_by_type_available; 278 + unsigned long info_mask_shared_by_dir; 279 + unsigned long info_mask_shared_by_dir_available; 280 + unsigned long info_mask_shared_by_all; 281 + unsigned long info_mask_shared_by_all_available; 282 282 const struct iio_event_spec *event_spec; 283 283 unsigned int num_event_specs; 284 284 const struct iio_chan_spec_ext_info *ext_info;