From patchwork Mon Nov 28 16:20:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Neri X-Patchwork-Id: 26861 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp5785193wrr; Mon, 28 Nov 2022 08:18:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7COPYaEk3R+FQS7kGQMwry3/nRN0MldWD0ptEphqqhxKJXz+lUFUeSmamzWqC6W042+p97 X-Received: by 2002:a17:906:a1a:b0:79e:9aea:7b60 with SMTP id w26-20020a1709060a1a00b0079e9aea7b60mr45026357ejf.444.1669652330683; Mon, 28 Nov 2022 08:18:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669652330; cv=none; d=google.com; s=arc-20160816; b=zWIUXty4n1sQIfdaZPwq6pDkXVralCormnjDVElSowbvQx1m003jHcF0VL8PFsLuoB mzN8tjmy+WulbiA7ENHuZmG4DRm5AGfV4+6cv7d8DG5Tnp1iKKyDA9/eJf2B3TTrcL/p jmdYhOaF/6it60AjmfmbVAYue9tTut2P6jiaZMDWYVNcQyiIhWZN002x9g3F+SLvQDbC CAdTzB0tXlz4UUXPAAtMONm0ceGrVWDOtuxaHlYHi4ABBDQZkM7gTYkSxXJ/XFi/8kXY DlOZvbJ+V8GXfGTeUq6zsR8cn1HRj5DI69B3qTXALU+F7UInE0Tl4+bs5BsCou+vGVa8 /l3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=jjhZzKLeTRKovec+P+9PiSghyVbbXZIa3jtKtHLrQ5w=; b=viC5wj2cEnOimbwZUo3s9XpylV5Msp5IyxeVbC20F7F5b0Hjfss1lixA3+S7AqtOk0 ztj9+rBsKHA/AJnuo+1llSHn/OvOweYftWQI0wqnaQv1fN9azY71lNcxOqdHbnUrwSnx tG/WpTom69Hzd7o5OGAk9sXMRrhf/f1HSNxDIBusd+q7bCNzHDey4Q635j9XGjef8Pbe JiMw+W/qAvWLVvKCtn9oJLyqhOqL0Ld4e/oBjBk2BxcnvBT93l49ccX4QxRhkdJSgCFy sUtc7+QHcO5XuwQpcaHNS1CH8sD/VjS0blcscH3/81rZ2ibXDvgukYiZhpToXiBWtD7p we4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CQ10JDwA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n10-20020a05640205ca00b00459e1ce80a7si12158020edx.241.2022.11.28.08.18.27; Mon, 28 Nov 2022 08:18:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CQ10JDwA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232376AbiK1QMb (ORCPT + 99 others); Mon, 28 Nov 2022 11:12:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbiK1QM3 (ORCPT ); Mon, 28 Nov 2022 11:12:29 -0500 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB10D6479; Mon, 28 Nov 2022 08:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669651948; x=1701187948; h=from:to:cc:subject:date:message-id; bh=PJooqv5lc87r6DlPqv7xPFz5j9kjskGlNeElh+S27Vc=; b=CQ10JDwAPAcqZh88cc3QRGn1F5Stap7X3Sa1PoPwAm25mbsdVE86lcoW OdzqYuxQUiGxbPPFhuLuOvfHQtVMaa9qKskArBLgY9LxbuUAl6cFhemXo UE8t0B3MWobUqQvIOQ2UzPMC4hppDQznFWBXOwXZ8G0V5wWC1hmpeqFIZ g1+PvVAN5L4QVDuSo8IlFzPsBRKiKc/+zLDNKj+PqaAQJljQopJ8+/akn AzlQQGRDdtaPH2dAp1CrQXjGE2hRgmg59vyeZUHkY7Wpqb5qOjHUYxHS3 6tP3lhnb70Es3wpzVgQj69LvUr6s3tgoEILHO+SRmiHtxsfdcDIFV85Sg A==; X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="314909049" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="314909049" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2022 08:12:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10545"; a="749445230" X-IronPort-AV: E=Sophos;i="5.96,200,1665471600"; d="scan'208";a="749445230" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2022 08:12:27 -0800 From: Ricardo Neri To: "Rafael J. Wysocki" Cc: Ricardo Neri , Daniel Lezcano , Amit Kucheria , Zhang Rui , Len Brown , Srinivas Pandruvada , Aubrey Li , Haowen Bai , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: intel: hfi: Remove a pointless die_id check Date: Mon, 28 Nov 2022 08:20:01 -0800 Message-Id: <20221128162001.31227-1-ricardo.neri-calderon@linux.intel.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750757362170583130?= X-GMAIL-MSGID: =?utf-8?q?1750757362170583130?= die_id is an u16 quantity. On single-die systems the default value of die_id is 0. No need to check for negative values. Plus, removing this check makes Coverity happy. Cc: Daniel Lezcano Cc: Amit Kucheria Cc: Zhang Rui Cc: Len Brown Cc: Srinivas Pandruvada Cc: Aubrey Li Cc: Haowen Bai Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ricardo Neri --- drivers/thermal/intel/intel_hfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c index 239afe02e518..d35287eb2f78 100644 --- a/drivers/thermal/intel/intel_hfi.c +++ b/drivers/thermal/intel/intel_hfi.c @@ -371,7 +371,7 @@ void intel_hfi_online(unsigned int cpu) die_id = topology_logical_die_id(cpu); hfi_instance = info->hfi_instance; if (!hfi_instance) { - if (die_id < 0 || die_id >= max_hfi_instances) + if (die_id >= max_hfi_instances) return; hfi_instance = &hfi_instances[die_id];