All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Qian Cai <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: sean.j.christopherson@intel.com, cai@lca.pw, hpa@zytor.com,
	gustavo@embeddedor.com, mhiramat@kernel.org, tglx@linutronix.de,
	mingo@kernel.org, bp@suse.de, suravee.suthikulpanit@amd.com,
	linux-kernel@vger.kernel.org, x86@kernel.org, mingo@redhat.com,
	puwen@hygon.cn
Subject: [tip:x86/cpu] x86/cacheinfo: Fix a -Wtype-limits warning
Date: Wed, 19 Jun 2019 10:28:22 -0700	[thread overview]
Message-ID: <tip-1b7aebf0487613033aff26420e32fa2076d52846@git.kernel.org> (raw)
In-Reply-To: <1560954773-11967-1-git-send-email-cai@lca.pw>

Commit-ID:  1b7aebf0487613033aff26420e32fa2076d52846
Gitweb:     https://git.kernel.org/tip/1b7aebf0487613033aff26420e32fa2076d52846
Author:     Qian Cai <cai@lca.pw>
AuthorDate: Wed, 19 Jun 2019 10:32:53 -0400
Committer:  Borislav Petkov <bp@suse.de>
CommitDate: Wed, 19 Jun 2019 19:21:32 +0200

x86/cacheinfo: Fix a -Wtype-limits warning

cpuinfo_x86.x86_model is an unsigned type, so comparing against zero
will generate a compilation warning:

  arch/x86/kernel/cpu/cacheinfo.c: In function 'cacheinfo_amd_init_llc_id':
  arch/x86/kernel/cpu/cacheinfo.c:662:19: warning: comparison is always true \
    due to limited range of data type [-Wtype-limits]

Remove the unnecessary lower bound check.

 [ bp: Massage. ]

Fixes: 68091ee7ac3c ("x86/CPU/AMD: Calculate last level cache ID from number of sharing threads")
Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Pu Wen <puwen@hygon.cn>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/1560954773-11967-1-git-send-email-cai@lca.pw
---
 arch/x86/kernel/cpu/cacheinfo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
index 395d46f78582..c7503be92f35 100644
--- a/arch/x86/kernel/cpu/cacheinfo.c
+++ b/arch/x86/kernel/cpu/cacheinfo.c
@@ -658,8 +658,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id)
 	if (c->x86 < 0x17) {
 		/* LLC is at the node level. */
 		per_cpu(cpu_llc_id, cpu) = node_id;
-	} else if (c->x86 == 0x17 &&
-		   c->x86_model >= 0 && c->x86_model <= 0x1F) {
+	} else if (c->x86 == 0x17 && c->x86_model <= 0x1F) {
 		/*
 		 * LLC is at the core complex level.
 		 * Core complex ID is ApicId[3] for these processors.

      reply	other threads:[~2019-06-19 17:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 14:32 [PATCH v2] x86/cacheinfo: fix a -Wtype-limits warning Qian Cai
2019-06-19 17:28 ` tip-bot for Qian Cai [this message]

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=tip-1b7aebf0487613033aff26420e32fa2076d52846@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@suse.de \
    --cc=cai@lca.pw \
    --cc=gustavo@embeddedor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=puwen@hygon.cn \
    --cc=sean.j.christopherson@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.