Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2056348rdh; Tue, 26 Sep 2023 10:57:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpHEAOEmoEzFNuIppsUxNslO2uekdRui8/QfFLUIiorMfoI3DGtrrJ9y39zI0PPz64da5u X-Received: by 2002:a17:903:246:b0:1c1:e7b2:27ad with SMTP id j6-20020a170903024600b001c1e7b227admr9676738plh.60.1695751076831; Tue, 26 Sep 2023 10:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695751076; cv=none; d=google.com; s=arc-20160816; b=s9MP1853mPNr+j7NNUGoTjt/B66Gb77JURnTemVT9nORtVSMiXClXozslIP/+AQaMD UEc+g8cgtUoyxhA1Ro0LDGBLvhtC2oydkSu+B/hkgFcgz9pc6yp61c2XRm7c5+UwUjVF M/hfUu0BITQl4XZscMJo2WVefM4tVt/OQNWbrMVV+LbclUupoOexJeDpZhsuWoiW7Wse 0sXSKWGMHr/nhqBeHCrrv7ejJFu2R6py6mmbGvPRg/DHZHgh56IeV9Ayh7YjWC5A5pYt E5UK04OlLOiUVuEgY1dqi+i1VTNTMgwMHlfKAYrH/YqOwwqELpjAujQSH6ZvlVh5WWgK ETiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=2LuAYZFZCEcXf2kAZd7xqr1U2JtD8v8FSKaDd7TWrSw=; fh=+2JxztEu7bN4hj58I/W/Di3Tmm589BaaoQWR/Ob+TLo=; b=BvPrtUKKoCw5RM88s19X0LvgvI1uqmlHIQ5wKHogD86S2J4qNpwjGAY94Avpg+fsHL vBnJLdalaAYUWGUfua1ak6KpbnmmRsm/066khXKcGICm2NO5s1o8D5R3+WTMxQWcmqY2 TnPzopGrA+nnlrFtOfqd5jT6gJlnIYfZpOmkoMOLfZOenHPHLqRt2DGz4TgoMzPlM8lG TZ7/Z86lXk1UMg+4fNHN5qbS8Bj/I3Mc2kT6En29vPunFUGFC9lWhfEZxJOHPOStuNFi FcCJ0fXyyMhvdDSvg3Rx8M49TGNa26NajdWugHSo/MZS04zpgLBeMnJ++WUlPq7zjagv haCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id kh8-20020a170903064800b001c6223e5675si3938562plb.188.2023.09.26.10.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 10:57:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id F22B98023722; Tue, 26 Sep 2023 10:56:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235043AbjIZR4f convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Sep 2023 13:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjIZR4e (ORCPT ); Tue, 26 Sep 2023 13:56:34 -0400 Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59CFE9F; Tue, 26 Sep 2023 10:56:27 -0700 (PDT) Received: by mail-oo1-f54.google.com with SMTP id 006d021491bc7-57b68555467so688110eaf.0; Tue, 26 Sep 2023 10:56:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695750986; x=1696355786; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2yqXaetlVLQEcWlksdWUaZspSGSc2dTGLE72sp01bYI=; b=SvCdznlUpca8WZ9D5D4EuekT4+1JoiEQKDqPoA7/gJXS7pv7dPZKm+zrfszFgrOxws dOMi8EKrICyWmDCtJNQbiR1kEi9BjLZwfAf9GPZL89tjDSix5+bB2sbTcMFh0EYXGGlW UZVsGUqj+kiplzeLzxw8Ie5ZfZb34W3B0bgcPokZoyliXwxeIlSV86JK1k1wwQxGH0yL yR7F4NW0vPizz2uh3hBeeSDpx8OKWPeGPm6g77MtoDiYTmERRFKuqXjYfjMCUzL0R9tf MCopj5WbsGx+fqDk3r0Ty4jVsSLCD5ZCK0LZpHAZ74HieskbAeNZLLRgCSbKNiAL/CBG hncw== X-Gm-Message-State: AOJu0Yx7KXL/9jX5YeB7nBdeyWX0ayngV9NSDqjskZCJHcIj5swvUCJo 5UeVoqWQtA1RrgfMI6AdYWpFeAkipl1g/3bdXbE= X-Received: by 2002:a4a:e8c4:0:b0:57b:73f6:6f80 with SMTP id h4-20020a4ae8c4000000b0057b73f66f80mr9468857ooe.0.1695750986553; Tue, 26 Sep 2023 10:56:26 -0700 (PDT) MIME-Version: 1.0 References: <1957441.PYKUYFuaPT@kreacher> <3534976.iIbC2pHGDl@kreacher> <38ea14aa-ecc2-c40e-34ea-05b348158cfb@linaro.org> In-Reply-To: <38ea14aa-ecc2-c40e-34ea-05b348158cfb@linaro.org> From: "Rafael J. Wysocki" Date: Tue, 26 Sep 2023 19:56:15 +0200 Message-ID: Subject: Re: [PATCH v1 02/13] ACPI: thermal: Collapse trip devices update functions To: Daniel Lezcano Cc: "Rafael J. Wysocki" , Linux PM , LKML , Linux ACPI , Srinivas Pandruvada , Zhang Rui , Lukasz Luba , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 26 Sep 2023 10:56:34 -0700 (PDT) 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 ++++++++++++++++++------------------------------- > > 1 file changed, 20 insertions(+), 33 deletions(-) > > > > Index: linux-pm/drivers/acpi/thermal.c > > =================================================================== > > --- linux-pm.orig/drivers/acpi/thermal.c > > +++ linux-pm/drivers/acpi/thermal.c > > @@ -43,6 +43,8 @@ > > #define ACPI_THERMAL_MAX_ACTIVE 10 > > #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 > > > > +#define ACPI_THERMAL_TRIP_PASSIVE (-1) > > + > > /* > > * This exception is thrown out in two cases: > > * 1.An invalid trip point becomes invalid or a valid trip point becomes invalid > > @@ -202,18 +204,25 @@ static void acpi_thermal_update_passive_ > > ACPI_THERMAL_TRIPS_EXCEPTION(tz, "state"); > > } > > > > -static bool update_passive_devices(struct acpi_thermal *tz, bool compare) > > +static bool update_trip_devices(struct acpi_thermal *tz, > > + struct acpi_thermal_trip *acpi_trip, > > + int index, bool compare) > > { > > - struct acpi_thermal_trip *acpi_trip = &tz->trips.passive.trip; > > struct acpi_handle_list devices; > > + char method[] = "_PSL"; > > acpi_status status; > > > > + 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.