diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2012-05-29 18:07:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:32 -0400 |
commit | 05a6c8a9226599f921bd0b6e439dbc04df96a6fc (patch) | |
tree | 9d95bd7811837139f600a7aa5044e12bf26f6d39 /lib | |
parent | 68aecfb97978fe6730615f92f53c11149e929052 (diff) |
lib/bitmap.c: fix documentation for scnprintf() functions
The code comments for bscnl_emit() and bitmap_scnlistprintf() are
describing snprintf() return semantics, but these functions use
scnprintf() return semantics. Fix that, and document the
bitmap_scnprintf() return value as well.
Cc: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bitmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index b5a8b6ad2454..06fdfa1aeba7 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c | |||
@@ -369,7 +369,8 @@ EXPORT_SYMBOL(bitmap_find_next_zero_area); | |||
369 | * @nmaskbits: size of bitmap, in bits | 369 | * @nmaskbits: size of bitmap, in bits |
370 | * | 370 | * |
371 | * Exactly @nmaskbits bits are displayed. Hex digits are grouped into | 371 | * Exactly @nmaskbits bits are displayed. Hex digits are grouped into |
372 | * comma-separated sets of eight digits per set. | 372 | * comma-separated sets of eight digits per set. Returns the number of |
373 | * characters which were written to *buf, excluding the trailing \0. | ||
373 | */ | 374 | */ |
374 | int bitmap_scnprintf(char *buf, unsigned int buflen, | 375 | int bitmap_scnprintf(char *buf, unsigned int buflen, |
375 | const unsigned long *maskp, int nmaskbits) | 376 | const unsigned long *maskp, int nmaskbits) |
@@ -517,8 +518,8 @@ EXPORT_SYMBOL(bitmap_parse_user); | |||
517 | * | 518 | * |
518 | * Helper routine for bitmap_scnlistprintf(). Write decimal number | 519 | * Helper routine for bitmap_scnlistprintf(). Write decimal number |
519 | * or range to buf, suppressing output past buf+buflen, with optional | 520 | * or range to buf, suppressing output past buf+buflen, with optional |
520 | * comma-prefix. Return len of what would be written to buf, if it | 521 | * comma-prefix. Return len of what was written to *buf, excluding the |
521 | * all fit. | 522 | * trailing \0. |
522 | */ | 523 | */ |
523 | static inline int bscnl_emit(char *buf, int buflen, int rbot, int rtop, int len) | 524 | static inline int bscnl_emit(char *buf, int buflen, int rbot, int rtop, int len) |
524 | { | 525 | { |
@@ -544,9 +545,8 @@ static inline int bscnl_emit(char *buf, int buflen, int rbot, int rtop, int len) | |||
544 | * the range. Output format is compatible with the format | 545 | * the range. Output format is compatible with the format |
545 | * accepted as input by bitmap_parselist(). | 546 | * accepted as input by bitmap_parselist(). |
546 | * | 547 | * |
547 | * The return value is the number of characters which would be | 548 | * The return value is the number of characters which were written to *buf |
548 | * generated for the given input, excluding the trailing '\0', as | 549 | * excluding the trailing '\0', as per ISO C99's scnprintf. |
549 | * per ISO C99. | ||
550 | */ | 550 | */ |
551 | int bitmap_scnlistprintf(char *buf, unsigned int buflen, | 551 | int bitmap_scnlistprintf(char *buf, unsigned int buflen, |
552 | const unsigned long *maskp, int nmaskbits) | 552 | const unsigned long *maskp, int nmaskbits) |