Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2176189ybg; Fri, 5 Jun 2020 07:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOjB4HuyJ4V+0nkuLAfBN5ezRDH/MCEZRH0zgxAhBzSCvLRnRB7alNk62Mm31ImHxuz3aW X-Received: by 2002:a17:906:c10f:: with SMTP id do15mr9353316ejc.249.1591367283240; Fri, 05 Jun 2020 07:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591367283; cv=none; d=google.com; s=arc-20160816; b=TygKVbYdDPEV63t+VDUT+wFiJTGJ53WQe2Sj15FMAiUTH2+cKxpAW5NCyDMTiOIFg0 gcmkyyaEk79Kh29cKEkBGHptY1pOQcKxKr3l8knbabuRyUMIJ6yk2wtqhmqU7IXu0V88 uQTzyO0Aa5JMqnEme5bUqRNT5S5bPQz5zsokLyHX9lGT5tkHBsI/bWTCOunChgUkNRp9 4S0qngYeinS0bO07cb+HLbaBG5tRXSa2AV/mkbkQMzggXGnvRQRO3ViY9ME7jerfhwXJ rxxK366Qf+dGldtxoWE3vc73X1FWFdIkrpxW2vkLWqyXIznuwGKdYKoTCxLmXq+hjWyo zvHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dybhy7mlaGiCvlrlMbm7ZkAoT3dJzsIM4q3JPbtKFfs=; b=HHFmwZvN2Kepm9jh2g7KH/goYVVMbeUpj869s8j1Qpa5XsXfpOAWgTk0zD3mCHmp5O XupB8V78L9VyZ69SCODlKdbxLy1DQ8BjDaqAYKJ/QMyTE4QWyvaHuaw2GAPCFuZu9mOK TtG4/iWiMT5fqBL2mIeR7Jy+JtC9MLe5JZ2TAr9TLcI3kTLV4IXNJp2xdyEDonvLishq w5Ghsf8hyYIZH7dCrQCR004k18EKzLjXkNiqamsOH+KWMfVICGv2tHvRQgqrjwKRybBo +dDBheYU0bxTQd8nSR7NPUScs3Cy/eDRPRGIIFZE/rD4Xuk9mRzmQWKXIMK5+yAsH6Pn ZZ6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cxGETOPV; 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 i8si3597504edj.519.2020.06.05.07.27.39; Fri, 05 Jun 2020 07:28:03 -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; dkim=pass header.i=@kernel.org header.s=default header.b=cxGETOPV; 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 S1728158AbgFEOWq (ORCPT + 99 others); Fri, 5 Jun 2020 10:22:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:49484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728748AbgFEOSv (ORCPT ); Fri, 5 Jun 2020 10:18:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 722C3208A7; Fri, 5 Jun 2020 14:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591366730; bh=ASIx1f7M2i1M5BhfB5V08l+8rsFnCdCEoy/P7rov25k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cxGETOPVHW5w1jmoJjGRaeeHRwJ3iiqPd1CcjxU9Lv3P9pmBb54DvcIu4EwF/jBox OQHZG8vb6m1rL85aWcmdOJQU7OXzhYL5ar5TKaLtABqHeNm+b8EjmryvbD7MnsBveB sndokBBIbazHOTBIPHwBROwTFkP1rqziHAhOJv9I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sedat Dilek , Nathan Chancellor , Borislav Petkov , Nick Desaulniers , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 5.4 30/38] x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables Date: Fri, 5 Jun 2020 16:15:13 +0200 Message-Id: <20200605140254.433457105@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200605140252.542768750@linuxfoundation.org> References: <20200605140252.542768750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit d7110a26e5905ec2fe3fc88bc6a538901accb72b ] When building with Clang + -Wtautological-compare and CONFIG_CPUMASK_OFFSTACK unset: arch/x86/mm/mmio-mod.c:375:6: warning: comparison of array 'downed_cpus' equal to a null pointer is always false [-Wtautological-pointer-compare] if (downed_cpus == NULL && ^~~~~~~~~~~ ~~~~ arch/x86/mm/mmio-mod.c:405:6: warning: comparison of array 'downed_cpus' equal to a null pointer is always false [-Wtautological-pointer-compare] if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0) ^~~~~~~~~~~ ~~~~ 2 warnings generated. Commit f7e30f01a9e2 ("cpumask: Add helper cpumask_available()") added cpumask_available() to fix warnings of this nature. Use that here so that clang does not warn regardless of CONFIG_CPUMASK_OFFSTACK's value. Reported-by: Sedat Dilek Signed-off-by: Nathan Chancellor Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Acked-by: Steven Rostedt (VMware) Link: https://github.com/ClangBuiltLinux/linux/issues/982 Link: https://lkml.kernel.org/r/20200408205323.44490-1-natechancellor@gmail.com Signed-off-by: Sasha Levin --- arch/x86/mm/mmio-mod.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index b8ef8557d4b3..2a36902d418c 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -372,7 +372,7 @@ static void enter_uniprocessor(void) int cpu; int err; - if (downed_cpus == NULL && + if (!cpumask_available(downed_cpus) && !alloc_cpumask_var(&downed_cpus, GFP_KERNEL)) { pr_notice("Failed to allocate mask\n"); goto out; @@ -402,7 +402,7 @@ static void leave_uniprocessor(void) int cpu; int err; - if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0) + if (!cpumask_available(downed_cpus) || cpumask_weight(downed_cpus) == 0) return; pr_notice("Re-enabling CPUs...\n"); for_each_cpu(cpu, downed_cpus) { -- 2.25.1