Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3036080rdh; Mon, 27 Nov 2023 05:17:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1kFNhImuuDBPCArFs2C4ycOGPz+iDEtRxr4+vkHPoyr2VLw/kwtJr0IKXFNXHc7OuTGkP X-Received: by 2002:a05:6a00:e16:b0:6cb:b72b:abbd with SMTP id bq22-20020a056a000e1600b006cbb72babbdmr11515815pfb.3.1701091052928; Mon, 27 Nov 2023 05:17:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701091052; cv=none; d=google.com; s=arc-20160816; b=O5ow5+NtbFhih3l8tSgzHYP5/FsODo1hXKLOQlowYXlvkWGkNFi4JTJ6Th9pQhmc5m EjXn/4Bvz8ggqX7cAGnwfRuJSxvsvuyGf61ZvCmuzKqZytUz09QYsxPSgGDe484dV7k6 o7nqwl3Itvc4+o3/sYI/ZUn+Rq+Vga32ytEhfNwU4b0PesGIjopbuGnr4d1LS1kxH1yV c8lDkjBJSPHOnSYikVMj8jfwqmN6lpwhP+mN4WlqMAvvzVYam0Ddz5ss6R4FMxMeJMXT y6pXT4w36nbs9N/aT0tPoO2nIyG+7d9tgEOG61FApamYQZE3cQCMxj7ir9E2gxHRM4RH iyaA== 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 Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y68-20020a636447000000b005c1b311a152si9702728pgb.657.2023.11.27.05.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 05:17:32 -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 E636F805E445; Mon, 27 Nov 2023 05:17:26 -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 Content-Transfer-Encoding: 8bit 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:27 -0800 (PST) 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)) -- 2.34.1