Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp398259ybt; Wed, 1 Jul 2020 00:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgCcza7Nf20QqUvHQx3xc8O1Q+Nanb+qEIxDAg6f/MtivQksrQg6rygBRQd5T1gbF42bmv X-Received: by 2002:a17:906:314c:: with SMTP id e12mr18514208eje.500.1593590278530; Wed, 01 Jul 2020 00:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593590278; cv=none; d=google.com; s=arc-20160816; b=Dw3RToyH57GvBpeJyAhHynYAddb5166e0Vj+BH9lmClNXmSKbgCK3fPQGBxhCr7tKT jNSh/1yMMDHT/9MhQAidV9B7ttE+3mE/8rIof1K/UA/pAs7zI13IL4TpvnKhpt9aug05 oZswCqgx8Hqes08gwOSPzcRpUUAEsR2g+Xvd/qHfY2qxcq7NGTOxS4J1iXMLYL/xYuBw WujmOdobXCniCYGSwGP2/CZc57ng3C4EoTSfxFtA2sLtOwUgBp6X8kxxBz+4pTSnTePW tRH3bMiASGKwCXSsogf3h0Ufgv/k7Ri9fhw9YZSmwXRl3HZ4iP8RImHZxtVKjpJQK8C8 d1bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :ironport-sdr:ironport-sdr; bh=0da3hN8tQBS6xzMSj/PKzN+q8u3dyb9ldTSfhJHkm2k=; b=MQIjl+0rvYn0x/MZMW0s58ZRYow4VfIbkrHvnxRA+CTORDxNCzGkPomESCXmomt8IW kqBZO+EaEahkZogstCXk0+RmAixyrPJMsy27wOIDf3dQ7p5D/iAGzz7jEl4xZ8hM/RYm ud2L+sW9Ov4Q6MbDQ6A47EHQfwjT+o+n2HQvHXNOOxI/RgyekGmP0OnlnzuWnJ4pbMrW +g51rw5Gr0uf0qCfzeUkFmBLvN6VZz8Rg3VMuQRVeEef0K+lUekl40SJw51PLNskaTyY 1sxCi5cuFeX2haxow7zI8nTVJnGFvmPmIc/J0wSHFKD6/o6JqxLjM2zQ5VpvxeTa0O9X 5WcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k14si3616767ejs.400.2020.07.01.00.57.36; Wed, 01 Jul 2020 00:57:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728367AbgGAH5U (ORCPT + 99 others); Wed, 1 Jul 2020 03:57:20 -0400 Received: from mga03.intel.com ([134.134.136.65]:44764 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728330AbgGAH5U (ORCPT ); Wed, 1 Jul 2020 03:57:20 -0400 IronPort-SDR: RbvJZxjHpjZrk6WqmuCskuvxwiNUE52EaVLZzGHDXihUzCGmzqjmBQIDkKgEtskB9sSgHKKThx jlXoa+uEm2qA== X-IronPort-AV: E=McAfee;i="6000,8403,9668"; a="146502495" X-IronPort-AV: E=Sophos;i="5.75,299,1589266800"; d="scan'208";a="146502495" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 00:57:20 -0700 IronPort-SDR: LH+m/jfBuCGxAcBnAxx84P6ZHKDTUjPlCGCSARjNovlubKAs7+e5S9JzOsnI63QPfHQEkEX2Vq F3LLedvVJwRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,299,1589266800"; d="scan'208";a="425503221" Received: from yumao-mobl1.ccr.corp.intel.com ([10.255.29.220]) by orsmga004.jf.intel.com with ESMTP; 01 Jul 2020 00:57:18 -0700 Message-ID: <766cbdeb2a0f9d9df4f68a71b4b0defd1e95e0be.camel@intel.com> Subject: Re: [PATCH v2 1/5] thermal: core: Add helpers to browse the cdev, tz and governor list From: Zhang Rui To: Daniel Lezcano , Amit Kucheria Cc: Srinivas Pandruvada , Ram Chandrasekar , Linux Kernel Mailing List Date: Wed, 01 Jul 2020 15:57:17 +0800 In-Reply-To: <143d954f-2ecf-c4d3-cb7d-f2ea75da8276@linaro.org> References: <20200625144509.17918-1-daniel.lezcano@linaro.org> <143d954f-2ecf-c4d3-cb7d-f2ea75da8276@linaro.org> 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-07-01 at 09:35 +0200, Daniel Lezcano wrote: > On 30/06/2020 17:09, Zhang Rui wrote: > > Hi, Daniel, > > > > seems that you forgot to cc linux-pm mailing list. > > > > On Tue, 2020-06-30 at 17:16 +0530, Amit Kucheria wrote: > > > On Thu, Jun 25, 2020 at 8:15 PM Daniel Lezcano > > > wrote: > > > > > > > > The cdev, tz and governor list, as well as their respective > > > > locks > > > > are > > > > statically defined in the thermal_core.c file. > > > > > > > > In order to give a sane access to these list, like browsing all > > > > the > > > > thermal zones or all the cooling devices, let's define a set of > > > > helpers where we pass a callback as a parameter to be called > > > > for > > > > each > > > > thermal entity. > > > > > > > > We keep the self-encapsulation and ensure the locks are > > > > correctly > > > > taken when looking at the list. > > > > > > > > Signed-off-by: Daniel Lezcano > > > > --- > > > > drivers/thermal/thermal_core.c | 51 > > > > ++++++++++++++++++++++++++++++++++ > > > > > > Is the idea to not use thermal_helpers.c from now on? It fits > > > perfectly with a patch I have to merge all its contents to > > > thermal_core.c :-) > > > > I agree these changes should be in thermal_helper.c > > Oh, actually I remind put those functions in the thermal_core.c file > because they need the locks which are statically defined in there. > > If the functions are moved to thermal_helper.c that will imply to > export > the locks outside of the file, thus breaking the self-encapsulation. > > Do you want to move them out? Then no. I don't have any objection of removing thermal_helper.c, so you can just leave these functions in thermal_core.c thanks, rui > >