lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 8 Nov 2010 08:26:23 +0100
From:	Florian Fainelli <florian@...nwrt.org>
To:	Andy Shevchenko <andy.shevchenko@...il.com>
Cc:	linux-kernel@...r.kernel.org, Ralf Baechle <ralf@...ux-mips.org>,
	linux-mips@...ux-mips.org
Subject: Re: [PATCH] arch: mips: use newly introduced hex_to_bin()

Le Monday 11 October 2010 18:34:16, Andy Shevchenko a écrit :
> Any comments here?

Acked-by: Florian Fainelli <florian@...nwrt.org>

> 
> On Sat, Sep 11, 2010 at 4:33 PM, Andy Shevchenko
> 
> <andy.shevchenko@...il.com> wrote:
> > Remove custom implementation of hex_to_bin().
> > 
> > Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
> > Cc: Ralf Baechle <ralf@...ux-mips.org>
> > Cc: linux-mips@...ux-mips.org
> > ---
> >  arch/mips/rb532/devices.c |   24 +++++++++---------------
> >  1 files changed, 9 insertions(+), 15 deletions(-)
> > 
> > diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
> > index 041fc1a..a969eb8 100644
> > --- a/arch/mips/rb532/devices.c
> > +++ b/arch/mips/rb532/devices.c
> > @@ -251,28 +251,22 @@ static struct platform_device *rb532_devs[] = {
> > 
> >  static void __init parse_mac_addr(char *macstr)
> >  {
> > -       int i, j;
> > -       unsigned char result, value;
> > +       int i, h, l;
> > 
> >        for (i = 0; i < 6; i++) {
> > -               result = 0;
> > -
> >                if (i != 5 && *(macstr + 2) != ':')
> >                        return;
> > 
> > -               for (j = 0; j < 2; j++) {
> > -                       if (isxdigit(*macstr)
> > -                           && (value =
> > -                               isdigit(*macstr) ? *macstr -
> > -                               '0' : toupper(*macstr) - 'A' + 10) < 16)
> > { -                               result = result * 16 + value;
> > -                               macstr++;
> > -                       } else
> > -                               return;
> > -               }
> > +               h = hex_to_bin(*macstr++);
> > +               if (h == -1)
> > +                       return;
> > +
> > +               l = hex_to_bin(*macstr++);
> > +               if (l == -1)
> > +                       return;
> > 
> >                macstr++;
> > -               korina_dev0_data.mac[i] = result;
> > +               korina_dev0_data.mac[i] = (h << 4) + l;
> >        }
> >  }
> > 
> > --
> > 1.7.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ