aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Stoppa <[email protected]>2018-09-07 20:48:02 +0300
committerMichael S. Tsirkin <[email protected]>2019-05-27 11:08:22 -0400
commit3d840e0636be64502f1d3da2e077dab390c04091 (patch)
treef22f174f2a645f496e2ab971453ddc750b10e5a4
parentcd6c84d8f0cdc911df435bb075ba22ce3c605b07 (diff)
virtio: add unlikely() to WARN_ON_ONCE()
The condition to test is unlikely() to be true. Add the hint. Signed-off-by: Igor Stoppa <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Jason Wang <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
-rw-r--r--tools/virtio/linux/kernel.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index 7ef45a4a3cba..6683b4a70b05 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -127,7 +127,7 @@ static inline void free_page(unsigned long addr)
#define dev_err(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
#define dev_warn(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
-#define WARN_ON_ONCE(cond) ((cond) ? fprintf (stderr, "WARNING\n") : 0)
+#define WARN_ON_ONCE(cond) (unlikely(cond) ? fprintf (stderr, "WARNING\n") : 0)
#define min(x, y) ({ \
typeof(x) _min1 = (x); \