diff options
| author | Rasmus Villemoes <[email protected]> | 2018-10-30 15:05:18 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2018-10-31 08:54:12 -0700 |
| commit | 8ec3d76863d8bb317f330bbe4bf35cded8d85f01 (patch) | |
| tree | cd12cbe92cf5b52b581b96c6380d465023f918f7 /tools/perf/scripts/python/compaction-times.py | |
| parent | ce1091d471107dbf6f91db66a480a25950c9b9ff (diff) | |
lib/bitmap.c: simplify bitmap_print_to_pagebuf()
len is guaranteed to lie in [1, PAGE_SIZE]. If scnprintf is called with a
buffer size of 1, it is guaranteed to return 0. So in the extremely
unlikely case of having just one byte remaining in the page, let's just
call scnprintf anyway. The only difference is that this will write a '\0'
to that final byte in the page, but that's an improvement: We now
guarantee that after the call, buf is a properly terminated C string of
length exactly the return value.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Rasmus Villemoes <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Cc: Yury Norov <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Sudeep Holla <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions