Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp713651rdb; Fri, 2 Feb 2024 01:23:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2DvMRHgFVz7jA42QhO/b6oMdHyrqJf7aMAO2XZ2zuR8tCxkwz5uCmtnD06PIqK1xw7DU+ X-Received: by 2002:a17:906:52d8:b0:a35:9e3c:80dd with SMTP id w24-20020a17090652d800b00a359e3c80ddmr5030647ejn.5.1706865821908; Fri, 02 Feb 2024 01:23:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706865821; cv=pass; d=google.com; s=arc-20160816; b=paN+xyO/mBdyXOAjJ3N+sD2x3bagbvHYCXgFdGlg+s7Em9f4wFZNDTcHEwDI2UYt6g ZaIsnFt4xLe6CuohqcoevmnheMWwtlQ8uFPefZrifDoD8Lvp9fOtPyfkGAYji9seMCGv TvhtXwKpUiSvsNYho271KRVx3iv7OGOBsdP79XFFhKuKHqo6gGQR8bkuTHPm9hdC5nxj 88EFgwEOumjOxcFKFJpUUuT5jyCNfKu8PcU7LvzcupWq6lfPiYxEnLa0RrBs91aAPeRL /OBWvlOJ84fj9dYjYZTjZNh5ELd5tUOaFAbHBakJo0OlEe9aDlfLCbpvEemDZRKuLhGM uAnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=GMEenTGpD64OsWtlAWpN6VGOtAvUqEfJGaeDX3OQ7oE=; fh=AFD/iuewWoVcVC4wHNYkZF5+k75186lIQMTFEUl3ev8=; b=bzxQNVuKzqTDss2wQK6VxrZHlpbHrT7LUBDrQs9V9cvh8Kmto+6GEyvT+Ysan8tXqi bnzbSf0xUe8e1emAG/iVd4XlslKRWWZwMhCgb/gDZoRuBnQgKWS+eWOf8Vc08axH17eY fxL5sGyj5l5xeHxG4XT7yLo64ExGq1E754kGTVkeIp+LV7vwP3TnnjJut44YL07i13g/ G7WVPo/8Nk8yVdgkhWWNQAkl+2cnVjuLWhuKwJQCtcyngFZyP9myHLb7tpnFQiyQJeZf 4y0CLspPz84cqFuRn6ezFTTJpQi7YyYPlpD7ip4IT43Y937+8xy+DjEqK19AiPSmz1Kk Oo1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eqXzvyTy; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-49557-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCVVx9Ri3kKwiyikW/ZGQKT/eKt5w0kntl8RbOg1fm8KYb8LsPb6ZzRUXumDnPdQPjkWFuoWCO5zhQojeGpjX5yjm/N8fnbNBxlMftSObQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f22-20020a170906049600b00a34b006694dsi638279eja.318.2024.02.02.01.23.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 01:23:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49557-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eqXzvyTy; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-49557-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9AACB1F24ABE for ; Fri, 2 Feb 2024 09:23:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FC997C092; Fri, 2 Feb 2024 09:22:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eqXzvyTy" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 302637A729; Fri, 2 Feb 2024 09:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706865727; cv=none; b=RGcU1HNKEt1sNeCJ5uyGzGIfxsKajdbEtWC1zysIH8VyWNedYaX2yCp8iENXlZmdDheiR752lJ2F32uAH0sVfJdvTF+TzQyt3Cq/RyUG29zRV+Aa6z7UUVzxS59V4ytv/TPJy/QlJyVl73fzIDnaWkZ7PQ8f9vmNeoZcbjiHjtw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706865727; c=relaxed/simple; bh=cOvTivQwCKSNAmVU6sv7hOu2Ay14QYpymwDJPYGTOZY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KgHpIw5CPI+sgw3GToGa7V8MtiwLvopV06CkmZKWKpN01MkpDKlFprvOXOvRCfYRYL1Cg3nnZ+Z7M3YegBeG+UCsPsh0OkcUzebTQyRv9ndBmTJN3VjOowuMwBd/i9iL5EFXfZ8E6dZJhxUeUOvOGkk7aMB0Sm0lx/dVXJQgFbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eqXzvyTy; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706865727; x=1738401727; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cOvTivQwCKSNAmVU6sv7hOu2Ay14QYpymwDJPYGTOZY=; b=eqXzvyTyzhJgRAgMZsRBTzjzsWgxKEiNNKUkux3HPMQ72b7XC6kCpuiS NSfiOWKl7MWSAobrChTsB3PVgm4kd/D6AxnT6zUqxEDKZ5iM4ToR8AODg S5sM2YIZwyouDv79q/51Qbd+dsDFILABMqTU/aDrS3PIoIsb/LKr6qnTM 4RrpjmL07spWmj3Awck22gQgJgzYpddSKHy5TLp1q2JMNpNPCmg3Z6n8a 3vkiDiKT67yvgF1zs6/zHG2foAFNwEMYyGjtdWrsbCm0z435/93efsXo9 nxbePgu1lg7+ckTBdkwlfn6KRLUzbWukr3COsRF/2TUlSedrb7GHSIKwR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="11483056" X-IronPort-AV: E=Sophos;i="6.05,237,1701158400"; d="scan'208";a="11483056" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 01:22:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,237,1701158400"; d="scan'208";a="4639710" Received: from wangnin3-mobl.ccr.corp.intel.com (HELO rzhang1-mobl7.ccr.corp.intel.com) ([10.254.214.177]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2024 01:22:03 -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 V2 04/11] hwmon: (coretemp) Introduce enum for attr index Date: Fri, 2 Feb 2024 17:21:37 +0800 Message-Id: <20240202092144.71180-5-rui.zhang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202092144.71180-1-rui.zhang@intel.com> References: <20240202092144.71180-1-rui.zhang@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Introduce enum coretemp_attr_index to better describe the index of each sensor attribute. 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 b8fc8d1ef20d..32f99cf6308b 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 512 /* 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, + MAX_CORE_ATTRS = ATTR_TJMAX + 1, /* Maximum no of basic attrs */ + TOTAL_ATTRS = ATTR_TTARGET + 1 /* Maximum no of possible attrs */ +}; + #ifdef CONFIG_SMP #define for_each_sibling(i, cpu) \ for_each_cpu(i, topology_sibling_cpumask(cpu)) -- 2.34.1