lkml.org 
[lkml]   [2015]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [git pull] vfs part 2
From
On Sun, Jun 21, 2015 at 2:12 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> + if (count > rsize) {
> + WARN_ON(1);
> + count = rsize;
> + }

So if we'd actually want to merge it with the warning, I'd prefer writing it as

if (WARN_ON_ONCE(count > rsize))
count = size;

because it's smaller and cannot spam your logs. WARN_ON_ONCE() will
only _warn_ once, but it always returns the conditional for the
warning, so the above does the right thing.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2015-06-21 23:21    [W:0.109 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site