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: <0b9086b4-8da8-c18e-ad22-1f52d6ed0686@canonical.com>
Date:   Thu, 22 Apr 2021 14:01:36 +0100
From:   Colin Ian King <colin.king@...onical.com>
To:     Johan Hovold <johan@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Lee Jones <lee.jones@...aro.org>, linux-serial@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] tty: serial: jsm: remove redundant assignments of
 several variables

On 22/04/2021 13:56, Johan Hovold wrote:
> On Thu, Apr 22, 2021 at 01:53:03PM +0100, Colin Ian King wrote:
>> On 22/04/2021 13:52, Johan Hovold wrote:
>>> On Thu, Apr 22, 2021 at 01:11:15PM +0100, Colin King wrote:
>>>> From: Colin Ian King <colin.king@...onical.com>
>>>>
>>>> Several variables are being assigned with values that are never
>>>> read and being updated later with a new value. The initializations
>>>> are redundant and can be removed.
>>>>
>>>> Addresses-Coverity: ("Unused value")
>>>> Signed-off-by: Colin Ian King <colin.king@...onical.com>
>>>> ---
>>>>  drivers/tty/serial/jsm/jsm_cls.c | 6 ++----
>>>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/tty/serial/jsm/jsm_cls.c b/drivers/tty/serial/jsm/jsm_cls.c
>>>> index b507a2cec926..b58ea4344aaf 100644
>>>> --- a/drivers/tty/serial/jsm/jsm_cls.c
>>>> +++ b/drivers/tty/serial/jsm/jsm_cls.c
>>>> @@ -349,8 +349,8 @@ static void cls_assert_modem_signals(struct jsm_channel *ch)
>>>>  
>>>>  static void cls_copy_data_from_uart_to_queue(struct jsm_channel *ch)
>>>>  {
>>>> -	int qleft = 0;
>>>> -	u8 linestatus = 0;
>>>> +	int qleft;
>>>> +	u8 linestatus;
>>>>  	u8 error_mask = 0;
>>>>  	u16 head;
>>>>  	u16 tail;
>>>> @@ -365,8 +365,6 @@ static void cls_copy_data_from_uart_to_queue(struct jsm_channel *ch)
>>>>  	head = ch->ch_r_head & RQUEUEMASK;
>>>>  	tail = ch->ch_r_tail & RQUEUEMASK;
>>>>  
>>>> -	/* Get our cached LSR */
>>>> -	linestatus = ch->ch_cached_lsr;
>>>>  	ch->ch_cached_lsr = 0;
>>>
>>> Why leave this assignment in? Looks like this was all copy-pasta, but
>>> this assignment makes even less sense now that you remove the comment
>>> and load.
>>
>> Which assignment are you referring to?
> 
> The one just above my comment: 
> 
> 	ch->ch_cached_lsr = 0;

that cached value is being used in jsm_neo.c, so removing the zero'ing
may cause some issues.

> 
> Johan
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ