From patchwork Fri Feb 3 17:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 52589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp973942wrn; Fri, 3 Feb 2023 09:47:01 -0800 (PST) X-Google-Smtp-Source: AK7set9qnsD77hqNkwYTTwvx2nSbnhbIPnBWsZKpRvt4jSbqDQ37RRrXSQ1244+eK9Y8AZU0NU+S X-Received: by 2002:a05:6a20:3955:b0:be:df22:96ca with SMTP id r21-20020a056a20395500b000bedf2296camr14520191pzg.25.1675446420760; Fri, 03 Feb 2023 09:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675446420; cv=none; d=google.com; s=arc-20160816; b=Diptf0CNk8sQ+vUZBDh2ikLi5KAuUjhKYduNpf9LikV3+yG9+4EaW/9boAI/78+Mrq DcGUFkYCOp9Z9WDNLShAT6sOeo4kW06g1GXAn6WCya3akTtqCZjZINkOxfNVdwH2EQtU R40kybMPist+xTaE77/u3QLCLDgWou5Miv3pXcdTojVApujw8d1erV7fcwWvoZ6EQLx+ S7eiFqQkyXuc37juIudx8gjpVO8FK+i6zDJUAZf50em/RR+juPE/Pshaerg2xtz7bQuO XaPOQbpvG/BHfRm0aEAM1MTQDmcI5VqreWbASs99WaIgevT59VO5kpdmGqMGHqIYZPva WObQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QLokg2NHvRs8lyMVKIrJy/BKSUdWDoE+8uppdEp+JpA=; b=zFkX5LbfmWR9RCVp+1HEqvaGS1kZ2KZBLLbDg9cUwGsFxAKQuhm08zQte7hfbtWPlF okCIpCWxPDJ+OfxWxcEJnQ849kAdPLzOsl4gWD86e0BipGyIuMtyOxrlnOLBzV1i5V7G nJEcdmvewwqlPurlZnSJEEYDsTPbsJ0DhWrOvfnUJf1+qS6t8euqjIfCW6KcZkmLBmfU CLf/gUnJLCCUNrPzV5QJch8TW8OQ4b4zfVbQg5jjv5FDzH7xif/R1nso7vAgvLotem9j NMpI1cVSvluz2qX5SRs/A/2DMQpWnazMjJjA2f1YnWDF5PHXQWOws7Js2AHlNT/6hFMe Q6CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sZRjljkr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e4-20020a63ae44000000b00478c0ebc7c0si3041043pgp.746.2023.02.03.09.46.48; Fri, 03 Feb 2023 09:47:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sZRjljkr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbjBCRon (ORCPT + 99 others); Fri, 3 Feb 2023 12:44:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233172AbjBCRoi (ORCPT ); Fri, 3 Feb 2023 12:44:38 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12F457D98A for ; Fri, 3 Feb 2023 09:44:36 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id bt17so2294762wrb.8 for ; Fri, 03 Feb 2023 09:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QLokg2NHvRs8lyMVKIrJy/BKSUdWDoE+8uppdEp+JpA=; b=sZRjljkr6bJYeB4OrmFyNTCBRtYs6quMNFi9nqhdgWamo9qgpOnOE6zldkfIpgGpBu esIFInDsT+nubJI71sW8L7ivDzru9kf4QiIUNp5GESU5dzH+MF2lQCLt8bwyo11ErNl6 YtcC4Td0cSmuM0ywDVpeXW7tvy7qIEN4cJsIulhqDbZv0zx450Z3KNmCp3FPUV2aA2yU P8XidWqFHv1qqwd2/qj9AQ8TUsmaTaZUIkHis4dllxUPIy5o2p/kN++kLLkEEcb7RGde PyQyFuCZiawkZORNU21wavgD905PQQCQBVJlep13d3PFjzgt0jENJldfYD3ZHULkkhCO gstQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QLokg2NHvRs8lyMVKIrJy/BKSUdWDoE+8uppdEp+JpA=; b=jdlJQ3DBUtXohtwFQjQGYoqZ0r5e7OPc4FcVQyoF3kTvI4AWgMNrBozj4JoImBnPVt fNUVKpPmW30VojNm+83DTXhtxm8LWeQ0g8+K+DAPvYlZOlN3TxwXV/NdpMAZdzY0vraw uGj8UPMssAmvHF7XjOmtjHzPt4PAgNd/3/OeFYj8YhUKAMFh3P5TuoA2qtTG3htPpddH Wv44eNn5srYeBnuI9wecHxzI8gbWymtOkGPWffMbEUcqlCqOfgS2uVuz1cJ/nBPk98hS xrG4kRf9PjyMdNR5dosCib9hmd5b84Tm1e1ss8fotef/gkzXctiZOoVkSoE9nRJVXZtl 6Tew== X-Gm-Message-State: AO0yUKWdoSDypNtYBxa5SNP0ktQUqxXcnfSPdat8Z9BAcwjJNlE778lM EFnyw6EN0Xy9cibtk2xr77/kAw== X-Received: by 2002:a05:6000:1005:b0:2c3:be89:7c29 with SMTP id a5-20020a056000100500b002c3be897c29mr4288351wrx.12.1675446274468; Fri, 03 Feb 2023 09:44:34 -0800 (PST) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id z1-20020a5d4c81000000b002bdd8f12effsm2443528wrs.30.2023.02.03.09.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 09:44:34 -0800 (PST) From: Daniel Lezcano To: rjw@rjwysocki.net Cc: daniel.lezcano@linaro.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Zhang Rui , Len Brown , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 02/11] thermal/acpi: Change to a common acpi_thermal_trip structure Date: Fri, 3 Feb 2023 18:44:20 +0100 Message-Id: <20230203174429.3375691-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230203174429.3375691-1-daniel.lezcano@linaro.org> References: <20230203174429.3375691-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756832906130964214?= X-GMAIL-MSGID: =?utf-8?q?1756832906130964214?= The acpi trip point definition are very similar whatever their types. Instead of creating a different structure for each trip type, let's define and use a common one. With this change we move a step forward to the generic trip point. No functional changes. Signed-off-by: Daniel Lezcano --- drivers/acpi/thermal.c | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 0dbce190cacc..e27b0b71fcf8 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -119,36 +119,13 @@ struct acpi_thermal_state_flags { u8 reserved:6; }; -struct acpi_thermal_critical { - struct acpi_thermal_state_flags flags; - unsigned long temperature; -}; - -struct acpi_thermal_hot { - struct acpi_thermal_state_flags flags; - unsigned long temperature; -}; - -struct acpi_thermal_passive { +struct acpi_thermal_trip { struct acpi_thermal_state_flags flags; + struct acpi_handle_list devices; unsigned long temperature; unsigned long tc1; unsigned long tc2; unsigned long tsp; - struct acpi_handle_list devices; -}; - -struct acpi_thermal_active { - struct acpi_thermal_state_flags flags; - unsigned long temperature; - struct acpi_handle_list devices; -}; - -struct acpi_thermal_trips { - struct acpi_thermal_critical critical; - struct acpi_thermal_hot hot; - struct acpi_thermal_passive passive; - struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE]; }; struct acpi_thermal_flags { @@ -166,10 +143,10 @@ struct acpi_thermal { volatile u8 zombie; struct acpi_thermal_flags flags; struct acpi_thermal_state state; - struct acpi_thermal_critical critical; - struct acpi_thermal_hot hot; - struct acpi_thermal_passive passive; - struct acpi_thermal_active active[ACPI_THERMAL_MAX_ACTIVE]; + struct acpi_thermal_trip critical; + struct acpi_thermal_trip hot; + struct acpi_thermal_trip passive; + struct acpi_thermal_trip active[ACPI_THERMAL_MAX_ACTIVE]; struct acpi_handle_list devices; struct thermal_zone_device *thermal_zone; int kelvin_offset; /* in millidegrees */