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

From: OGAWA Hirofumi
Date: Mon Jul 31 2017 - 16:54:17 EST


Andy Shevchenko <andy.shevchenko@xxxxxxxxx> writes:

>> +
>> + *(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.

Sorry, I forgot what I said completely. Maybe I changed my mind?

if (uni_xlate == 1) {
*op++ = ':';
op = hex_byte_pack(op, ec >> 8);
op = hex_byte_pack(op, ec);
len -= 5;

Here is output. So "uc[0] << 8 | uc[1]" is right code, isn't it?

>> charlen = nls->char2uni(ip, len - i,
>> - (wchar_t *)op);
>> + (wchar_t *)op);
>
> It perfectly fits one line.

It over 80 column.
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>