linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Travis <mike.travis@hpe.com>, x86-ml <x86@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] x86/platform updates for v5.10
Date: Mon, 12 Oct 2020 23:56:42 +0200	[thread overview]
Message-ID: <20201012215642.GN25311@zn.tnic> (raw)
In-Reply-To: <CAHk-=wg6MBLPzRrRYGQ6EeoUGV+-MdMraFiUiiQyenVk=t6=Bw@mail.gmail.com>

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 <mike.travis@hpe.com>
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 <mike.travis@hpe.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 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

  reply	other threads:[~2020-10-12 21:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 10:10 [GIT PULL] x86/platform updates for v5.10 Borislav Petkov
2020-10-12 18:21 ` pr-tracker-bot
2020-10-12 21:10 ` Linus Torvalds
2020-10-12 21:15   ` Mike Travis
2020-10-12 21:27     ` Borislav Petkov
2020-10-12 21:42       ` Mike Travis
2020-10-12 21:46         ` Linus Torvalds
2020-10-12 21:56           ` Borislav Petkov [this message]
2020-10-12 22:00             ` Mike Travis
2020-10-12 21:58         ` Mike Travis
2020-10-13 11:11           ` Borislav Petkov
2020-10-13 12:33             ` Mike Travis
2020-10-13 13:29               ` Borislav Petkov
2020-10-13 13:37                 ` Mike Travis
2020-10-13 14:25                   ` Mike Travis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201012215642.GN25311@zn.tnic \
    --to=bp@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.travis@hpe.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).