H. Peter Anvin a8659597bf [SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact
We would hang forever when passing a zero to string_get_size().
Furthermore, string_get_size() would produce decimals on a value small
enough to be exact.  Finally, a few formatting issues are inconsistent
with standard SI style guidelines.

- If the value is less than the divisor, skip the entire rounding
  step.  This prints out all small values including zero as integers,
  without decimals.
- Add a space between the value and the symbol for the unit,
  consistent with standard SI practice.
- Lower case k in kB since we are talking about powers of 10.
- Finally, change "int" to "unsigned int" in one place to shut up a
  gcc warning when compiling the code out-of-kernel for testing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-23 11:42:20 -05:00
..
2008-07-25 10:53:26 -07:00
2008-02-03 17:48:52 +02:00
2005-10-18 08:26:15 -07:00
2007-05-11 05:38:25 -04:00
2008-07-24 10:47:33 -07:00
2008-06-06 11:29:10 -07:00
2007-07-16 09:05:50 -07:00
2007-07-17 10:23:04 -07:00
2006-06-25 10:01:20 -07:00
2008-02-03 17:48:52 +02:00
2005-04-16 15:20:36 -07:00
2006-06-25 10:01:20 -07:00
2007-05-10 18:24:13 +02:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2008-04-29 08:11:16 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2008-05-14 19:11:14 -07:00
2007-10-19 11:53:41 -07:00
2006-06-20 20:24:58 -07:00
2008-07-26 12:00:07 -07:00
2006-10-06 08:53:40 -07:00
2008-07-26 12:00:07 -07:00
2008-01-24 20:40:05 -08:00
2008-07-26 12:00:07 -07:00
2007-10-19 11:53:41 -07:00
2005-04-16 15:20:36 -07:00
2008-07-30 16:29:19 -07:00
2008-01-30 13:33:00 +01:00
2008-07-26 12:00:10 -07:00
2007-10-17 08:42:52 -07:00
2008-09-19 10:20:41 +02:00
2008-07-26 12:00:10 -07:00
2008-07-22 19:24:31 +10:00