Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751719AbdGaTbf (ORCPT ); Mon, 31 Jul 2017 15:31:35 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:33511 "EHLO mail-oi0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676AbdGaTbb (ORCPT ); Mon, 31 Jul 2017 15:31:31 -0400 MIME-Version: 1.0 In-Reply-To: <87zibktpil.fsf@devron> References: <20170731143349.84629-1-andriy.shevchenko@linux.intel.com> <877eyov49l.fsf@devron> <87zibktpil.fsf@devron> From: Andy Shevchenko Date: Mon, 31 Jul 2017 22:31:29 +0300 Message-ID: Subject: Re: [PATCH v5] vfat: Deduplicate hex2bin() To: OGAWA Hirofumi Cc: Andrew Morton , Andy Shevchenko , "linux-kernel@vger.kernel.org" , Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 867 Lines: 30 On Mon, Jul 31, 2017 at 9:44 PM, OGAWA Hirofumi wrote: > We may use hex2bin() instead of custom approach. > #include > #include > #include > +#include 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