Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cfb4bbd8 authored by Torsten Fleischer's avatar Torsten Fleischer Committed by Mark Brown
Browse files

spi: spi-gpio: Fix compiler warning when building for 64 bit systems



The assignment of SPI_GPIO_NO_CHIPSELECT to cs_gpios[0] causes the following
compiler warning, when building for 64 bit systems:
"warning: overflow in implicit constant conversion [-Woverflow]".

This is because the SPI_GPIO_NO_CHIPSELECT flag is a '-1' type casted to
unsigned long and cs_gpios is of the type int.

Furthermore the chip select's GPIO number is locally stored as unsigned int
and compared with SPI_GPIO_NO_CHIPSELECT. Thus the result of the comparison
is always false, if unsigned long and unsigned int have a different size.

As part of the fix this patch adds a check for the device tree's cs-gpios
property.

Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarTorsten Fleischer <torfl6749@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d1d81802
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment