Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3141725pxb; Mon, 9 Nov 2020 03:52:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOyF5Aj6GFPUtns7ZS/ThRrY1aKopobWcz0k9uJsbfv/ETolFTBvTtWwWfHAFuQBT+H26u X-Received: by 2002:a50:d315:: with SMTP id g21mr9016523edh.84.1604922736398; Mon, 09 Nov 2020 03:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604922736; cv=none; d=google.com; s=arc-20160816; b=tOb+KlXVgxLuiDLVoShMjtAigeHF3BAMiSO20Dkrvu6DjLil2EV5s7ciyBJ+OiTuWf gqMsSV7ITEmsvMw/14gy9fR+eFCBe6Xbeygo/u+t+QZk31RcBFiy/Bz9Af0DKQj1WFgk AbZyfBofvicfXEFS3hKG3cL180bKkCn3JoHKW8IYMsBD8+Amx9HdCO2A5GHBrsAHNPc6 QdBkoEocC31r7k/EXeDXHAB/7QGqMvdW8gF/XWE3LnYRXnNbWotCnWPpVtphnuuLgo/1 krAdvBBFWC5WGo8QP+OWQhyC0Lnmb19oYgHOjHf96cTEadmJ+4w8mGCOT50P1+hiflZi 4jjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=whbeokp6c5k70y86ClCR2oFChbUYlloWG58b3ei4/eQ=; b=DJz+q8+VOj8QEhyVgy3/kkmXT1BKLYGZMFf+rJU3B6w9k1TaXwta7IB6TOHd/wKCmK XzVOzL+3D0hAkfzP2WNZ3WagDTgpqvPYpqvVUGyqWKwcoY+EvUKTjO9RX0J8qFkkJ/0/ YJxZz0OtyCv5rqQLxC5dqx7Erk8XmZBqQbREkfOtOi3bax1QnBHhuhb53k70XrnIeYB6 BEq/nm+tX+5W94lbQvaZMiR9Gvco3hEN0vi5hGCo0E3axVX9n3sqkyVgD6mnMh3p/25A DvzlEh+PygiWkIOVxJDLI2HuAiLs3qRG5Gu5uwKdlr0OEgyV7NwKdyH9b/nx74CoagJW DtLw== 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 d6si7027660edo.498.2020.11.09.03.51.53; Mon, 09 Nov 2020 03:52:16 -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 S1729629AbgKILs1 (ORCPT + 99 others); Mon, 9 Nov 2020 06:48:27 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:7619 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726410AbgKILsX (ORCPT ); Mon, 9 Nov 2020 06:48:23 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CV8Q22gCVzLwXq; Mon, 9 Nov 2020 19:48:10 +0800 (CST) Received: from linux-lmwb.huawei.com (10.175.103.112) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Mon, 9 Nov 2020 19:48:09 +0800 From: Zou Wei To: , , , , CC: , , , Zou Wei Subject: [PATCH -next] cpumask: use false and true for bool variables Date: Mon, 9 Nov 2020 19:59:50 +0800 Message-ID: <1604923190-70981-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix coccicheck warnings: ./lib/cpumask.c:342:6-13: WARNING: Comparison of 0/1 to bool variable ./lib/cpumask.c:351:33-40: WARNING: Comparison of 0/1 to bool variable ./lib/cpumask.c:406:3-11: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot Signed-off-by: Zou Wei --- lib/cpumask.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cpumask.c b/lib/cpumask.c index 34ecb30..74d0cf1 100644 --- a/lib/cpumask.c +++ b/lib/cpumask.c @@ -339,7 +339,7 @@ static int find_nearest_node(int *node_dist, bool *used) /* Choose the first unused node to compare */ for (i = 0; i < nr_node_ids; i++) { - if (used[i] == 0) { + if (used[i] == false) { min_dist = node_dist[i]; node_id = i; break; @@ -348,7 +348,7 @@ static int find_nearest_node(int *node_dist, bool *used) /* Compare and return the nearest node */ for (i = 0; i < nr_node_ids; i++) { - if (node_dist[i] < min_dist && used[i] == 0) { + if (node_dist[i] < min_dist && used[i] == false) { min_dist = node_dist[i]; node_id = i; } @@ -403,7 +403,7 @@ unsigned int cpumask_local_spread(unsigned int i, int node) flags); return cpu; } - used[id] = 1; + used[id] = true; } spin_unlock_irqrestore(&spread_lock, flags); -- 2.6.2