Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp627156rdb; Thu, 30 Nov 2023 13:54:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+q07f0pyEC7cxP4Hp+7+ezcuOMUaoVb4DnM+SzTCLinzEB6W6rRTh6/pRNgBgw/CZdhXv X-Received: by 2002:a05:6a20:8f10:b0:18d:961:564b with SMTP id b16-20020a056a208f1000b0018d0961564bmr7152488pzk.33.1701381249335; Thu, 30 Nov 2023 13:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701381249; cv=none; d=google.com; s=arc-20160816; b=jCQN6BOOJwaKFHnjWHq3JFFSh6NThu4efLkZzDKnhKpPPnchnsd1q1zPds/mfYygkU EXRGbFOzADHhHS+GFzOToQ5/3ps21nhXS8vkhA8yvrVUfwuzF+4edJNYeQDHmosQLgPf wJmyszqrJkJyOZCcDKiuHIO0EwMuNngO4Y2kbnVzHTOXlSNjL1XKzaAt28BipV9h9IAk rm5jPl+rtYRGLudKfumW6Wga+MCqI+UWLHXX/deMnO9TT+LnXwvrgciN+WX1UADNtpUa S+9YLrAxVso3Ge+enTZd33M7yrauAFIYVw70hCMItyzw6H9W55BVu0dOBZSmY8eKrTE+ boMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=spPu61uQDKjYs8yZT1nnebCU0xJPMRzAOKnqJzjYiS4=; fh=G1j+NqIZIszoTQ3NlEcbRDPGSRYv1Vu0XuFPJrY9Ht4=; b=B35P3aqPnKMsbrEG0hLWPQfFv4YXz5QG0xTSopJejGtiMlJ+10AVYqBOt480W94AcY HvnmLBUBEIjwgBibcKIfn21XDpi78eWgeOT5DzAQU78vD4XgR1LhLLfX/DTNqCloyBIX SEkMvBtIQ4/i7/6DySWrCfhbaaKVzQVj0jBBh0JZTmddB6JXXyn71pJ0IY5wfe80I+Gw zmJEXHNRI41YcVQlifLhAx63S60rSaA+C4QeCVTPVPjhYeXTlvq2KkR/Ruwitk+Fe72a 6RgGmlS6Qhi4zNhvHiBFHC3LgFwuvfO+hfyHd/DEhAqlAjxcmBzsHyBLIeqJLPmjlFh7 RK1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XFbvk5rJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id k21-20020a056a00135500b006c4faa9a36esi2132749pfu.184.2023.11.30.13.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 13:54:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XFbvk5rJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id F3B7980E8FBD; Thu, 30 Nov 2023 13:54:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377043AbjK3Vxs (ORCPT + 99 others); Thu, 30 Nov 2023 16:53:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377029AbjK3Vxr (ORCPT ); Thu, 30 Nov 2023 16:53:47 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8C8D10DF; Thu, 30 Nov 2023 13:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701381234; x=1732917234; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=szEhgwh4Idld7dvIWDY2z9wrG2QKjBvPHBigd0PVM6M=; b=XFbvk5rJIBsGranFm9lPqGqPKDgMZMjJH9USjnuAUtLV214BHRBAC5oG ww0uXvtWUK/yUOs/talrmOIO5m1SJtakF2hNUTFi11lTvv1JszDgpalhp MFrJXk/Lt0+35BQzMTUV+n9+PcVA86Hk3rFKQhye2T/3s7vVA17zgYJJ7 6RixaXmVQ2hykYn3qrkdz76xAaBW7BfWqpOhyY+grdyh3XkwYl7QlCleK 8qQh3yFuTGJMwH4RVTR9y4YJ9qnWurtiUeIaZfY3WNEBFoXKMQQJnresy ktJ2ram43nOOnBrbHml6EtozY5N0/fdMgA/zJkxltUsO/eWOjFh/Ljbor w==; X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="6631891" X-IronPort-AV: E=Sophos;i="6.04,240,1695711600"; d="scan'208";a="6631891" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 13:53:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10910"; a="719263954" X-IronPort-AV: E=Sophos;i="6.04,240,1695711600"; d="scan'208";a="719263954" Received: from araj-dh-work.jf.intel.com ([10.165.157.158]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2023 13:53:53 -0800 Date: Thu, 30 Nov 2023 13:51:27 -0800 From: Ashok Raj To: Zhang Rui Cc: linux@roeck-us.net, jdelvare@suse.com, fenghua.yu@intel.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Ashok Raj Subject: Re: [PATCH 1/3] hwmon: (coretemp) Introduce enum for attr index Message-ID: References: <20231127131651.476795-1-rui.zhang@intel.com> <20231127131651.476795-2-rui.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231127131651.476795-2-rui.zhang@intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 30 Nov 2023 13:54:02 -0800 (PST) On Mon, Nov 27, 2023 at 09:16:49PM +0800, Zhang Rui wrote: > 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 */ This seems odd. TOTAL_ATTRS being the last entry seems fine, but defining a MAX_CORE_ATTR the way above sounds a bit hacky. > +}; > + > #ifdef CONFIG_SMP > #define for_each_sibling(i, cpu) \ > for_each_cpu(i, topology_sibling_cpumask(cpu)) > -- > 2.34.1 >