lkml.org 
[lkml]   [2008]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/10] x86: reduce memory and stack usage in intel_cacheinfo
Mike Travis wrote:
> Hmm, I hadn't thought of that. There is commonly a format spec called
> %b for diags, etc. to print bit strings. Maybe something like:
>
> "... %*b ...", nr_cpu_ids, ptr_to_bitmap
>
> where the length arg is rounded up to 32 or 64 bits...?
>

I think that would need to be %.*b, but I always need to try it both
ways anyway...

But yes, that seems like the right way to go.

>> Eh? What's the difference between snprintf and scnprintf?
>>
>
> Good question... I'll have to ask the cpumask person. ;-)
>

It's in generic lib/vsprintf.c. The two functions are pretty much
identical... Oh, I see; snprintf returns the total output size,
regardless of whether it fits into the provided buffer, but scnprintf
returns the actual output size, clipped by the buffer length.

J


\
 
 \ /
  Last update: 2008-03-26 18:01    [W:0.151 / U:0.472 seconds]
©2003-2014 Jasper Spaans. Advertise on this site