Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp5980383ybn; Sun, 29 Sep 2019 09:44:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwigt+QVPm5yFwHTneOURzYA6TdYSj1Fe2JC06Qzsu/WP7kIcAXCpqZa4AyqolBUJvTJufD X-Received: by 2002:a50:87ca:: with SMTP id 10mr15500853edz.77.1569775482565; Sun, 29 Sep 2019 09:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569775482; cv=none; d=google.com; s=arc-20160816; b=05nzr+L8m7iYXgj/lLVWt8odGTzvFsXuwo4q9aZ7f401b/G4f4zlFOJ06SuexG4fZ3 FZQRgY0h2xGeAA5n55lsnTh8dsgUBzVQvPumimxXNkYcjUMh9DOpN9ASJPzAehLBgRCg szJsaro+4I0KgL0T7p7ArqdpB033oclo4ocB6vzmg9RTeMzzaxqkbKzJycKgMI7U6TH6 +MZVsWSDfm9KoFfDakW5xcSSHInZrle8xQ6R07OHrSdVEP7xsfKh9RfBko7g1rhNXvxW NnGn9U1Fa53iIgw3v9I8UD3rX23bKa9fsTmAMCZEFDe65mz3mhJZ9BcCePJ+MvpvmX6E ktzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date; bh=YQd0x+U/HmGgZpKlRhjmUhdfdj39BOiWjo1NDNLSFSo=; b=drf3Du77/6S590TvVv4nC+dsY7H1LiShpoP49V5B0FHvzbfFYoAfgUKdnHKqpxhIVv cA0ZWpcqBUaii4jEKl/EAch86/LPaG7jIBvVuYvA3TMfyJt8LpkXhtJ4UPGBmk7VaUrS Tuul+fMNmG15B9qMe1feXE2J1OqWHD58PBo1rd0iZHLzX7wu0w8Q2C3ObHMIovaxUtGX 5cfGEDZPQPIyT1h4BbBqAaM5cNNQAAJ8z2hI/fkY5XTDLGV2VNMnAptF6xsbROu+byYC 2AXK5s2lihnlRrlVYZgZW73N6J2nEQ3/VLAR4N7hzFjqPl7xiYnDaMMrM5X61h4XhH7g h88w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22si5700096eja.115.2019.09.29.09.44.18; Sun, 29 Sep 2019 09:44:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729057AbfI2Qna (ORCPT + 99 others); Sun, 29 Sep 2019 12:43:30 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:39701 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbfI2Qna (ORCPT ); Sun, 29 Sep 2019 12:43:30 -0400 X-IronPort-AV: E=Sophos;i="5.64,563,1559512800"; d="scan'208";a="403855551" Received: from 81-65-53-202.rev.numericable.fr (HELO hadrien) ([81.65.53.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2019 18:43:28 +0200 Date: Sun, 29 Sep 2019 18:43:28 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Sean Christopherson cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, Paolo Bonzini , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov Subject: [PATCH] KVM: x86: fix bugon.cocci warnings Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kbuild test robot Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Fixes: 4b526de50e39 ("KVM: x86: Check kvm_rebooting in kvm_spurious_fault()") CC: Sean Christopherson Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 02dc96ef6c25f990452c114c59d75c368a1f4c8f commit: 4b526de50e39b38cd828396267379183c7c21354 KVM: x86: Check kvm_rebooting in kvm_spurious_fault() :::::: branch date: 9 hours ago :::::: commit date: 4 days ago Please take the patch only if it's a positive warning. Thanks! x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -360,8 +360,7 @@ EXPORT_SYMBOL_GPL(kvm_set_apic_base); asmlinkage __visible void kvm_spurious_fault(void) { /* Fault while not rebooting. We want the trace. */ - if (!kvm_rebooting) - BUG(); + BUG_ON(!kvm_rebooting); } EXPORT_SYMBOL_GPL(kvm_spurious_fault);