Re: [PATCH 5/9] staging: ks7010: Delete unnecessary uses of the variable "retval"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 21, 2016 at 09:26:33AM +0200, Julia Lawall wrote:
> 
> 
> On Thu, 21 Jul 2016, Wolfram Sang wrote:
> 
> >
> > > >>>  	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.
> > >
> > > Would you try an other source code formatting for the suggested change pattern?
> >
> > I don't understand the question?
> 
> I think the original code was fine.  x = blah(); if (x) ... is a perfectly
> familiar kernel coding pattern.  There is no benefit in terms of
> performance or understandability in dropping the variable.

I certainly agree to that.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux