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] [day] [month] [year] [list]
Date:	Mon, 31 Mar 2014 15:09:22 -0700
From:	Joe Perches <joe@...ches.com>
To:	Thomas Vegas <thomas_75@...e-mail.net>
Cc:	gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
	devel@...verdev.osuosl.org
Subject: Re: [PATCH v3 2/2] staging: serqt_usb2: Clean up initializations of
 variables.

On Mon, 2014-03-31 at 19:50 +0200, Thomas Vegas wrote:
> Use a more common kernel coding style.

Hi again.

You removed the set of status to 0.

If that was intentional, you should state why in the changelog.

btw:

Status is never really used and might as well be deleted too.

	/* Close uart channel */
	status = qt_close_channel(serial, index);
	if (status < 0)
		dev_dbg(&port->dev, "%s - qt_close_channel failed.\n", __func__);

This could be changed to:

	if (qt_close_channel(serial, index) < 0)
		dev_dbg(etc...

> Signed-off-by: Thomas Vegas <thomas_75@...e-mail.net>
> ---
>  drivers/staging/serqt_usb2/serqt_usb2.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
> index a04cfc3..35d84fd 100644
> --- a/drivers/staging/serqt_usb2/serqt_usb2.c
> +++ b/drivers/staging/serqt_usb2/serqt_usb2.c
> @@ -990,18 +990,11 @@ static void qt_block_until_empty(struct tty_struct *tty,
>  static void qt_close(struct usb_serial_port *port)
>  {
>  	struct usb_serial *serial = port->serial;
> -	struct quatech_port *qt_port;
> -	struct quatech_port *port0;
> -	struct tty_struct *tty;
> +	struct tty_struct *tty = tty_port_tty_get(&port->port);
> +	unsigned int index = port->port_number;
> +	struct quatech_port *qt_port = qt_get_port_private(port);
> +	struct quatech_port *port0 = qt_get_port_private(serial->port[0]);
>  	int status;
> -	unsigned int index;
> -	status = 0;
> -
> -	tty = tty_port_tty_get(&port->port);
> -	index = port->port_number;
> -
> -	qt_port = qt_get_port_private(port);
> -	port0 = qt_get_port_private(serial->port[0]);
>  
>  	/* shutdown any bulk reads that might be going on */
>  	if (serial->num_bulk_out)



--
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