Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp111925pxf; Wed, 17 Mar 2021 00:13:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztxtugAf5Ala1U/GaZgfdBJRBZR0OAD+NTfly65+HT9sjW21qgFGC137pxtGEwLQRgXkvD X-Received: by 2002:a17:907:971a:: with SMTP id jg26mr34556645ejc.317.1615965213289; Wed, 17 Mar 2021 00:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965213; cv=none; d=google.com; s=arc-20160816; b=dYDKdBh4Ha61iEc3wf6N8lwyYcK6eTtdkm0EEB179ffp0wwFnOdM72AxTE+PG7aTRj j9vplOHC1bYVJg20OE2OuuQnG91ioWq9NhXlQSiSuTGkkVvqllNEPxHZ0S1Uq7Mkearw KHLDk99QykEusdJiVN9AleoNlXzwnH04CZdSFmSBzn+BSpkXbsW+0fMir5Sqc+lM+keR 3P0bII0dtjXzQ14ehe9Ff00z4cyT/ICbXeSEjFxCSrYZfI+JXqKpRreokqvL3cKwvgM4 MYE2czX5i2Sz8xvSI/WcKOHZXEB448IMaDrByaAaEYQ6RXZhGQCNhaS3XHjUpBkWDTXW 2FEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=now+e0irE3+YuoHK0CNNRlfSYyxo6Doww+LlWTqCR+c=; b=RMiUPri7cxp/zUVChF5TCuNUNO/YADx8XBM3+2/dtBvazNe3UJjUBh7aZDUf6NGQDW jZD5iz9PmssMMklY7eomcmdI6wbmijsvnUVOZiSwZti9K8266ZlV1Ypik46HukmsB4z7 CZZuKq1f/Nc+rEpZjHZ+d880+nERD5JJ02oMk2q+7sSwMcfW3aGu9fPq2twgriXOEM13 cXUc5nhBrpBPrNqMuuqs6+E8e1rI4SaFZupUck6OZxWet76oxiKw7cqYmNC+wJoc3rB2 jcaocsqZIG6U5/oTteCiaTG2ErwGRe1YW9tYxCAAkAEqSpYSgmSfdPXpEhaWOdHQ8OK7 5g7g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si15700687edy.80.2021.03.17.00.13.11; Wed, 17 Mar 2021 00:13:33 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbhCQHLo (ORCPT + 99 others); Wed, 17 Mar 2021 03:11:44 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:40045 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhCQHLj (ORCPT ); Wed, 17 Mar 2021 03:11:39 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0USEIX7F_1615965097; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0USEIX7F_1615965097) by smtp.aliyun-inc.com(127.0.0.1); Wed, 17 Mar 2021 15:11:37 +0800 From: Yang Li To: jdike@addtoit.com Cc: richard@nod.at, anton.ivanov@cambridgegreys.com, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] um: replace if (cond) BUG() with BUG_ON() Date: Wed, 17 Mar 2021 15:11:36 +0800 Message-Id: <1615965096-122733-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccinelle reports: ./arch/um/kernel/mem.c:77:3-6: WARNING: Use BUG_ON instead of if condition followed by BUG. Reported-by: Abaci Robot Signed-off-by: Yang Li --- arch/um/kernel/mem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 9242dc9..22e28bf 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -73,8 +73,7 @@ static void __init one_page_table_init(pmd_t *pmd) set_pmd(pmd, __pmd(_KERNPG_TABLE + (unsigned long) __pa(pte))); - if (pte != pte_offset_kernel(pmd, 0)) - BUG(); + BUG_ON(pte != pte_offset_kernel(pmd, 0)); } } -- 1.8.3.1