Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp786130rdb; Thu, 30 Nov 2023 20:15:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgSyVTv22iMZtBHiAb+7OpQdguzRufJAC1dd+OBHNC255DUYToEtffDqqW1DREzj2vP6Nv X-Received: by 2002:a17:90b:1e0d:b0:285:b019:1506 with SMTP id pg13-20020a17090b1e0d00b00285b0191506mr19501894pjb.43.1701404102556; Thu, 30 Nov 2023 20:15:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701404102; cv=none; d=google.com; s=arc-20160816; b=iS6SpCliPeZQ8nqZXoMTgLrMA/VlVotxdaNO0t8c3K+Fxsw8TKeH7eq3Az8jz3kG13 Rjn1TDnpR2xd2YTeeA09l+v02IOJH02hkTrrgcKlHrhlPOvq8zId3QIHMVIjxzVa+u+R adp4n3AozYpRoE7RPz+00XFW0yoqFMBXQ3cKkLPlrez9UxAU8QpnPxQ72zeHTeZ/jKeJ DR+TsCxTmPivLLFMmETTv8JqUeWhURqGF69O/cQ4Kuh+R4FU5uB0DQFHUSnB1RH85Xqm zOV+MXbAxM+1+SGoblyfIdaYBtzsI5ZyYSlmXoNtxTlxqi+ECgrTxnif41QFUGISG2oF /0Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:sender:dkim-signature; bh=Ou39VwI4qDSNHUhmf4l8yTbj4hV8r42H44EzZ/2omPE=; fh=VxI5cUkM2Q3hcg7eK5zkgxzoWDYHvY3a1I4e6Suy8kA=; b=GOFgJ836AU9xgcYFkL87BjmSuRykvtWrlMckTziWclpdo7FOhNmBNHwcfPWcSPS570 Rxgo9Uy1siu6Mexwc/Fs2pbINdwc08cXOQoTt2MH2o0CbBualFIOFdgDvwQaIzmwbQml 4cuACsuAV8BFYx2DST3+kBcDjkBbmYamOidkGJY6LBC6mYcoL9FZtoywAxaF9OF7ZNQ0 TrQrLu8lPswHKxeP6whun6VlO/R77cTZw4itRLEBpte/GkIsJ+GiVszJoBFboWaA+HTc 1JfBsFZRHrq2sl/3krh/YjJQ4/Jbmp/r1piSSCT+g09B2z+lEIogb3oLcLftyoSyEdyy IZIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XEeeynt5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id lp8-20020a17090b4a8800b002859110dcf0si2883833pjb.125.2023.11.30.20.15.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 20:15:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XEeeynt5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AC48E8312AF7; Thu, 30 Nov 2023 20:14:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230170AbjLAEOq (ORCPT + 99 others); Thu, 30 Nov 2023 23:14:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjLAEOo (ORCPT ); Thu, 30 Nov 2023 23:14:44 -0500 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 120C7171B; Thu, 30 Nov 2023 20:14:51 -0800 (PST) Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6d816bb0a61so71137a34.1; Thu, 30 Nov 2023 20:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701404090; x=1702008890; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Ou39VwI4qDSNHUhmf4l8yTbj4hV8r42H44EzZ/2omPE=; b=XEeeynt5INqFrlW5KxYU0YTOha8STwdeE0rGEXKDybao622U2LE054jBbIYSwRgl9F dQvjjXXAFuGcwQYlCjnKXkL6sR03bHkOtoeCAD+KrnyhOv/SAUFjhxar/CIUWOPJYk+J shqIi2oeeK6+LkHD8ADIxEVDcyTrxnT1EVOZWmP7XtG+TOhIIlkwPpYnC2F6K2924B5H wvyGFiWRQrWV9N6ph2KEoLQGgSwvM3E0sYw/1ocOSNRRZYtCHWo0qoILLLZP5aZ+1IyZ spUucidvSy7nzHfMt3UR/CUyk40CX0ryGvJcQ40JO4g/k5R8aLld6SRKzYCXvmrRVFx9 qG/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701404090; x=1702008890; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ou39VwI4qDSNHUhmf4l8yTbj4hV8r42H44EzZ/2omPE=; b=X+5H2ac9IsGbvZhoFI+SYrzz2bdfqTVliCFD5Nkjrl36j/qKnD38I1upK8CaJJgFcX AK+8ecdTglm/SpSxmn4mpnjl2+X4F6IvWCQvIMtNbIWO1RX3F6bBNSX0HbZ8wNzMcFsm dqjtd8BOwXpG+S9OvIUGFC9g2OnhDTXfUex11IY/BbE5EvaBkqrd6f6mevHuhnA27NZ9 jljw0PU8OAUXmfhgkpS7oAw8sepVevwnxinHbFFO/6iQE9SPsMGnECTPa0UtkGuU3qTy BTXak+eo/A9D2qpzEhNYTw9tZlS4Tn2quMgzSOz7bZAqqHR8Po/Dm4UcC+8knh/L4Ivc ZqhQ== X-Gm-Message-State: AOJu0YztmEbdr/7JvNKSZ6R3qqQAJVwIqWjm7QNg63N8GGasqzVhbQ/B dh6HG9V5ajmMCobBUdbwjLdf13C6bto= X-Received: by 2002:a9d:6f1a:0:b0:6d8:134b:23e2 with SMTP id n26-20020a9d6f1a000000b006d8134b23e2mr1953943otq.0.1701404090392; Thu, 30 Nov 2023 20:14:50 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id e24-20020a0568301e5800b006cd09ba046fsm376560otj.61.2023.11.30.20.14.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Nov 2023 20:14:50 -0800 (PST) Sender: Guenter Roeck Message-ID: <0646bcf5-fd41-41e5-b7b1-06b425973c86@roeck-us.net> Date: Thu, 30 Nov 2023 20:14:48 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] hwmon: (coretemp) Introduce enum for attr index Content-Language: en-US To: Ashok Raj , Zhang Rui Cc: jdelvare@suse.com, fenghua.yu@intel.com, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Ashok Raj References: <20231127131651.476795-1-rui.zhang@intel.com> <20231127131651.476795-2-rui.zhang@intel.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4F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z+qQe/T0HQpmiPTqQcIaG/edgKVTUjITfA7AJMKLQHgp04Vylb+G6jocnQQX JqvvP09whbqrABEBAAHCwWUEGAECAA8CGwwFAlVcpi8FCRmg08MACgkQyx8mb86fmYHNRQ/+ J0OZsBYP4leJvQF8lx9zif+v4ZY/6C9tTcUv/KNAE5leyrD4IKbnV4PnbrVhjq861it/zRQW cFpWQszZyWRwNPWUUz7ejmm9lAwPbr8xWT4qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 20:14:59 -0800 (PST) On 11/30/23 13:51, Ashok Raj wrote: > 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. > Complaining is easy. What do you suggest that would be better ? Guenter >> +}; >> + >> #ifdef CONFIG_SMP >> #define for_each_sibling(i, cpu) \ >> for_each_cpu(i, topology_sibling_cpumask(cpu)) >> -- >> 2.34.1 >> >