Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3082712rwb; Fri, 20 Jan 2023 10:58:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXs3X9kIshKAncNUCQMqEM52ZdC8h/iZmCj3McEKclCMQqZTcALruz0MwKbm1q/eQxMohbjD X-Received: by 2002:a17:906:299b:b0:84d:4394:e8e with SMTP id x27-20020a170906299b00b0084d43940e8emr15509846eje.41.1674241086768; Fri, 20 Jan 2023 10:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674241086; cv=none; d=google.com; s=arc-20160816; b=UkwFTC8YzJVQNRkc7e4ZvBh9fNU1cBdtDOs4vLga1LQ5k6TB7xBYbI2s3dAKQupPOd 7Z4SzdEeIQ9pDVmPFNznnIzFz5f+T067mcqDRYzTxjJN67VByQfwFnyPz/QJc6tF1V4M okTtEpZrJmwC1HM0OEfdyYL8xN/3kdukhi2CyumVpgeGDhLExYA4/bePsZg6yIPLbcbe LLjNieM/3sKWGcY7911ZIasmmdTWPnwyUE//jU3ztgChZc1YBu3ZdkWBYPmI7QKHbIeF iKOCY74/J3aHGM1O0Zx0s6KFpw7TMcqa6PMg6G6a4/XPTrMC4Os+ZbNKJzb8qLwCtSGw aw4w== 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=HlpOxQl5VOU7hxGnPoxWSPp3zq0VpItcLzS3Qjej5LE=; b=IrCEMVg7Q/71ZqqFefVSDn1er4TdCBxWZ2AEaQYmZOWQEHH0WUOagCjevXX7Zvzd6Y C4tHEsQ8cLU35NZ6zHeB2jLEUdU2YGdJ0JVkuZlT2rs7kH64IX3d68b1e4ZFfDgSJSAB SXYkHn0huL2rU/K6Olp4hCPKoRUPHpOXGPH7rbc3qb2uqu/CKwluywdur3WGu+t/JNR8 Pz679L2hN3MKfTr4j/WXhdWwtaBRrEq8q5eRY5lS4O6taZf38I+LyzjJdo1Uar0X9qqJ lZfZoT8xO0ovMlpwZxesZKHcNgBsNkIOYNbRXRn604bVNw7IckGY7AtYoLw+YQL8LoCe ejeg== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne29-20020a1709077b9d00b0086bd195adc0si27197126ejc.66.2023.01.20.10.57.51; Fri, 20 Jan 2023 10:58:06 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjATSPj convert rfc822-to-8bit (ORCPT + 50 others); Fri, 20 Jan 2023 13:15:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjATSPj (ORCPT ); Fri, 20 Jan 2023 13:15:39 -0500 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC30DDBE4; Fri, 20 Jan 2023 10:15:35 -0800 (PST) Received: by mail-ej1-f46.google.com with SMTP id mg12so16046954ejc.5; Fri, 20 Jan 2023 10:15:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yqP17bCoNp80WwoAZTjADKbunc1QO+WYV+s3nQtpawA=; b=43cTmRBsjOC6hSZW8wCzc5K/Ota7t6j0LPoAC7hjrSAVIYUE0LHEuEfRvLQyzRZExm KudCe99UE3B2kr0IGFR8HfH5Yh3gskW8Ho+dLdZfV36Y/1BPVUo/yySQ3Z1Xr2OGFFEz nrynEDcMqy1oPajq6KtxGejNFESk4TqzEhh3J1GUNFoBjPiIvB538/7D/H851gL7PERh Trhja1FikGUUZvl4xC3ZCBv4A+JT7sv01jA1hEEpA1NnOU84DKKyCR0PG9U/rVhDWEyi kZY3ArvBP5WICAxtzbwGGkVtygl1hKBimjKEJI4U27DhHLktxOkChMPQfKB+G4xbJ2Em zfiQ== X-Gm-Message-State: AFqh2krVF9YJ5SqrC89sDh32B10XlpOIQhIO2rxEGG3+SnJAwX2QsBel Fu0LNElHv5v1tAFecPxzVHfWhSH5ZFKiiy8xR64uUrmX X-Received: by 2002:a17:906:2c4b:b0:870:3557:160e with SMTP id f11-20020a1709062c4b00b008703557160emr1242549ejh.78.1674238534348; Fri, 20 Jan 2023 10:15:34 -0800 (PST) MIME-Version: 1.0 References: <20230113180235.1604526-1-daniel.lezcano@linaro.org> <20230113180235.1604526-2-daniel.lezcano@linaro.org> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 20 Jan 2023 19:15:22 +0100 Message-ID: Subject: Re: [PATCH v5 1/3] thermal/acpi: Add ACPI trip point routines To: Daniel Lezcano Cc: "Rafael J. Wysocki" , srinivas.pandruvada@linux.intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, rui.zhang@intel.com, christophe.jaillet@wanadoo.fr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no 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 On Fri, Jan 20, 2023 at 7:08 PM Daniel Lezcano wrote: > > > Hi Rafael, > > > On 19/01/2023 14:15, Rafael J. Wysocki wrote: > > [ ... ] > > >> +static int thermal_acpi_get_temperature_object(struct acpi_device *adev, > >> + char *object, int *temperature) > > > > So this would become thermal_acpi_get_temp_object(). or even > > thermal_acpi_get_temp() because it really returns the temperature > > value. > > > > I also don't particularly like returning values via pointers, which is > > entirely avoidable here, because the temperature value obtained from > > the ACPI control methods must be a positive number. > > > > So I would make it > > > > static int thermal_acpi_get_temp(struct acpi_device *adev, char *object_name) > > { > > We are converting decikelvin -> millicelsius. Even it is very unlikely, > the result could be less than zero (eg. -1°C). We won't be able to > differentiate -ENODATA with a negative value, no ? > > In the future, it is possible we will have to deal with cold trip points > in order to warm a board. May be we should don't care for now ? My point is that the ACPI specification mandates that the return values be in deciK and so always non-negative.