From patchwork Mon Nov 27 13:16:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 170132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3100757vqx; Mon, 27 Nov 2023 05:17:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUR1gq6ia0pPI7mAEerSnmgcbRbAVFcwqf6stvAjS79HFLhwoW3jg9LsjpbNmHPijAUjQU X-Received: by 2002:a05:6a20:7352:b0:18c:2d7:b84c with SMTP id v18-20020a056a20735200b0018c02d7b84cmr12490668pzc.61.1701091045704; Mon, 27 Nov 2023 05:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701091045; cv=none; d=google.com; s=arc-20160816; b=bTet2tRy+0xdKGmHZLg0u59vsv3eWsIwbrDZRKxofVKpgTP1PsccSb+i7KxiY39gPo Ptww1RTmj0W+QZ2gylz+DJ+aqPrEIiAapHVddnwRDy2ler20xDuu+2oYz/wJ9hUKT/J+ nw3ovC5oDxOe4JdvG544QXILAFl3ktgcuhHUa6m8q9i47kR0sA0u3SpUo5VKW8R5AT73 J9k2yG5B6LE9lAXqWAa8asM4x1X4ZmqHhIP2pKqZ1iby8Wu17lb32E90DkktW9iMdjl/ g13U0+hzC244pcHVysVO2t5HH4v3jom65LajA+iNzYATu/DgKYyjX6gIFmaCCdsnIXX+ ufOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vRl1X0Rf1dPzOU9VSHobheD51u0XuuU1TA43Mn33vBE=; fh=Mbam0pR9JWUnI2UheCn8N0H+ykbrnMeiPzCxF+zJmn8=; b=bEP0k7Og5jchFauC0c35+DdL28WKS3hgiVPlZfx3SJdwhxms3cWiQD3ZFValmEhKH5 YTLt+D/pZO2TfPd8/paP4tLD9BJZ4N3V30Agbb6yQLrAM8eimYHnpP8vO0m3MNwrNXb+ ghiaPBgFAxjJygYOCcWpooprjL15IFpggr9qcuT3HIksmQR+P3x0Dw/MSDpuGqAUs7b+ oW24niI8orRf9gSylm1eGjMPsTNlQk2LnutecF+BA+BHNNEfSh1Yqo5XSf9KTlu39UTT ep81QYdRRY3wyBBpsXTkF7Wv+0nd86Wrt5r0q2gxwBzqq3lREhU1V4XN9RJESG1cdXmr yioA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Arx0+kEC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id s14-20020a056a00178e00b006cba6b43d88si10074567pfg.265.2023.11.27.05.17.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 05:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Arx0+kEC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id ED8E0805E441; Mon, 27 Nov 2023 05:17:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233434AbjK0NRF (ORCPT + 99 others); Mon, 27 Nov 2023 08:17:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233371AbjK0NRD (ORCPT ); Mon, 27 Nov 2023 08:17:03 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 693821A1; Mon, 27 Nov 2023 05:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701091030; x=1732627030; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hlesYW8rOy1XULs0ORzCaeEOdp4ntoGv7wHs6RrOTq4=; b=Arx0+kECHD7iU2ss0hRNKmOwUZNDhXuYU7O6+Arq95nIwECR5753Loiu jUJIHz3uBBrnlFytOYeyWLxjIT/dNiwFaSsmsWX02nY1PEjVbRQmjPg5a hFDyDZwrSX/IibocZxRF2hds0lvmU1yffwiQWonijwm/I0lMLnEfSoObz Hl0qjbMoVDG6M9YgyFfp1/f2oHMxj6xE930mAWLgyzORyl0TOHEqmzVCL hffvMvFSKG3bWwGm9dztS3p2u+UR4dVUdc/3iEDMHrYHpOLfTQKbb/Mdv Rfj/ao0Snuf+1is6mUBHFBQCBizNRmEc4EftyFulQhRCyMW9dI91j4hRP Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="423833674" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="423833674" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 05:17:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="718031609" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="718031609" Received: from zhipengw-mobl1.ccr.corp.intel.com (HELO rzhang1-mobl7.ccr.corp.intel.com) ([10.255.29.237]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 05:17:07 -0800 From: Zhang Rui To: linux@roeck-us.net, jdelvare@suse.com Cc: fenghua.yu@intel.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] hwmon: (coretemp) Introduce enum for attr index Date: Mon, 27 Nov 2023 21:16:49 +0800 Message-Id: <20231127131651.476795-2-rui.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231127131651.476795-1-rui.zhang@intel.com> References: <20231127131651.476795-1-rui.zhang@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 27 Nov 2023 05:17:21 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783723244523574275 X-GMAIL-MSGID: 1783723244523574275 Introduce enum coretemp_attr_index to better describe the index of each sensor attribute and the maximum number of basic/possible attributes. No functional change. Signed-off-by: Zhang Rui --- drivers/hwmon/coretemp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index ba82d1e79c13..6053ed3761c2 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -43,10 +43,18 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius"); #define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */ #define NUM_REAL_CORES 128 /* Number of Real cores per cpu */ #define CORETEMP_NAME_LENGTH 28 /* String Length of attrs */ -#define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */ -#define TOTAL_ATTRS (MAX_CORE_ATTRS + 1) #define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO) +enum coretemp_attr_index { + ATTR_LABEL, + ATTR_CRIT_ALARM, + ATTR_TEMP, + ATTR_TJMAX, + ATTR_TTARGET, + TOTAL_ATTRS, /* Maximum no of possible attrs */ + MAX_CORE_ATTRS = ATTR_TJMAX + 1 /* Maximum no of basic attrs */ +}; + #ifdef CONFIG_SMP #define for_each_sibling(i, cpu) \ for_each_cpu(i, topology_sibling_cpumask(cpu))