lkml.org 
[lkml]   [2004]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: seperator error in __mask_snprintf_len
A couple of questions on your proposed patch for __mask_snprintf_len()
in lib/mask.c:

1) Why make the MASK_CHUNKSZ a possible (compile time) variable?
I can think of a couple good reasons why not to:
a] So long as we have the current format, in which each word
is _not_ zero filled, then the chunk size needs to be a
well known constant, or else the output is ambiguous.
For example, an output of "1,0" is ambiguous unless we know
a priori that the "0" stands for exactly 32, say, bits.
b] Even if we change to a zero filled format, better to just
always use the same chunk size, as that is one less detail
to confuse user level code.
I don't see any reason offhand for needing code that works with
more than one chunk size.
2) Why the trailing "buf[len++] = 0"? Won't the last snprintf do
as much?
3) This code has quite a bit more detail of bit shifts, masks and
arithmetic than before. Perhaps some is necessary to fix the
word order bug I had, perhaps some is only needed to allow for
the chunk size to vary. I'll take a shot at seeing if I can
find a less detail-rich expression of this that still gets the
word order correct.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.060 / U:1.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site