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

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


On Mon, Jul 31, 2017 at 9:44 PM, OGAWA Hirofumi
<hirofumi@xxxxxxxxxxxxxxxxxx> wrote:
> We may use hex2bin() instead of custom approach.

> #include <linux/ctype.h>
> #include <linux/slab.h>
> #include <linux/namei.h>
> +#include <linux/kernel.h>

Would not be better to squeeze it somehow alphabetically ordered (in
most ordered part)?


> +
> + *(wchar_t *)op = uc[0] << 8 | uc[1];
> +
> + op += 2;

This had been in the original patch 6 years ago and had been refused
because of endianess issues.

> charlen = nls->char2uni(ip, len - i,
> - (wchar_t *)op);
> + (wchar_t *)op);

It perfectly fits one line.

--
With Best Regards,
Andy Shevchenko