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=-9.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 E02A9C433DF for ; Mon, 12 Oct 2020 21:56:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86C242072D for ; Mon, 12 Oct 2020 21:56:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730870AbgJLV4y (ORCPT ); Mon, 12 Oct 2020 17:56:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:50428 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbgJLV4y (ORCPT ); Mon, 12 Oct 2020 17:56:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B5F46AE93; Mon, 12 Oct 2020 21:56:52 +0000 (UTC) Date: Mon, 12 Oct 2020 23:56:42 +0200 From: Borislav Petkov To: Linus Torvalds Cc: Mike Travis , x86-ml , lkml Subject: Re: [GIT PULL] x86/platform updates for v5.10 Message-ID: <20201012215642.GN25311@zn.tnic> References: <20201012101012.GD25311@zn.tnic> <20201012212709.GM25311@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 12, 2020 at 02:46:10PM -0700, Linus Torvalds wrote: > At least "git grep" only shows two assignments to it. > > Of course, that would miss any cases that play games with preprocessor > token pasting etc, so it's not entirely meaningful, but it's certainly > a hint.. >From a quick staring at gcc asm, it looks write only. And gcc didn't warn because it optimized that assignment away completely AFAICT. > And yes, I expect that the fix is to just make it "unsigned long", but > if it truly isn't actually used, maybe removal is better. Yeah, below is a proper patch which builds fine with gcc and clang-10. You guys have fun - I'm going to bed. :-) --- From: Mike Travis Date: Mon, 12 Oct 2020 23:46:34 +0200 Subject: [PATCH] x86/platform/uv: Correct uvh_nmi_mmrx_mask's type Clang rightfully warns: arch/x86/platform/uv/uv_nmi.c:250:23: warning: implicit conversion from 'unsigned long' to 'int' changes value from 1152921504606846976 to 0 [-Wconstant-conversion] uvh_nmi_mmrx_mask = UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Make the variable unsigned long. [ bp: Productize it. ] Signed-off-by: Mike Travis Signed-off-by: Borislav Petkov --- arch/x86/platform/uv/uv_nmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c index 0f5cbcf0da63..8566730f154d 100644 --- a/arch/x86/platform/uv/uv_nmi.c +++ b/arch/x86/platform/uv/uv_nmi.c @@ -59,7 +59,7 @@ DEFINE_PER_CPU(struct uv_cpu_nmi_s, uv_cpu_nmi); static unsigned long uvh_nmi_mmrx; /* UVH_EVENT_OCCURRED0/1 */ static unsigned long uvh_nmi_mmrx_clear; /* UVH_EVENT_OCCURRED0/1_ALIAS */ static int uvh_nmi_mmrx_shift; /* UVH_EVENT_OCCURRED0/1_EXTIO_INT0_SHFT */ -static int uvh_nmi_mmrx_mask; /* UVH_EVENT_OCCURRED0/1_EXTIO_INT0_MASK */ +static unsigned long uvh_nmi_mmrx_mask; /* UVH_EVENT_OCCURRED0/1_EXTIO_INT0_MASK */ static char *uvh_nmi_mmrx_type; /* "EXTIO_INT0" */ /* Non-zero indicates newer SMM NMI handler present */ -- 2.21.0 -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg