This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit f9f881b48e577512192c42005e75bd380b2c66cd Author: Marco Casaroli <[email protected]> AuthorDate: Mon Nov 2 10:49:21 2026 +0100 drivers/leds/ws2812: Declare ws2812_open() and ws2812_close() as int. With CONFIG_WS2812_NON_SPI_DRIVER, ws2812.c declared ws2812_open() and ws2812_close() as returning ssize_t, defined ws2812_open() as ssize_t and ws2812_close() as int, and put both in struct file_operations, which takes int. This compiles only where ssize_t is int. On 64-bit architectures (for example qemu-armv8a) the build fails with "conflicting types for 'ws2812_close'" and incompatible pointer types in g_ws2812fops. Declare and define both functions as static int, as struct file_operations expects. Also correct the returned value in the ws2812_open() description. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- drivers/leds/ws2812.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/leds/ws2812.c b/drivers/leds/ws2812.c index 1493dd8e970..26c23de9001 100644 --- a/drivers/leds/ws2812.c +++ b/drivers/leds/ws2812.c @@ -142,9 +142,9 @@ static void ws2812_pack(FAR uint8_t *buf, uint32_t rgb); #ifdef CONFIG_WS2812_NON_SPI_DRIVER -static ssize_t ws2812_open(FAR struct file *filep); +static int ws2812_open(FAR struct file *filep); -static ssize_t ws2812_close(FAR struct file *filep); +static int ws2812_close(FAR struct file *filep); #endif /* CONFIG_WS2812_NON_SPI_DRIVER */ @@ -292,11 +292,11 @@ static void ws2812_byte_order_transform_rgb(FAR const char *src, * filep - Pointer system file data * * Returned Value: - * A pointer to an internal structure used by rp2040_ws2812 + * OK if successful, or an error code on failure. * ****************************************************************************/ -ssize_t ws2812_open(FAR struct file *filep) +static int ws2812_open(FAR struct file *filep) { FAR struct inode *inode = filep->f_inode; FAR struct ws2812_dev_s *priv = inode->i_private;
