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]
Date:	Tue, 2 Jun 2015 14:49:30 +0530
From:	Abhishek bist <ishubist@...il.com>
To:	Johan Hovold <johan@...nel.org>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] USB-SERIAL : Changing usb_serial_generic_open prototype

Yes, I gone through this warning. It is because if i want to make this
compilation warning free
than i have to change the prototype of a open function pointer
described in usb_serial_driver
and changing the prototype over there would affect all the device
driver lying in usb-serial
category , which is definitely not recommended.
      Anyways i got your point .

Thanks
Abhishek-bist

On 1 June 2015 at 20:00, Johan Hovold <johan@...nel.org> wrote:
> 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