From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66D2FC433E1 for ; Thu, 28 May 2020 11:57:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48F2C215A4 for ; Thu, 28 May 2020 11:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590667069; bh=ASIx1f7M2i1M5BhfB5V08l+8rsFnCdCEoy/P7rov25k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=f7wkr4UdCdmROQr+3dF49w+S/W0ijIoIp9P4ge+eyI6pmn06ncEczy9sM7gI1A8Bb WLSn854hMxaYOhfX28MK20lTficoLTi/TolyICTjPCn6ba/EN2IJNbcmk5/Q2VPWLM mHk9/QrT6K2iatlV3LdX8o2RgGwbdODJ0rchK99I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389091AbgE1L5r (ORCPT ); Thu, 28 May 2020 07:57:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:49470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388918AbgE1L5E (ORCPT ); Thu, 28 May 2020 07:57:04 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4501E21475; Thu, 28 May 2020 11:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590667024; bh=ASIx1f7M2i1M5BhfB5V08l+8rsFnCdCEoy/P7rov25k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WTPtpQjTWYfNadTEDdow/fzGiDONo1kS4Hgm6doWzq7IpCCahtK/rkK1MQ+p3rll0 q33s8Lbbp0zrlNIndDqSupPrHJ+cTQUf61bWXgt0Vq+iIgXXCULiwQyRexR5nw5KtI lGkVQyT79SFWm1Gr6F60JN99TvdNtWc3217nUXpg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Sedat Dilek , Borislav Petkov , Nick Desaulniers , Steven Rostedt , Sasha Levin Subject: [PATCH AUTOSEL 5.4 08/26] x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables Date: Thu, 28 May 2020 07:56:36 -0400 Message-Id: <20200528115654.1406165-8-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200528115654.1406165-1-sashal@kernel.org> References: <20200528115654.1406165-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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