Re: [PATCH 22/37] tcm_fc: remove custom hex_to_bin in ft_parse_wwn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 14, 2011 at 3:41 AM, Nicholas A. Bellinger
<nab@xxxxxxxxxxxxxxx> wrote:
> This patch converts ft_parse_wwn() to use hex_to_bin() instead of custom
> conversion code.

> @@ -94,13 +95,10 @@ static ssize_t ft_parse_wwn(const char *name, u64 *wwn, int strict)
>                        return cp - name;
>                }
>                err = 3;
> -               if (isdigit(c))
> -                       nibble = c - '0';
> -               else if (isxdigit(c) && (islower(c) || !strict))
> -                       nibble = tolower(c) - 'a' + 10;
> -               else
> +               val = hex_to_bin(c);
> +               if (val < 0)
Just realized the patch has removed a bit of original logic. Above
line should be like
  if (val < 0 || (strict && isupper(c)))

-- 
With Best Regards,
Andy Shevchenko
��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux