Re: [PATCH v5 3/3] drivers: iio: adc: add support for ad777x family

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

 



> ...
> 
> > +       iio_device_claim_direct_scoped(return -EBUSY, indio_dev) {
> > +               switch (mask) {
> > +               case IIO_CHAN_INFO_CALIBSCALE:
> > +                       *val = ad7779_get_calibscale(st, chan->channel);
> > +                       if (*val < 0)
> > +                               return -EINVAL;
> > +                       *val2 = GAIN_REL;
> > +                       return IIO_VAL_FRACTIONAL;
> > +               case IIO_CHAN_INFO_CALIBBIAS:
> > +                       *val = ad7779_get_calibbias(st, chan->channel);
> > +                       if (*val < 0)
> > +                               return -EINVAL;
> > +                       return IIO_VAL_INT;
> > +               case IIO_CHAN_INFO_SAMP_FREQ:
> > +                       *val = st->sampling_freq;
> > +                       if (*val < 0)
> > +                               return -EINVAL;
> > +                       return IIO_VAL_INT;
> > +               }
> > +               return -EINVAL;
> > +       }  
> 
> > +       unreachable();  
> 
> Hmm... Is it necessary? Same Q for other similar cases. I.o.w. what
> will be if we don't add this line?

The compiler can't tell that the contents of iio_device_claim_direct_scoped()
always runs.  Hence normal result is it complains that nothing was returned.

Why the compiler can't figure out?  Who knows... 

Jonathan




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux