Hi Jmondi, On Fri, Aug 18, 2017 at 9:58 AM, jmondi wrote: > Hi Abhisit, > > On Fri, Aug 18, 2017 at 09:34:16AM +0700, Abhisit Sangjan wrote: > > Hi Jmondi, > > > > Thank you for your recommend, I am testing the code will be send the new > > patch in soon. > > [snip] > > > > > > + > > > > > + switch (mask) > > > > > + { > > > > > + case IIO_CHAN_INFO_RAW: > > > > > + switch (channel->type) { > > > > > + case IIO_VOLTAGE: > > > > > + case IIO_TEMP: > > > > > + *val = code; > > > > > + return IIO_VAL_INT; > > > > > + default: > > > > > + break; > > > > > + } > > > > > + break; > > > > > + default: > > > > > + break; > > > > > > You can remove these default cases or return -EINVAL here. > > > > > > > Abhisit: Okay, I will remove it. > > Could you tell me in detail. Sorry, I do not understand the > > Technical. > > This can potentially be reduced to > > switch (mask) { > case IIO_CHAN_INFO_RAW: > switch (channel->type) { > case IIO_VOLTAGE: > case IIO_TEMP: > *val = code; > return IIO_VAL_INT; > } > } > > return -EINVAL; > > > But that's definitely not a big deal, there are no optimization in > this code change, just less typing and less default: and break; here > and there > Abhisit: Thank you so much.