Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp15110pxf; Tue, 16 Mar 2021 20:32:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx5Kx/Y3QyFWQDKH+P1FfNAPi31GwZDvL6NdhaYiA3wDI3/IkzDrydf3V0nm82oAeW8p0G X-Received: by 2002:aa7:ca04:: with SMTP id y4mr39320965eds.339.1615951954480; Tue, 16 Mar 2021 20:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615951954; cv=none; d=google.com; s=arc-20160816; b=YMiPNpMs+bfIrrqT0L6b1dLcUTzndw3ognJbRuf6bW+tk8Ip2/2kxBAPNZBuJjDmRT imvEryttpmfhTiEHxpb3Vd5yyyAXJkCa2mYK+nPJanhZo9TD9obmSC0X16ru2TkcXp7V p72wti6rkarEGCmXTb5BMCkjPEQeKOZM9BHALCyBS1zcb1wWENyluhBQ/rt+VS//oon/ Fw7SQ1TO0z6U+6kjMhxdwQz/6+QmKlfjZiI5pIBCHxaF+OXWPeHbhJZbCHdCFLqVXljn Y9/H6HMZj/uxeS9u2rWCafeTQxNZ0z/1wODxqm85V8egbpJiU8YHBppHkPD3slw1eS+v nAUA== 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=sovvMa6nXh5j6Pw4xSjIfzlhe4fwLeet+dqru+IRk9A=; b=V/kgFMcwREQNa1g+n5Gf7AR9WrjibZX37Ruze48fIWiD/AkfqQhdMUZ6LCBsk4TRt4 0hcfFwSj+O4BgHgkz5az8wfzLs/bId2coBCIRTU2Q7SyqXwXM6Ca1yGeZmFU9beTAPnA if6Ec4u2uatCaKdWx19yUEb0BXsbuRm+K5/93sFApw1dbbcFp/xY+mEzinrod1CE8jEs r9Q/I4OmF9uX8Sr949Hv/DbnoCryeTKHA54IRTN6w6dVG4FJkJJIZ2P/Rg6+cfDVYAoN Wo9lYgmJicgQPVDSdV2TAFsAI6f+srvSqdU/bv0taeVdfetaVTMEyd3heIJTX8v2HMzn SyNg== 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 m12si14893173eje.309.2021.03.16.20.32.10; Tue, 16 Mar 2021 20:32:34 -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 S229708AbhCQD3N (ORCPT + 99 others); Tue, 16 Mar 2021 23:29:13 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:39254 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229683AbhCQD3G (ORCPT ); Tue, 16 Mar 2021 23:29:06 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0USCjcys_1615951738; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0USCjcys_1615951738) by smtp.aliyun-inc.com(127.0.0.1); Wed, 17 Mar 2021 11:29:04 +0800 From: Jiapeng Chong To: mingo@redhat.com Cc: peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH v2] sched: replace if (cond) BUG() with BUG_ON() Date: Wed, 17 Mar 2021 11:28:56 +0800 Message-Id: <1615951736-125374-1-git-send-email-jiapeng.chong@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 coccicheck warnings: ./kernel/sched/core.c:8039:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- Changes in v2: - Replace BUG with BUG_ON. kernel/sched/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9819121..052f290 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8035,8 +8035,7 @@ void __init sched_init_smp(void) mutex_unlock(&sched_domains_mutex); /* Move init over to a non-isolated CPU */ - if (set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_FLAG_DOMAIN)) < 0) - BUG(); + BUG_ON(set_cpus_allowed_ptr(current, housekeeping_cpumask(HK_FLAG_DOMAIN)) < 0); sched_init_granularity(); init_sched_rt_class(); -- 1.8.3.1