Re: [PATCH v5] vfat: Deduplicate hex2bin()

From: Andy Shevchenko
Date: Mon Jul 31 2017 - 15:39:36 EST


On Tue, 2017-08-01 at 03:40 +0900, OGAWA Hirofumi wrote:
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> writes:
>
> > We may use hex2bin() instead of custom approach.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
>
>

> > + fill = hex2bin(hc, ip + 1, 2);
> > + if (fill)
> > + return fill;
>
> This should not use random errno (in this case, it is -1 (EPERM)).

You perhaps missed the side note I put after --- line.
It reflects this change.

>
> > + *op++ = hc[1];
> > + *op++ = hc[0];
>
> Maybe, originally endian bug?

No problem reported. And as you noticed quite ago it is __be16
originally as it goes hi-lo.

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy