diff options
author | Alex Elder <elder@linaro.org> | 2014-08-07 01:08:59 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-07 03:01:24 +0200 |
commit | e97e1267e9faa6480898a1fc34c8e40d74d702f2 (patch) | |
tree | f60eafec77791616da6b12fc1ceb2c2039a11640 /include/Kbuild | |
parent | printk: allow increasing the ring buffer depending on the number of CPUs (diff) | |
download | linux-e97e1267e9faa6480898a1fc34c8e40d74d702f2.tar.xz linux-e97e1267e9faa6480898a1fc34c8e40d74d702f2.zip |
printk: tweak do_syslog() to match comments
In do_syslog() there's a path used by kmsg_poll() and kmsg_read() that
only needs to know whether there's any data available to read (and not
its size). These callers only check for non-zero return. As a
shortcut, do_syslog() returns the difference between what has been
logged and what has been "seen."
The comments say that the "count of records" should be returned but it's
not. Instead it returns (log_next_idx - syslog_idx), which is a
difference between buffer offsets--and the result could be negative.
The behavior is the same (it'll be zero or not in the same cases), but
the count of records is more meaningful and it matches what the comments
say. So change the code to return that.
Signed-off-by: Alex Elder <elder@linaro.org>
Cc: Petr Mladek <pmladek@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Joe Perches <joe@perches.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/Kbuild')
0 files changed, 0 insertions, 0 deletions