virtio: add unlikely() to WARN_ON_ONCE()
PATCH 1/1 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]>
--- tools/virtio/linux/kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/virtio/linux/kernel.h +1 -1
@@ -123,7 +123,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); \
Signature · 1 line
2.17.1