Re: seperator error in __mask_snprintf_len

From: Paul Jackson
Date: Thu Jan 08 2004 - 05:38:56 EST


Joe noted:
> Paul, there might be a problem with __mask_snprintf_len. Won't a
> value that should be displayed as:
>
> d,00abcdef be displayed as
> d,abcdef

You are correct that it will be displayed without zero padding.

But I don't think that's a problem; rather working as designed.

An example that suggests the motivation for this design choice is given
in the examples in the mask.c comment:

* A mask with just bit 127 set displays as "80000000,0,0,0".

With zero padding, this example gets longer. For masks of 500 or a 1000
bits encoding a single high set bit, it's worse, resulting in several
text lines of ",00000000" words.

If you have reason to claim that it would be better to zero fill
these words, go ahead and make your case.

There are hundreds of possible ways of formatting the ascii
representation of bit masks; I picked one that I liked. If good reasons
or a concensus develop for some other format, that's fine.
Better to change now than later.

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