Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2495737pxb; Sun, 28 Feb 2021 03:14:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6pPeo1iMwQrmwmvytLJRpGyz+s979A9da5aOpK/cs5BIWC15uHmhgOFYkwd0mU1PsfQC6 X-Received: by 2002:a17:906:30da:: with SMTP id b26mr11160026ejb.376.1614510865090; Sun, 28 Feb 2021 03:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614510865; cv=none; d=google.com; s=arc-20160816; b=FGOywc8/CLoLTN+e/avsRVpNBIyItQIK4qOWqUyuAvn1cpHiDiVgbzn5uJGVHDH7jj L5KYYCCjE/2FJZKNV5X+3I8SenAnCoc6stUX1Ukq0Se7F9A1MzUJcHTLnUAbKFFs/vrB 1Nhush54PV/cJi0CHMpQlr/lPkFmtKvzkyI+Et2t4UrqrujEqQX3xhRUBoGk0Ca6cb/G WzE35jp3VflXS52ByK608QGBfZfGaX1qliW8lExWnJDbof22DQ1ds2XYS0yMb7E6iPq8 Bvc5lGnvIwG7+7CONIp4h7t30VFjaLw4YRHrthW8cyQfL/p7z6n0pRcu3+wcFwxIKv0o J7Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:subject:cc:to :from:date; bh=rwFnFFIGaCAGtNKlCahqfwfUZwCjxoaHGQL7C4U7JR4=; b=tuAOqOzXfBkKoT8CDNGBmmsgihuawvfKdZrdOFVkZp3Ys8O7w2hOkEkXsphDCnna4D r3lHf6/A5P6im1/mepAG1oM7VcUqnYO2qdVHNPf0aXkEsLtnQIXPp2b3rWjcISNBoCux poZaGfpX7F6AURcWPzfjvs6uz/4YY2dVHY3a5khrwTepmZECiq/+CW8o73wSyPgULaMS QJLguVm/xZEoALKtm9y9xvCKnoVWfQo1eBPJNvjC2L55vYzYpFKgln25Rj1dRh7QDUWa zbSaPENORi3zXKcUNbJpVpvMPii6YGT28KkXjjy9m5ipv/OoNyeBKNZpTIuZKsvDd2KE ideg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si9338581ejy.390.2021.02.28.03.14.02; Sun, 28 Feb 2021 03:14:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230393AbhB1LLH (ORCPT + 99 others); Sun, 28 Feb 2021 06:11:07 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:57365 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbhB1LLH (ORCPT ); Sun, 28 Feb 2021 06:11:07 -0500 X-IronPort-AV: E=Sophos;i="5.81,213,1610406000"; d="scan'208";a="374314442" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2021 12:10:22 +0100 Date: Sun, 28 Feb 2021 12:10:22 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Guo Ren , Palmer Dabbelt , =?ISO-8859-15?Q?Patrick_St=E4hlin?= , Pekka Enberg cc: linux-kernel@vger.kernel.org, kbuild-all@lists.01.org Subject: [PATCH] riscv: fix bugon.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: kernel test robot Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Fixes: c22b0bcb1dd0 ("riscv: Add kprobes supported") CC: Guo Ren Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5695e51619745d4fe3ec2506a2f0cd982c5e27a4 commit: c22b0bcb1dd024cb9caad9230e3a387d8b061df5 riscv: Add kprobes supported :::::: branch date: 3 hours ago :::::: commit date: 6 weeks ago kprobes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/arch/riscv/kernel/probes/kprobes.c +++ b/arch/riscv/kernel/probes/kprobes.c @@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struc * normal page fault. */ regs->epc = (unsigned long) cur->addr; - if (!instruction_pointer(regs)) - BUG(); + BUG_ON(!instruction_pointer(regs)); if (kcb->kprobe_status == KPROBE_REENTER) restore_previous_kprobe(kcb);