On Fri, Mar 08, 2024 at 02:40:11PM +0530, Dhruva Gole wrote: > > + > > + if (val < 0 || val > mask) > > + return -EINVAL; > > Probably combine this with below if's, eitherway is fine. > > > + > > + if (val <= reg_base) > > + return base; > > + > > + if (val >= reg_max) > > + return max; > > Why all these if's when they can be elifs? > > > +
This was just a cut and paste of my suggested code. I really like my code... It's like a tortoise eating the three bears' food... This is invalid. This is low. This is high. This poridge is just right. regards, dan carpenter