Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu 24.04 and (again) incompatible-pointer-types #49

Open
l-derosa opened this issue Aug 5, 2024 · 2 comments
Open

ubuntu 24.04 and (again) incompatible-pointer-types #49

l-derosa opened this issue Aug 5, 2024 · 2 comments

Comments

@l-derosa
Copy link

l-derosa commented Aug 5, 2024

hello, i successfully compiled the driver under ubuntu 22.04, but under ubuntu 24.04 make fails with a incompatible-pointer-types error, any hint? here the console output:

Screenshot at 2024-08-05 15-04-13

@Isengo1989
Copy link

Same here, any ideas? Did you fix it @l-derosa ?

@kangz543g
Copy link

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
static unsigned int ch34x_write_room(struct tty_struct *tty)
#else
static unsigned int ch34x_write_room(struct tty_struct *tty)
#endif
{
struct usb_serial_port *port = tty->driver_data;
struct ch34x_private *priv = usb_get_serial_port_data(port);
unsigned int room = 0;
unsigned long flags;

#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0))
dbg_ch34x("%s - port:%d", __func__, port->number);
#else
dbg_ch34x("%s - port:%d", __func__, port->port_number);
#endif

spin_lock_irqsave(&priv->lock, flags);
room = ch34x_buf_space_avail(priv->buf);
spin_unlock_irqrestore(&priv->lock, flags);

dbg_ch34x("%s - room:%u", __func__, room);
return room;

}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
static unsigned int ch34x_chars_in_buffer(struct tty_struct *tty)
#else
static unsigned int ch34x_chars_in_buffer(struct tty_struct *tty)
#endif
{
struct usb_serial_port *port = tty->driver_data;
struct ch34x_private *priv = usb_get_serial_port_data(port);
unsigned int chars = 0;
unsigned long flags;

#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0))
dbg_ch34x("%s - port:%d", __func__, port->number);
#else
dbg_ch34x("%s - port:%d", __func__, port->port_number);
#endif

spin_lock_irqsave(&priv->lock, flags);
chars = ch34x_buf_data_avail(priv->buf);
spin_unlock_irqrestore(&priv->lock, flags);

dbg_ch34x("%s - chars:%u", __func__, chars);
return chars;

}

Makefile
CFLAGS += -Wno-error=incompatible-pointer-types

OK!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants