Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5887750rwl; Tue, 11 Apr 2023 11:21:19 -0700 (PDT) X-Google-Smtp-Source: AKy350Zy7s1AwZAG8rQ+oE8xseXJWd3LaFxpjyNEcaKkhHpUEwfWeZLJTyOy/by/UYcVCTbgcj/e X-Received: by 2002:a17:906:b74d:b0:94e:1764:b0a3 with SMTP id fx13-20020a170906b74d00b0094e1764b0a3mr95821ejb.24.1681237278876; Tue, 11 Apr 2023 11:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681237278; cv=none; d=google.com; s=arc-20160816; b=eYv3rU6WrefK7g8zZ2GBnnv7Zy1mB+nX1v9PHpYif9DfpBsVh+ggjrTNWCtLwtIu1+ 5ryh+rWgzG02GQnnNZlmcPV0UI4f7aNi5vqz1FOlXBcEZyHL4AOsS28ad4y0/TgW2qKQ t86s7gjRZyMHq1YPwNNwEn7Qlm3b1OuSi2DZa6k279iXm+0CH9A0I5eLLe7QDMRM4jSs /2zaBshkMrtgKKp9JWwCroBEI3zlqVj60VCk0Mw2VmC04FZK6ZOj5HROrNG3XRNbulIS b3M4keLD+xW0WM4+J7+aw83/wJ6pzxZPixM5Jxpt52/Ztwmf2APRxk9HiAeiGgcuIhOf drFA== 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=wBZX5SQ/xniyMc/ty7p3EknPEbjioef2quH15h2gl2k=; b=AWnJAF2n2noRGWdNDfXHe3M4C0VwpiMNGd+a1BKcykhcMXrxEZOJGQsb71J0R2PpHz wZ+nLgJEpynGGBj2qH2gz69l8wSvor4r6jRwafx1decUOlt9axdHY5URRGNDFRwBtKtV gUayMOPwUlceTOzGwWs1afEvUgDKzjpZVasOfkfRI7zDTWIYio8epJv0EBFYlVaIdvWY 5nVdx8M/rVqgEPR3smfXL8NZFvHaWs9i50d+N7tU/XmE1e1X7OyyG72NrAETf8IvBHxE faY/mXE35ebGpiiD3EGlSkorzl8rInMU5ZaIA7sdkJTF91MYARvvA1dbPd5W0x6LcMvX uC/g== 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 p13-20020a1709060e8d00b0094a8ead8940si4819122ejf.1010.2023.04.11.11.20.54; Tue, 11 Apr 2023 11:21:18 -0700 (PDT) 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 S229797AbjDKSQw convert rfc822-to-8bit (ORCPT + 99 others); Tue, 11 Apr 2023 14:16:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjDKSQu (ORCPT ); Tue, 11 Apr 2023 14:16:50 -0400 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F23E5263; Tue, 11 Apr 2023 11:16:49 -0700 (PDT) Received: by mail-ej1-f49.google.com with SMTP id qb20so22216270ejc.6; Tue, 11 Apr 2023 11:16:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681237008; 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=VxnsZJ+NacNo9ZhNTgIw4VHiynvz3ELZgFV4x0n8u0I=; b=S8+e1enXbuCRUP+wMgn89cASSgYDBBqV+qu4a+YMn2OJbFfgMt190EWZyjVcijEIih 5ZNiN8jY/eVRBLyVZ4ISiR3Yl88P/GVs0DfO/wE6hosIKfL4ewPecALGmiVTWXIZ2THx TiDFMTsEaVGe9wnhUjaAdENcufag0DdVPDnHxcknbP1DR0yrv7k8lzU7h/9ov35Xzeyn YxlkyEKTmTMHAqHtIi+gpOEnCP8/BONS672xLmeLtgIXPqFcFgRak3qDEeRu3sqkhEzP 8ALnWdKOAKnUQxzkxgaBnfrCbSyGRxfVVJ6ZaAVPwO6TS9zdsb2LNhcGKBQKUojqow1w /dNg== X-Gm-Message-State: AAQBX9cRvEEpfKEBtqexid+cEEfYbISvlAdMF+/SO0QdtzcHxSf/F8Mw kMC8dNURhFqjkxgtrDmpCIkqWN3LbFvoncXJkso= X-Received: by 2002:a17:907:1c9a:b0:94d:cf8c:1542 with SMTP id nb26-20020a1709071c9a00b0094dcf8c1542mr2632678ejc.2.1681237007848; Tue, 11 Apr 2023 11:16:47 -0700 (PDT) MIME-Version: 1.0 References: <20230410205305.1649678-1-daniel.lezcano@linaro.org> <20230410205305.1649678-2-daniel.lezcano@linaro.org> In-Reply-To: <20230410205305.1649678-2-daniel.lezcano@linaro.org> From: "Rafael J. Wysocki" Date: Tue, 11 Apr 2023 20:16:36 +0200 Message-ID: Subject: Re: [PATCH v2 1/7] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace To: Daniel Lezcano Cc: rafael@kernel.org, rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Kunihiko Hayashi , Tim Zimmermann Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.5 required=5.0 tests=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 Mon, Apr 10, 2023 at 10:53 PM Daniel Lezcano wrote: > > The pch_critical() callback accesses the thermal zone device structure > internals, it dereferences the thermal zone struct device and the 'type'. > > For the former, the driver related device should be use instead and > for the latter an accessor already exists. Use them instead of > accessing the internals. > > Signed-off-by: Daniel Lezcano > --- > drivers/thermal/intel/intel_pch_thermal.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c > index dce50d239357..0de46057db2a 100644 > --- a/drivers/thermal/intel/intel_pch_thermal.c > +++ b/drivers/thermal/intel/intel_pch_thermal.c > @@ -127,7 +127,10 @@ static int pch_thermal_get_temp(struct thermal_zone_device *tzd, int *temp) > > static void pch_critical(struct thermal_zone_device *tzd) > { > - dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type); > + struct pch_thermal_device *ptd = thermal_zone_device_priv(tzd); > + > + dev_dbg(&ptd->pdev->dev, "%s: critical temperature reached\n", > + thermal_zone_device_type(tzd)); No, this just makes the code more complex than it is and the only reason seems to be "cleanliness". Something like thermal_zone_dbg(tzd, "critical temperature reached\n"); would work, the above doesn't. Sorry. > } > > static struct thermal_zone_device_ops tzd_ops = { > --