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, 29 Dec 2020 22:28:42 -0800
From:   Joe Perches <joe@...ches.com>
To:     YANG LI <abaci-bugfix@...ux.alibaba.com>, davem@...emloft.net
Cc:     kuba@...nel.org, dchickles@...vell.com, sburla@...vell.com,
        fmanlunas@...vell.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] liquidio: style:  Identical condition and return
 expression  'retval', return value is always 0.

On Wed, 2020-12-30 at 14:07 +0800, YANG LI wrote:
> The warning was because of the following line in function
> liquidio_set_fec():
> 
> retval = wait_for_sc_completion_timeout(oct, sc, 0);
>     if (retval)
> 	return (-EIO);

I presume abaci is a robot

Perhaps also the robot could look for code immediately above this like:

		oct->props[lio->ifidx].fec = var;
		if (resp->fec_setting == SEAPI_CMD_FEC_SET_RS)
			oct->props[lio->ifidx].fec = 1;
		else
			oct->props[lio->ifidx].fec = 0;

where a location is immediately overwritten.

so the line
		oct->props[lio->ifidx].fec = var;
could be highlighted and perhaps removed
and also perhaps the second test and set block could be written

		oct->props[lio->ifidx].fec = resp->fec_setting == SEAPI_CMD_FEC_SET_RS;



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ