Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2103039imm; Fri, 7 Sep 2018 10:50:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYeVMsJN0Kc499HNGYu6ijZviUhlALVx+DOZa+jxLM+yDz6RRjtZhwe5QVxyI+93MuPsHU4 X-Received: by 2002:a62:2459:: with SMTP id r86-v6mr9827885pfj.31.1536342603295; Fri, 07 Sep 2018 10:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536342603; cv=none; d=google.com; s=arc-20160816; b=Bf1pQumTDAFfAYmShHHzL8vuYkDXjfXvs7CbXQ2ImXV5w/1Xk97qO1P6HrlwjbuZ93 S0Aoj2d9B/8mVpfUMxdDnLjRtk6bWBisLYsxLANZjWrVv2rF+0l+ITBrxMpNNQTAacDs VekwGE7t44ZNE8VnZAcZsHeyHtWAhvitMu9vBi2bEHzCJe+90PMyoIsUZotyyPaajmXP U858q7W9yCFlro/AK7a3UYbOGJg8YSDEvSkWBxejBCBhx1zWOkhIOF28C+5WadOPQhgM hrOz9nwOBOF8K9Q1KFQvzrmTE6OA1PV6DWZl2Ou0CUJR6otqol+Oha2ASIcZktPodYmY NnGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=qM43LjXiLjSbUJAJgeRwrTixwsuyvPKwSICeRdq7uNY=; b=JdkzVC3Gt6MqNthGM+xj4dKGpbz6diLqKAUv4/IPhkk5LXyxtSch54szmCSOsqnjRv zysJT5V7+x0fk9pjULV1UqbdB+0g1xWxbhA0pjTQOBBhAU1Ij8MU5Fw0sDaezKPUus0L h/FI05CYUsQLyHIOJrn4tU+NZE1TAhFsgdsPEwPC5CVA3waFOTAzdvP/YO/p/ND2p90y 2IqnhORbrSEu++CrGMlpljfh+No24rvwh9KK84IfKD+ezpo1wnmkr4sDEW+UbtAVcucB wncX0W1VoKI63TbirVf4ss0UD/DH7ckIbxnueDfPdCTSBXH6UPAGpet4NjzYBPh4SEwg 7VOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZvWdV7zG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q145-v6si9249115pfq.315.2018.09.07.10.49.47; Fri, 07 Sep 2018 10:50:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZvWdV7zG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727607AbeIGWaP (ORCPT + 99 others); Fri, 7 Sep 2018 18:30:15 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38720 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726356AbeIGWaP (ORCPT ); Fri, 7 Sep 2018 18:30:15 -0400 Received: by mail-lj1-f195.google.com with SMTP id p6-v6so12957324ljc.5 for ; Fri, 07 Sep 2018 10:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qM43LjXiLjSbUJAJgeRwrTixwsuyvPKwSICeRdq7uNY=; b=ZvWdV7zGjmfeG5v7DQcXbWgOALkUzB7iXaN9ap4QNEXoSirURz+XV/bcIMVaFYH5lm t0+38BIVe3S5PqYaPzHVL6cgPuJPI7AGUfaml98riBVHnf0FPFnWis8ufLBBsFnyVZZZ VdycG4nahFlFxn6hZlwoXTFwoN5V1FqbU78lxabLQg64CDPsoU2WWG/IfwUQ4kgLrM+1 HS0Gp4mRiUSUT0LsO0viWZ7o2lV3J6ycsJlhUFsfbrRWhXXZw+OFHDmkG38+fdLGTdNC 3xM/TfNHj/HE30v2a/UhuoPLjYwq0b05e1iDz/lKS0EFzRf5b8r0n2QKI4UxADq+g5fP CJQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qM43LjXiLjSbUJAJgeRwrTixwsuyvPKwSICeRdq7uNY=; b=AesIMv95lN+1GWfdEPJmUaF+ee0o+ojkeyVKolcSntB3D4MGVXF+49uQ5RkRHQgiyI LpGnfn8TnkutxrxN+kydx0JNYPN62Hit3kUJwQYbhzc5O0H5Wd9tELmAF/2lzpz0S0/L WF6a6XEMvuupr46TK5T2HobI6ZwcwKhs3qMaNryZKkY41B0y5AEIL0T/H3Lb5LH9JN8X BWZ73KyZ/8kybJk45sBhWAmSc+5j+RErqd04BGRly7iVCDrw7PbOo/gqh4kqxr24cJ9j bOYRMH2PUrJc8UTXn4moa+z4uVGkolmt+j+ppCMJ0T2Y63IM5c+9Xem30/zbY3XA7c2E 4fcg== X-Gm-Message-State: APzg51AWd1KagneY5votvkyEfQ/IuDezSUTGP7KMA1JyZY4d2yvyYcMt 6udnYyj4MyJae/jibCjSogY= X-Received: by 2002:a2e:750d:: with SMTP id q13-v6mr5437493ljc.148.1536342492583; Fri, 07 Sep 2018 10:48:12 -0700 (PDT) Received: from Mort.jumbo.freeair (91-156-179-220.elisa-laajakaista.fi. [91.156.179.220]) by smtp.gmail.com with ESMTPSA id j135-v6sm1384100lfj.91.2018.09.07.10.48.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 10:48:11 -0700 (PDT) From: Igor Stoppa X-Google-Original-From: Igor Stoppa To: "Michael S . Tsirkin" Cc: igor.stoppa@gmail.com, Igor Stoppa , Jason Wang , Virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] virtio: add unlikely() to WARN_ON_ONCE() Date: Fri, 7 Sep 2018 20:48:02 +0300 Message-Id: <20180907174802.31900-1-igor.stoppa@huawei.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The condition to test is unlikely() to be true. Add the hint. Signed-off-by: Igor Stoppa Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Virtualization@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org --- tools/virtio/linux/kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index fb22bccfbc8a..2b5e417ea2f0 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -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); \ -- 2.17.1