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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c0942db0802091146v7b780b7dl4bd745caef900ae7@mail.gmail.com>
Date:	Sat, 9 Feb 2008 11:46:33 -0800
From:	"Ray Lee" <ray-lk@...rabbit.org>
To:	"Christoph Hellwig" <hch@...radead.org>
Cc:	jason.wessel@...driver.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/8] kgdb: core API and gdb protocol handler

On Feb 9, 2008 9:27 AM, Christoph Hellwig <hch@...radead.org> wrote:
> On Sat, Feb 09, 2008 at 07:35:07AM -0600, jason.wessel@...driver.com wrote:
> > +#ifdef __BIG_ENDIAN
> > +             *buf++ = hexchars[(tmp_s >> 12) & 0xf];
> > +             *buf++ = hexchars[(tmp_s >> 8) & 0xf];
> > +             *buf++ = hexchars[(tmp_s >> 4) & 0xf];
> > +             *buf++ = hexchars[tmp_s & 0xf];
> > +#else
> > +             *buf++ = hexchars[(tmp_s >> 4) & 0xf];
> > +             *buf++ = hexchars[tmp_s & 0xf];
> > +             *buf++ = hexchars[(tmp_s >> 12) & 0xf];
> > +             *buf++ = hexchars[(tmp_s >> 8) & 0xf];
> > +#endif
>
> This is really ugly, but I don't really know a good way around it
> either.

void u32_to_hex(u32 val, unsigned char *buf)
{
         int i;

         for (i=7; i>=0; i--) {
                  buf[i] = hexchars[ val & 0x0f ];
                  val >>= 4;
         }
}

         u32_to_hex(tmp_s, buf);
         buf += 8;
--
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