Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2240063rdh; Tue, 26 Sep 2023 17:59:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFH2xyR18fxcStvbMIQnDeHywGXNjro7uBrJ8rN6pGv608R0SgnnBwiF1Nr+WdUy3dQTes2 X-Received: by 2002:a05:6870:b523:b0:1dc:c65e:decc with SMTP id v35-20020a056870b52300b001dcc65edeccmr897953oap.6.1695776355634; Tue, 26 Sep 2023 17:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695776355; cv=none; d=google.com; s=arc-20160816; b=eWkI5+aOgKQpmswdfN9ba2zv6ejBkF11F2sKyoPZD+yEk76tL63CMisYaycS1vQSuT sXlSIIBhAYpCXCPjacq2qSfTfCADOO3WrJoiiROwRqqaqP4GjByN5m9hvaVxdxKRD23I J7IrHvrgmq+k3WRxYqLmcGVqofUp9MJZYM9ov89veg5Mvepz2Yaq7o1nOilrxXFTrihC DtvUKtw0q4XS4CTGSB9hG3RX4f4g39A0BQZwpza95O3I/Tps0iUBMpXInxwFQuWNd089 Y1JMbJlMrycfdw+xIZRl4vbb6ZK59N1NXs19X3hYMPWjROSalT8vlpyWap5Pbmpaww4z 5F7A== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6KWZPT1cVuVAxwKDV1pCBXg/18ZoYQrcOIuq4Q9pEZ8=; fh=k7xEkiTGhFla/PTKqpjMmrtBn2WEwlyJ654UsIBVaYo=; b=ylVpJlq1UTF6d7qg18Qa6Bu22Kn9Z96gxHwsf8RCvSO2VM4oBIcalYKH6VSSjYqByl ewAfPWnfxD+3Sbm2c7iCtvC5E2ni7oVoukoKSZgeZwkO93Na1FKmdAxHh//fJJsOoj3G pILn6Wi38s/ie1ivrwfGeBkRA1QiKDDLpF21b70qmNr1m8qi2+NCLBzval7/l7OPZa4L UWsAzVUg/e6y7n2CBzSuXkueZATcZwCatEsD0bLsqgDYd8sOBSVP6sno6QRJ0qYeBSMj qGhAPMbZzVlPCuvvnOLw4mdbGcUEkfnNcBi6rkdMNFZnYDio6qsnVH3V8yQIOSmJRwiq cDCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Za+ZYEJ2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cf4-20020a056a02084400b005775db42103si13956051pgb.267.2023.09.26.17.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 17:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Za+ZYEJ2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 765048083ADD; Tue, 26 Sep 2023 15:32:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjIZWcB (ORCPT + 99 others); Tue, 26 Sep 2023 18:32:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjIZWaA (ORCPT ); Tue, 26 Sep 2023 18:30:00 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE645FFB for ; Tue, 26 Sep 2023 14:16:23 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-405621baba7so69064845e9.0 for ; Tue, 26 Sep 2023 14:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695762982; x=1696367782; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6KWZPT1cVuVAxwKDV1pCBXg/18ZoYQrcOIuq4Q9pEZ8=; b=Za+ZYEJ2KrP1Q69UqsS+32GjP/LE/LfefHFmzNosRQW9MWImQ+t8jTjsEVfIQDx9RZ ffFRNEohk0wRiBqhtCa/4q9NoW8rqQrbYAF/JVCi9iV40bBp/w8zF+EcHGO6SrA13vs7 z/GRHcWv+RDDtHCYebJ8/ak2525YRov/IFfJ0l8i9hqxso2SYXuljW6WytFDWQK6qo73 gpvUAWGI1f/isG3bPntWSCE76NIM8uG2cHWs2DYluvaaCuQnZeI09mkBQy/H+4fKUYSw AP38jQ5m84Ha+HJNUujYRRCi3r/Uck5vrvBTJF/7lWzTzniQyhfRQ6OdlffWgtrzVyfc GncA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695762982; x=1696367782; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6KWZPT1cVuVAxwKDV1pCBXg/18ZoYQrcOIuq4Q9pEZ8=; b=UCTuKI995ZS/4h5oeldzKg9jPSDy+XrQpel7nyGzAJba+tz04tH21MO1QX0+uFjvG+ wB9L8scdXPqsZC5/nVuClVSqKv1EaNmWkUtRkeo+e6Kn9hfW570eAFQhkJ9TEtVoNu7q GvwZJOBOKDxAcEgK3rypDuQfadoKJLhT+EUYFXCagu1L+5SCuzbOl3IiC1PAS2YyR3Gc j7WX+LI2X7evQZcR7+dOOtrnExcTu3QGRIhRFVwTZttoC1zt+y/26c1sH50JPuAL3UBc QPybs0/t1fNdpUP6ptfCa41awXyMNzGH/u8udnuJ4CQjIXLxG8ANQEp1zq6AZx5d6Lzi 8ITw== X-Gm-Message-State: AOJu0YxjFE2Apz59pEhyy+CQqcjlMQA3gcCQ9/paiPrd71xxgllJb4Ey wVuUKWHr1J6JU0nZye7QCAxE7A== X-Received: by 2002:adf:e3ca:0:b0:31f:98b4:4b4d with SMTP id k10-20020adfe3ca000000b0031f98b44b4dmr9718944wrm.42.1695762981581; Tue, 26 Sep 2023 14:16:21 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0? ([2a05:6e02:1041:c10:c49e:e1a5:3210:b8c0]) by smtp.googlemail.com with ESMTPSA id c2-20020adfe702000000b003217c096c1esm15555497wrm.73.2023.09.26.14.16.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Sep 2023 14:16:20 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2023 23:16:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v1 02/13] ACPI: thermal: Collapse trip devices update functions Content-Language: en-US To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , LKML , Linux ACPI , Srinivas Pandruvada , Zhang Rui , Lukasz Luba References: <1957441.PYKUYFuaPT@kreacher> <3534976.iIbC2pHGDl@kreacher> <38ea14aa-ecc2-c40e-34ea-05b348158cfb@linaro.org> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Tue, 26 Sep 2023 15:32:15 -0700 (PDT) On 26/09/2023 20:04, Rafael J. Wysocki wrote: > On Tue, Sep 26, 2023 at 7:56 PM Rafael J. Wysocki wrote: >> >> On Tue, Sep 26, 2023 at 7:18 PM Daniel Lezcano >> wrote: >>> >>> On 21/09/2023 19:49, Rafael J. Wysocki wrote: >>>> From: Rafael J. Wysocki >>>> >>>> In order to reduce code duplication, merge update_passive_devices() and >>>> update_active_devices() into one function called update_trip_devices() >>>> that will be used for updating both the passive and active trip points. >>>> >>>> No intentional functional impact. >>>> >>>> Signed-off-by: Rafael J. Wysocki >>>> --- >>>> drivers/acpi/thermal.c | 53 ++++++++++++++++++------------------------------- [ ... ] >>>> + if (index != ACPI_THERMAL_TRIP_PASSIVE) { >>>> + method[1] = 'A'; >>>> + method[2] = 'L'; >>>> + method[3] = '0' + index; >>>> + } >>> >>> Could be index > 9 ? >> >> I can add a check, but it will never be called with index > 9 anyway. > > To be more precise, update_trip_devices() is called in two places, > acpi_thermal_init_trip() and acpi_thermal_update_trip_devices(). > > Both of these are called either with ACPI_THERMAL_TRIP_PASSIVE passed > as index, or from a loop over indices between 0 and > ACPI_THERMAL_MAX_ACTIVE-1 inclusive. Ok, thanks for clarifying -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog