iio:adc:mcp320x: Tidy up endian types in type cast.
[email protected]
maintainerPATCH 1/1 iio:adc:mcp320x: Tidy up endian types in type cast.
From: Jonathan Cameron <[email protected]>
Fixes the sparse warning:drivers/iio/adc/mcp320x.c:167:41: warning: incorrect type in argument 1 (different base types)drivers/iio/adc/mcp320x.c:167:41: expected restricted __be32 const [usertype] *pdrivers/iio/adc/mcp320x.c:167:41: got unsigned int [usertype] *<noident>
--- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/mcp320x.c +1 -1
@@ -164,7 +164,7 @@ static int mcp320x_adc_conversion(struct mcp320x *adc, u8 channel,case mcp3550_60:case mcp3551:case mcp3553: { -u32 raw =be32_to_cpup ((u32 *)adc->rx_buf); +u32 raw =be32_to_cpup ((__be32 *)adc->rx_buf);if (!(adc->spi->mode &SPI_CPOL )) raw <<=1 ;/* strip Data Ready bit in SPI mode 0,0 */
Signature · 1 line
2.23.0
Quoted 8 lines · On Sun, Oct 13, 2019 at 10:05:42AM +0100, [email protected] wrote:
From: Jonathan Cameron <[email protected]>
Fixes the sparse warning:
drivers/iio/adc/mcp320x.c:167:41: warning: incorrect type in argument 1 (different base types)drivers/iio/adc/mcp320x.c:167:41: expected restricted__be32const [usertype] *pdrivers/iio/adc/mcp320x.c:167:41: got unsigned int [usertype] *<noident>Signed-off-by Jonathan Cameron <[email protected]>
Thanks,
Lukas
Quoted 19 lines
--- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/mcp320x.c +1
-1@@ -164,7 +164,7 @@ static int mcp320x_adc_conversion(struct mcp320x *adc, u8 channel,case mcp3550_60:case mcp3551:case mcp3553: { -u32 raw =be32_to_cpup ((u32 *)adc->rx_buf); +u32 raw =be32_to_cpup ((__be32 *)adc->rx_buf);if (!(adc->spi->mode &SPI_CPOL )) raw <<=1 ;/* strip Data Ready bit in SPI mode 0,0 */ Signature · 1 line
2.23.0
Quoted 11 lines · On Sun, 13 Oct 2019 12:52:01 +0200 Lukas Wunner <[email protected]> wrote:
Quoted 8 lines · On Sun, Oct 13, 2019 at 10:05:42AM +0100, [email protected] wrote:
From: Jonathan Cameron <[email protected]>
Fixes the sparse warning:
drivers/iio/adc/mcp320x.c:167:41: warning: incorrect type in argument 1 (different base types)drivers/iio/adc/mcp320x.c:167:41: expected restricted__be32const [usertype] *pdrivers/iio/adc/mcp320x.c:167:41: got unsigned int [usertype] *<noident>Signed-off-by Jonathan Cameron <[email protected]>Reviewed-by Lukas Wunner <[email protected]>
Applied.
Thanks,
Jonathan
Quoted 25 lines
Thanks,
Lukas
Quoted 19 lines
--- drivers/iio/adc/mcp320x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/mcp320x.c +1
-1@@ -164,7 +164,7 @@ static int mcp320x_adc_conversion(struct mcp320x *adc, u8 channel,case mcp3550_60:case mcp3551:case mcp3553: { -u32 raw =be32_to_cpup ((u32 *)adc->rx_buf); +u32 raw =be32_to_cpup ((__be32 *)adc->rx_buf);if (!(adc->spi->mode &SPI_CPOL )) raw <<=1 ;/* strip Data Ready bit in SPI mode 0,0 */ Signature · 1 line
2.23.0