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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 587FFC76186 for ; Wed, 24 Jul 2019 19:30:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BDAA229F3 for ; Wed, 24 Jul 2019 19:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996647; bh=3MB4bK7EG96b5G7lE/CIVDA98zKHLKKru1XWZkbPHGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1u1fEO3RVvlVaN35p5drL1/l4pIPxIQow+vtGDPVzudGRPXw5QaIqTSe+yoFn/boL K3rG6uDBJ36pXmmo+RREnUixbHsxruSIJ/FzkIrAsbXShDN9a2y8YsVbQ9qzJ/2xUd OtXishVaDMwvU5ZhnhcrRwBcG1o9v0/XF5UV3yDs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388410AbfGXTap (ORCPT ); Wed, 24 Jul 2019 15:30:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388389AbfGXTak (ORCPT ); Wed, 24 Jul 2019 15:30:40 -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 7CC8C20659; Wed, 24 Jul 2019 19:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996639; bh=3MB4bK7EG96b5G7lE/CIVDA98zKHLKKru1XWZkbPHGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fW9VtnYAC/K/g8O+n48CBhu41pe4CKGVBv/IUVwZ1iVzKnLBDsSebjxGT1W2uI6KK IUFsjchgEgp/Tz63/ItdvnFd3wEaA7qBP6ucZKl+xk3gTx/HlN0qmlroSKBwQExLMC jUFEuvUj67OSualHKxpM4yx1vab67DYCDFHL/sSc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , Borislav Petkov , Sean Christopherson , "Gustavo A. R. Silva" , "H. Peter Anvin" , Ingo Molnar , Masami Hiramatsu , Pu Wen , Suravee Suthikulpanit , Thomas Gleixner , x86-ml , Sasha Levin Subject: [PATCH 5.2 125/413] x86/cacheinfo: Fix a -Wtype-limits warning Date: Wed, 24 Jul 2019 21:16:56 +0200 Message-Id: <20190724191744.090186828@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 [ Upstream commit 1b7aebf0487613033aff26420e32fa2076d52846 ] 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 Signed-off-by: Borislav Petkov Reviewed-by: Sean Christopherson Cc: "Gustavo A. R. Silva" Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Pu Wen Cc: Suravee Suthikulpanit Cc: Thomas Gleixner Cc: x86-ml Link: https://lkml.kernel.org/r/1560954773-11967-1-git-send-email-cai@lca.pw Signed-off-by: Sasha Levin --- 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. -- 2.20.1