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: <20160720155333.GE1688@katana>
Date:	Wed, 20 Jul 2016 17:53:33 +0200
From:	Wolfram Sang <wsa@...-dreams.de>
To:	Julia Lawall <julia.lawall@...6.fr>
Cc:	SF Markus Elfring <elfring@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org, LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 5/9] staging: ks7010: Delete unnecessary uses of the
 variable "retval"

On Sun, Jul 17, 2016 at 08:56:59PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 17 Jul 2016, SF Markus Elfring wrote:
> 
> > From: Markus Elfring <elfring@...rs.sourceforge.net>
> > Date: Sun, 17 Jul 2016 18:15:23 +0200
> >
> > Some return values can also be directly used for various condition checks.
> > Thus remove a local variable for intermediate assignments.
> >
> > Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 81 +++++++++++++++---------------------
> >  1 file changed, 34 insertions(+), 47 deletions(-)
> >
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > index eea18fb..b3ca8e2 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -90,7 +90,6 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int address,
> >  void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
> >  {
> >  	unsigned char rw_data;
> > -	int retval;
> >
> >  	DPRINTK(4, "\n");
> >
> > @@ -99,9 +98,10 @@ void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
> >
> >  	if (atomic_read(&priv->sleepstatus.status) == 0) {
> >  		rw_data = GCR_B_DOZE;
> > -		retval =
> > -		    ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data));
> > -		if (retval) {
> > +		if (ks7010_sdio_write(priv,
> > +				      GCR_B,
> > +				      &rw_data,
> > +				      sizeof(rw_data))) {
> 
> A multi-line function call in an if test does not look nice at all.  The
> original code was an easy-to-read expectable pattern.

I agree. I am not strict on the 80 char limit, especially in cases like
the above.


Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ