Skip to content

Commit

Permalink
hid-ft260: fix incompatible-pointer-types error
Browse files Browse the repository at this point in the history
Fixed compilation error introduced by "hid-ft260: Add serial driver" patch
https://lore.kernel.org/linux-serial/20231218093153.192268-1-contact@christina-quast.de/raw

  You are using:           gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
  CC [M]  /home/michael/sw/hid-ft260/hid-ft260.o
/home/michael/sw/hid-ft260/hid-ft260.c:1426:35: error: initialization of ‘int (*)(struct tty_struct *,
const unsigned char *, int)’ from incompatible pointer type ‘ssize_t (*)(struct tty_struct *,
const unsigned char *, size_t)’ {aka ‘long int (*)(struct tty_struct *, const unsigned char *,
long unsigned int)’} [-Werror=incompatible-pointer-types]
 1426 |         .write                  = ft260_uart_write,
      |                                   ^~~~~~~~~~~~~~~~
/home/michael/sw/hid-ft260/hid-ft260.c:1426:35: note: (near initialization for ‘ft260_uart_ops.write’)
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:251: /home/michael/sw/hid-ft260/hid-ft260.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.5.0-14-generic/Makefile:2037: /home/michael/sw/hid-ft260] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.5.0-14-generic'
make: *** [Makefile:6: all] Error 2

Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
  • Loading branch information
MichaelZaidman committed Jan 13, 2024
1 parent 60bf153 commit 1b1a2c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hid-ft260.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,8 +1220,8 @@ static int ft260_uart_receive_chars(struct ft260_device *port,
return ret;
}

static ssize_t ft260_uart_write(struct tty_struct *tty, const unsigned char *buf,
size_t count)
static int ft260_uart_write(struct tty_struct *tty, const unsigned char *buf,
int count)
{
struct ft260_device *port = tty->driver_data;
struct hid_device *hdev = port->hdev;
Expand Down

0 comments on commit 1b1a2c6

Please sign in to comment.