CV-Bowen opened a new pull request, #22491:
URL: https://github.com/apache/nuttx/pull/22491

   ## Summary
   
   `rpmsg_port_spi_init_gpio()` in both the SPI master and slave port drivers
   passes the `int` values `invert` and `intcfg` to `IOEXP_SETOPTION()` with a
   plain `(FAR void *)` cast. On 64-bit targets that does not build:
   
   ```
   drivers/rpmsg/rpmsg_port_spi.c:669:25: error: cast to pointer from integer 
of different size [-Werror=int-to-pointer-cast]
   drivers/rpmsg/rpmsg_port_spi.c:690:29: error: cast to pointer from integer 
of different size [-Werror=int-to-pointer-cast]
   drivers/rpmsg/rpmsg_port_spi_slave.c:729:25: error: cast to pointer from 
integer of different size [-Werror=int-to-pointer-cast]
   drivers/rpmsg/rpmsg_port_spi_slave.c:750:29: error: cast to pointer from 
integer of different size [-Werror=int-to-pointer-cast]
   ```
   
   Cast through `intptr_t`, which is how the I/O expander drivers read the
   option value back.
   
   ## Impact
   
   Build fix only; the value passed to `IOEXP_SETOPTION()` is unchanged.
   
   ## Testing
   
   Host: Ubuntu 22.04.5 LTS x86_64.
   
   No in-tree configuration enables the SPI port drivers, so they were built
   with a test-only overlay on top of the rpserver configurations:
   `CONFIG_SPI=y CONFIG_SPI_SLAVE=y CONFIG_IOEXPANDER=y 
CONFIG_IOEXPANDER_RPMSG=y
   CONFIG_RPMSG_PORT_SPI=y CONFIG_RPMSG_PORT_SPI_SLAVE=y` (`IOEXPANDER_RPMSG`
   only to get `IOEXPANDER_INT_ENABLE`, which the SPI ports need).
   
   | configuration | master | this PR |
   |---|---|---|
   | `qemu-armv8a:rpserver` + overlay (aarch64-none-elf-gcc 13.4) | the 4 
errors above | 0 warnings |
   | same, `RPMSG_PORT_RETX=n` | the 4 errors above | 0 warnings |
   | `qemu-armv7a:rpserver` + overlay (arm-none-eabi-gcc 10.3) | 0 warnings | 0 
warnings |
   
   No SPI hardware is available, so this is build-only.
   
   No regression in rpmsg: sim:rpserver/rpproxy and qemu-armv8a:rpserver/rpproxy
   boot and pass the fixed rpmsg cases (dump, ping, rpmsgfs).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to