lkml.org 
[lkml]   [2010]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/5] fs: fat: use hex_asc_lo/hex_asc_hi instead of custom one
From
Date
On Thu, 2010-03-11 at 09:59 +0200, Andy Shevchenko wrote:
> On Thu, Mar 11, 2010 at 9:21 AM, Joe Perches <joe@perches.com> wrote:
> >> > + *op++ = hex_asc_hi(ec >> 8);
> >> > + *op++ = hex_asc_lo(ec >> 8);
> >> > + *op++ = hex_asc_hi(ec);
> >> > + *op++ = hex_asc_lo(ec);
> >> Why doesn't this use pack_hex_byte()?
> > or snprintf
> sprintf looks like overkill here.

It's shorter and more intelligible though

op += sprintf(op, ":%04x:%04x", etc)

cheers, Joe




\
 
 \ /
  Last update: 2010-03-11 09:13    [W:0.035 / U:30.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site