Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2176508ybg; Fri, 5 Jun 2020 07:28:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+qzPOvJLKIVZ5T8nta6n+d9fzUZRtQL84y372X1gqu4zSWsZIthjsN45hGepPET6/Sz5t X-Received: by 2002:a05:6402:36d:: with SMTP id s13mr9661605edw.192.1591367308574; Fri, 05 Jun 2020 07:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591367308; cv=none; d=google.com; s=arc-20160816; b=g2+x+0DkxvE2pgRdbnpxjyBPqASN8Jf+R2LQgF5oAtMhgLS7jl074D0iUgMd230+oe Xcfg+C2RpJZpKyIuXBHLEo8ieLq6pG0DqPFRIrJqfaOarXUAAX8RDB2xbfCDzkN/Jhgb usJSajCsrWGWVOFTslr7OEMekZjk8h1glTXXm3AGx9kqJ0RJenbs2WBdUXRRMhXLfpa2 TuRFTEEs81lnkYHmFYZMg7w+NNnIw6u6YH2jc8e/qDiEKwwGa7qoQUtKBMCQS1BqqvKs P/qccuDYc6Cj7095kreBhSX8ZUoCBuQlbeN6OV46jnson8/dlTLxpQlVxaDthBehooVb KCdQ== 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=RhXJikWHKawtOWaycT5jZRHycjxe7I9TpPzqtpNeqrE=; b=NcBAreSFsLPIahaxBxKfVkKc0+2D4noVCeITKEG2FbQknDuLy6/YlvE2/ipyD+Nor9 vLo2apgwhvLrEqXeh255j26vShRYGT25GgbSzhn0yF50IdU+WtJ4DiwJEr2E+Ez//6WL v+jY0LssZt9eIc8CGi2m7fvMTbvGqKQ+gpngDIQl5R5d4Rjd93epDQruc0n+iW4oZ5pX Llb7wEoJUG/OVdKnfArjx6DXME+27xL7MJgdFydR8rY+ZBYMl1c2+FWnn986MwmlJ9/M +UfhQJch5V87AKzWLduAlNDi0IWDzXRBZqNeJUCMvbrxbUOeCMiKTJ11M4g/7/9UFcVF 2jDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=InWOadnL; 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 o18si3715918edv.545.2020.06.05.07.28.05; Fri, 05 Jun 2020 07:28:28 -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=InWOadnL; 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 S1728739AbgFEOZh (ORCPT + 99 others); Fri, 5 Jun 2020 10:25:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:45722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728256AbgFEOQe (ORCPT ); Fri, 5 Jun 2020 10:16:34 -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 AE8002086A; Fri, 5 Jun 2020 14:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591366594; bh=hlKiCg2RNDT/gKW+Zea75Lq46LZTVe35HoTVcsPU+Gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InWOadnLoWEBMsCFHRTsDu1ZkhPqxpGm8wyS5IVovqhJ5/5JhGkDjfbAs+58CySV0 e8Y62F27QgIdmOQw2ptLl0YwxExK8v5FUdYiJj7qOk84MEAw30kH980mnKz+m0qIHm 8Hvz1nKuR02DnLYjAUPl33MTcH1zs6+qF/r7++4w= 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.6 16/43] x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables Date: Fri, 5 Jun 2020 16:14:46 +0200 Message-Id: <20200605140153.373869549@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200605140152.493743366@linuxfoundation.org> References: <20200605140152.493743366@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 673de6063345..92530af38b09 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