Re: [PATCH 03/10] iio: accel: adxl367: Use automated cleanup for locks and iio direct mode.

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

 



On Sun, 2024-02-04 at 13:48 +0000, Jonathan Cameron wrote:
> 
> > > -out:
> > > -	mutex_unlock(&st->lock);
> > > +		ret = adxl367_set_measure_en(st, true);
> > > +		if (ret)
> > > +			return ret;
> > >  
> > > -	iio_device_release_direct_mode(indio_dev);
> > > +		st->range = range;
> > >  
> > > -	return ret;
> > > +		return 0;
> > > +	}
> > > +	unreachable();
> > >  }  
> > 
> > I do agree this is irritating. Personally I would prefer to return 0 (or the
> > last ret value) instead of the unusual unreachable() builtin. But that's me :)
> Definitely would be an error, not 0 or ret, but I'm still in two minds about this

Agreed with that... In theory, would just be about making the compiler happy.

- Nuno Sá






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux