vsergeev/c-periphery

Warning in spi.c

Closed this issue · 1 comments

Hi!

There is a little warning for int/pointer casting in the spi.c.
Can you fix it to keep the "clean-coding"?

I tried several version of GCC, but all got the same warning. My GCC version is the following:

root@myboard:~/# gcc --version
gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Here is what i got in the GCC warning message.

root@myboard:~/# gcc -pthread src/gpio.c src/spi.c spi_test.c -o spi_test -lm
src/spi.c: In function 'spi_transfer':
src/spi.c:92:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     spi_xfer.tx_buf = (__u64)txbuf;
                       ^
src/spi.c:93:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     spi_xfer.rx_buf = (__u64)rxbuf;
                       ^

Thanks, fixed in 085752d.