lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150601143013.GG27360@localhost>
Date:	Mon, 1 Jun 2015 16:30:13 +0200
From:	Johan Hovold <johan@...nel.org>
To:	Abhishek Bist <ishubist@...il.com>
Cc:	johan@...nel.org, gregkh@...uxfoundation.org,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] USB-SERIAL : Changing usb_serial_generic_open
 prototype

On Sat, May 30, 2015 at 06:47:20PM +0530, Abhishek Bist wrote:
> While designing a usb to uart converter driver open function I am using
> usb_serial_generic_open, but wouldn't find need to pass tty as an argument.
> As it is not performing any task for further significance.
> 	So, This patch proposed a change in usb_serial_generic_open 
> function prototype which has struct tty_struct as a first argument.
> 
> usb_serial_generic_open(struct tty_struct *tty, 
> 	struct usb_serial_port *port);
> 
> Signed-off-by: Abhishek Bist <ishubist@...il.com>
 
> diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
> index 704a1ab..c8ed44a 100644
> --- a/include/linux/usb/serial.h
> +++ b/include/linux/usb/serial.h
> @@ -318,8 +318,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
>  /* Functions needed by other parts of the usbserial core */
>  extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor);
>  extern void usb_serial_put(struct usb_serial *serial);
> -extern int usb_serial_generic_open(struct tty_struct *tty,
> -	struct usb_serial_port *port);
> +extern int usb_serial_generic_open(struct usb_serial_port *port);
>  extern int usb_serial_generic_write_start(struct usb_serial_port *port,
>  							gfp_t mem_flags);
>  extern int usb_serial_generic_write(struct tty_struct *tty,

This does not work as usb_serial_generic_open is the default driver
callback.

If you had compile tested your patch you would have seen the following
warning:

linux/drivers/usb/serial/usb-serial.c: In function 'usb_serial_operations_init':
linux/drivers/usb/serial/usb-serial.c:1318:19: warning: assignment from incompatible pointer type
    type->function = usb_serial_generic_##function; \
                   ^
linux/drivers/usb/serial/usb-serial.c:1326:2: note: in expansion of macro 'set_to_generic_if_null'
  set_to_generic_if_null(device, open);
  ^

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ