From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751699AbdGaTjc (ORCPT ); Mon, 31 Jul 2017 15:39:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:8352 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbdGaTjb (ORCPT ); Mon, 31 Jul 2017 15:39:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,304,1498546800"; d="scan'208";a="1178280512" Message-ID: <1501529949.29303.314.camel@linux.intel.com> Subject: Re: [PATCH v5] vfat: Deduplicate hex2bin() From: Andy Shevchenko To: OGAWA Hirofumi Cc: linux-kernel@vger.kernel.org, Joe Perches Date: Mon, 31 Jul 2017 22:39:09 +0300 In-Reply-To: <877eyov49l.fsf@devron> References: <20170731143349.84629-1-andriy.shevchenko@linux.intel.com> <877eyov49l.fsf@devron> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-08-01 at 03:40 +0900, OGAWA Hirofumi wrote: > Andy Shevchenko writes: > > > We may use hex2bin() instead of custom approach. > > > > Signed-off-by: Andy Shevchenko > > > > > + 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 Intel Finland Oy