[alsa-devel] [PATCH 09/14] ASoC: max9867: remove unused ‘ret’

Vinod Koul vinod.koul at intel.com
Fri Dec 9 07:56:13 CET 2016


On Thu, Dec 08, 2016 at 08:48:49PM -0200, Fabio Estevam wrote:
> On Thu, Dec 8, 2016 at 3:31 PM, Vinod Koul <vinod.koul at intel.com> wrote:
> 
> > -       ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
> > -       ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
> > +       regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
> > +       regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
> 
> What about doing like this instead?
> 
> ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
> if (ret)
>     return ret;
> 
> ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
> if (ret)
>   return ret;

yeah we can, but I didn't want to add/remove anything from this code, so
skipped the return which has same effect as previous code.

Btw should regmap_write() return be strictly checked or not?

Thanks
-- 
~Vinod


More information about the Alsa-devel mailing list