Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10423243ybi; Wed, 24 Jul 2019 22:58:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLJXz+M1YBye43I/8GkELuKpJBjDVeD1b6RAxNappTXqoMrhaHHa3dfMrM0JEHsV+x5v3w X-Received: by 2002:a65:62c4:: with SMTP id m4mr82920766pgv.243.1564034292152; Wed, 24 Jul 2019 22:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034292; cv=none; d=google.com; s=arc-20160816; b=KkX4UZiQ0n0GLo1D1FK9/X65yCD+zsaaMpdjFfa/3BorA+YXGaG+9zmVz3VpIIGtYo X7wvWvQkefMnc2wrxB207yoBo+unsIJK7uhzKO4KEGOMD8FY6+KweRedB+CsdJPzFBs+ wN2+HjPcXFjXGD4dEEz8PrYF3QspG4QsYfLPvJOnEV/iw10ztUWB+eZpcHDlMAy6p9iG toH4tlh1ruxaFYlSxQyc5imQdtB2aIp8ZnRTn5COoVkHPC72TQebYXjzlOxgbKQ8Gq4s Whfp5+odBzuL0t4I5OlSshwW2Y67a7uRrGeegeDIkLpjlS53+kArCDF8HPc2TBJ8Wucd aP3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VRx8E9V+x8VsqIjjVnuTMOnuUYnKszvBs4b+Do/ubb4=; b=DHYnzF95e4roboRBo3VwIeFSsap7LKcalijavC6sH41cFfYS5wOpsiqB7/DzlqvBF0 OZSEK/1AQlY3ZsZsDurXyq3IQjtmAdjwcgi0n0PkbBlIeNdmiOAXR0jI/GnzT3nAr5Bd SmUsOOqZLn5Qq9Wzb0ocm8J3SKBEhHqV7ednkbClI1kdvcuh6hefz95WhCWkieDIshb3 L56CQqvxiqcq00T1gjKMDX0cKnbcAF3nONDrjv6yIN9cHWmNWkq9WhhwXe2T783mtY1l uA7jloWwfpVOKgdmrRJJ12ae2aX2j8NqRKY+XOcrzs52Y/SWm49DDE1CjZS5nYRegEBi tZjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Aei5qrvE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si9760977pfc.99.2019.07.24.22.57.57; Wed, 24 Jul 2019 22:58:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Aei5qrvE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404209AbfGYFjy (ORCPT + 99 others); Thu, 25 Jul 2019 01:39:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:54156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404180AbfGYFju (ORCPT ); Thu, 25 Jul 2019 01:39:50 -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 0A86F22C7C; Thu, 25 Jul 2019 05:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033190; bh=PEofQeh1xLeuSIEsoTeLSK3obeB2xLua1eztJzQA6fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Aei5qrvExoUzwO43EqIX0fd1MiJTIglyL+o4bdvPYQcl5SJJ3PKQzGjYladnNH2PO QPUItJ/hqKs3xorizOVc5ViptTdjW/zo8OOt/n7Yd9YBTQiog60MmVEZHqOg5h404X ebZtnVN56vyI1FGEN3xrzUBP3pO1UPLGfc01EZ3M= 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 4.19 083/271] x86/cacheinfo: Fix a -Wtype-limits warning Date: Wed, 24 Jul 2019 21:19:12 +0200 Message-Id: <20190724191702.299978898@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 0c5fcbd998cf..9d863e8f9b3f 100644 --- a/arch/x86/kernel/cpu/cacheinfo.c +++ b/arch/x86/kernel/cpu/cacheinfo.c @@ -651,8 +651,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