iio: light: opt4001: Fix a wrong array iteration limit

In practice it's unlikely anyone would try to set the integration time
to 0 which isn't in the available list and if they did then they would
get index 12 which whilst reserved on the device fits in the field.
However a compiler might get half way through this reasoning and that
might be the cause of

> >> drivers/iio/light/opt4001.c:215:9: error: call to '__compiletime_assert_355' declared with 'error' attribute: FIELD_PREP: value too large for the field
>      215 |         reg |= FIELD_PREP(OPT4001_CTRL_CONV_TIME_MASK, chip->int_time);

Even if this isn't the cause, it looks like a bug to me.

Fixes: 9a9608418292 ("iio: light: Add support for TI OPT4001 light sensor")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308061902.0gVz6bSe-lkp@intel.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 file changed