Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp714257imw; Mon, 4 Jul 2022 18:37:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1se81w1pwqGHxzTYvXfoESGsPwb72HG+rMQ8eUCcm0cOVGUONgmxRKr5zxz/+JZrFtpG5Un X-Received: by 2002:a05:6402:34d4:b0:437:7b19:13af with SMTP id w20-20020a05640234d400b004377b1913afmr42231026edc.372.1656985046556; Mon, 04 Jul 2022 18:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656985046; cv=none; d=google.com; s=arc-20160816; b=PppI2K+1BuQUCtNZ9se4y+2F5lfvRetu2VcvTaRObYlogs2i8l5dGguF4hiGQKP3+9 SEsBW5caIj7AaeiGXdcfQblkXKPCK9fp4/8tvHVKRyMJEbrcnsltvDKODgYE4qxZxWue /suf3U+FUPwbkFl+jEObWPzhtX/OMjkGhoZfWSm9TiJ1/YRhsCdDwRIJ6f3n4LxAoRZT 8T0yUAha52JtbovIXFAoatCIHkJPdHqCHpGxjI6ZCguaN8h9MyelOzRZMxE/oZS4O8CS jREnqLafDzRICHYnO8vzeFP6fsQ1B90q0QEBE2kmLskZLqHz0tV6NkijIeXbuG9yXpE/ UUmw== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=F00RRTXZzxecVibOlYWgiTqmzeCmCcgbjRpwCF8qxRA=; b=KoZOlH17RkvTYamgl/IZQbmlKpcIHNqzcip2Qd/W6ggD/1Kj8ltQJuKYewWI7KvfiJ 5uAuZojnxM7ZLrTBVJx8I1xbEz5S2pm50OVre+mA5aET4jV06rkuJyTu/qoyL7Y9Scgo /r8lo2OU/bUzzV4PE1I0bmpn6fNgNj0lUTVEWLAZA1uHACTx/PfZhUNgX3kitdSzckA8 Ym7dXKuAlxYdsQ/KRVnvSb3EvXhG3PD4BvmsEnl5lERYtcTwHQVkml5a0ThD4W1UXwIh K+urxsTtsVjfETdgDqy3oK+9fgv8X9zbIPJc+Dikghj6xvSNEJ/qEpkDtI6TgijztCxF 3ogQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nUmtNk1l; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a1709065e4900b006fec40443b6si24805799eju.23.2022.07.04.18.37.02; Mon, 04 Jul 2022 18:37:26 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=nUmtNk1l; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbiGEBUp (ORCPT + 99 others); Mon, 4 Jul 2022 21:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbiGEBUo (ORCPT ); Mon, 4 Jul 2022 21:20:44 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 881BD2DC; Mon, 4 Jul 2022 18:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656984043; x=1688520043; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=nCiN/Jz7RaTKec/xvaYJ5gfSVdZpNNJhnyeiC7HP6/c=; b=nUmtNk1lrBhsAXHwmDjooJSTRIqU26zA/vQ2KUtNeACIf7JYOfFt84nb IKTWXpowIGBQV9wmwL7bhZKusqDTRs71sE1oOuTOfnlkFhvcUDDtlsx7o jn3/FwE38HvQY06zpPcqWfO/GNMEybCgMCt3268F4Dg1pKMcsZD421ZBn qxVvAtm9698q6eXGtqRGAj+unyV6O8xZ/Scil5mY9TWrr89ydYubEWP4d V7cx+pJD0BbDB6GeMTbQQaEDmC3ivth/tJrJoLhXWyyP8nuhRoSCMKcXp D2tP9E8Dlf4IeUFwmP+G15bATYFoydFU87x7F5P/QGll0FxuUNeZfmg5a Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10398"; a="344900412" X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="344900412" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2022 18:20:43 -0700 X-IronPort-AV: E=Sophos;i="5.92,245,1650956400"; d="scan'208";a="619565707" Received: from shuangy2-mobl.ccr.corp.intel.com ([10.249.171.213]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2022 18:20:40 -0700 Message-ID: <0c525d16f34bedd1ea4ee4b7516c9dee5a92d419.camel@intel.com> Subject: Re: [PATCH v3 11/12] thermal/of: Use thermal trips stored in the thermal zone From: Zhang Rui To: Daniel Lezcano , daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, abailon@baylibre.com, Amit Kucheria Date: Tue, 05 Jul 2022 09:20:38 +0800 In-Reply-To: References: <20220703183059.4133659-1-daniel.lezcano@linexp.org> <20220703183059.4133659-12-daniel.lezcano@linexp.org> <6c7e1865e7e68ac0f035680044eb878ced715a1b.camel@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Mon, 2022-07-04 at 23:24 +0200, Daniel Lezcano wrote: > On 04/07/2022 16:14, Zhang Rui wrote: > > On Sun, 2022-07-03 at 20:30 +0200, Daniel Lezcano wrote: > > > Now that we have the thermal trip stored in the thermal zone in a > > > generic way, we can rely on them and remove one indirection we > > > found > > > in the thermal_of code and do one more step forward the removal > > > of > > > the > > > duplicated structures. > > > > > > Cc: Alexandre Bailon > > > Cc: Kevin Hilman > > > Cc; Eduardo Valentin > > > Signed-off-by: Daniel Lezcano > > > --- > > [ ... ] > > > > EXPORT_SYMBOL_GPL(of_thermal_get_ntrips); > > > > > > @@ -139,9 +134,7 @@ EXPORT_SYMBOL_GPL(of_thermal_get_ntrips); > > > */ > > > bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, > > > int > > > trip) > > > { > > > - struct __thermal_zone *data = tz->devdata; > > > - > > > - if (!data || trip >= data->ntrips || trip < 0) > > > + if (trip >= tz->ntrips || trip < 0) > > > return false; > > > > > > return true; > > > @@ -161,12 +154,7 @@ EXPORT_SYMBOL_GPL(of_thermal_is_trip_valid); > > > const struct thermal_trip * > > > of_thermal_get_trip_points(struct thermal_zone_device *tz) > > > { > > > - struct __thermal_zone *data = tz->devdata; > > > - > > > - if (!data) > > > - return NULL; > > > - > > > - return data->trips; > > > + return tz->trips; > > > } > > > EXPORT_SYMBOL_GPL(of_thermal_get_trip_points); > > > > what is the difference between > > of_thermal_get_ntrips/of_thermal_get_trip_points and > > thermal_zone_get_ntrips/thermal_zone_get_trips as introduced in > > this > > patch series? > > > > we need to remove the duplications. > > There is no difference between those functions. There are 34 more > patches in the pipe to be sent after this series to do more cleanups > and > remove code duplication. > Good to know. It would be nice to have a cover letter to describe the whole picture, including this patch series and the following patches in your queue. thanks, rui