From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC59C4338F for ; Mon, 23 Aug 2021 02:14:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D0F96128A for ; Mon, 23 Aug 2021 02:14:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234850AbhHWCOx (ORCPT ); Sun, 22 Aug 2021 22:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234802AbhHWCOw (ORCPT ); Sun, 22 Aug 2021 22:14:52 -0400 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80A7C061575 for ; Sun, 22 Aug 2021 19:14:10 -0700 (PDT) Received: by mail-qv1-xf33.google.com with SMTP id eh1so8882465qvb.11 for ; Sun, 22 Aug 2021 19:14:10 -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:mime-version :content-transfer-encoding; bh=0c9W4KFzvkxaiLSuIZiuuGcjam2e7naE89uHIwtQELE=; b=mxa9y2T3jwlzAXL1NUtH+yeIKKyyjAPm/UA29J2QlNW4w/UC1hCCt3X+b57hTVMVeH iOGtBdIGeFOXJ9tgvnYQfFw4Iw2a0Ngq8MwMmk6EBKTRZHjlO0iBTwg0et8PKKMUG6HJ 7om7LG1oOtgOOqLTNyHBmmu7dRa9cnu9XskR4pYNAA/57zkkIn4UCM/y/VqWHzrWhKbs EYSVN68AK3oiOPiFHCQoKruQ8OEirw9v2AeWOdYShwj5ksNYkh9eJ+5WB7enN5upSzje 62KSQ0STMSTG6ocM7zuGGgDqiDhRpRtY9GX/EXW5tT879oP+qPq0kmTArb3G1bBMqmr3 yfJg== 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:mime-version :content-transfer-encoding; bh=0c9W4KFzvkxaiLSuIZiuuGcjam2e7naE89uHIwtQELE=; b=EYecIogFVpgaWEMgYWl8CDc67tfxIagQmIJXlxIZQ+RgjHsLB3gnObdOIQ0bKblCR5 D2qYksLZ1Zgaldvp5pR8gaY0VnhWFjgPMgHJke2/HGwD0iJo6MlUOUDf8C01mrQL6rNm y2Vf/zzTHynFaZOpqFcs4ylqgf73K+pFmSmQ+CHW/7Y6v85zNOBM1S31pfp4mZ6FMl99 rFrODb4XaP49+bna1Oe0sXKuhfcdSSR/XJ5n9XVS5//tlVpFs0OyRmyjkRHPhddMUrsh 5lAkToZcfnmq1dlJgTYWqNfKhveM72c9xVSYBTw3v8SqkhKYepZYZn5X5b5F1KLwgWNb GEIw== X-Gm-Message-State: AOAM533pdxym7dU6PhFICFEm/ZzvqoAl5c58dtc/0pgDifXSAZmhkXfs i7vNpBcyCOiRD4GICr98H40= X-Google-Smtp-Source: ABdhPJznK5ysUfTJ15bQvLes/OQoG9at49ANSShnH6MsgWQpw086j7Vgeh3Q62J5hKzvn2kcT0VbGQ== X-Received: by 2002:a0c:e885:: with SMTP id b5mr31250706qvo.48.1629684850072; Sun, 22 Aug 2021 19:14:10 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id q184sm7802318qkd.35.2021.08.22.19.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Aug 2021 19:14:09 -0700 (PDT) From: CGEL X-Google-Original-From: CGEL To: Boris Ostrovsky Cc: Juergen Gross , Stefano Stabellini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Jing Yangyang , Zeal Robot Subject: [PATCH linux-next] arch/x86/xen/time.c: fix bugon.cocci warnings Date: Sun, 22 Aug 2021 19:13:53 -0700 Message-Id: <20210823021353.44391-1-jing.yangyang@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jing Yangyang Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Reported-by: Zeal Robot Signed-off-by: Jing Yangyang --- arch/x86/xen/time.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index d9c945e..6e29b69 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -210,8 +210,7 @@ static int xen_timerop_set_next_event(unsigned long delta, { WARN_ON(!clockevent_state_oneshot(evt)); - if (HYPERVISOR_set_timer_op(get_abs_timeout(delta)) < 0) - BUG(); + BUG_ON(HYPERVISOR_set_timer_op(get_abs_timeout(delta)) < 0); /* We may have missed the deadline, but there's no real way of knowing for sure. If the event was in the past, then we'll @@ -241,11 +240,10 @@ static int xen_vcpuop_shutdown(struct clock_event_device *evt) { int cpu = smp_processor_id(); - if (HYPERVISOR_vcpu_op(VCPUOP_stop_singleshot_timer, xen_vcpu_nr(cpu), + BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_stop_singleshot_timer, xen_vcpu_nr(cpu), NULL) || - HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, xen_vcpu_nr(cpu), - NULL)) - BUG(); + HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, xen_vcpu_nr(cpu), + NULL)); return 0; } @@ -254,9 +252,8 @@ static int xen_vcpuop_set_oneshot(struct clock_event_device *evt) { int cpu = smp_processor_id(); - if (HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, xen_vcpu_nr(cpu), - NULL)) - BUG(); + BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, xen_vcpu_nr(cpu), + NULL)); return 0; } @@ -373,9 +370,8 @@ void xen_timer_resume(void) return; for_each_online_cpu(cpu) { - if (HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, - xen_vcpu_nr(cpu), NULL)) - BUG(); + BUG_ON(HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, + xen_vcpu_nr(cpu), NULL)); } } -- 1.8.3.1