Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4225951pxf; Tue, 30 Mar 2021 02:28:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKN2UWQTEUYuFW+uVyYFIRO46TUeTITTwd6xZApjmSsMqxjrGEWd2ryM/etpcFqnH4Thb6 X-Received: by 2002:a17:907:d10:: with SMTP id gn16mr31865275ejc.304.1617096508242; Tue, 30 Mar 2021 02:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617096508; cv=none; d=google.com; s=arc-20160816; b=HSX8jUh/ysKHyvqf+WONneX4kxPSgGNJaB4N330iiENvH3YTlQZ0yicK0jVpYJ4nOO VWx8SlHmaOUsGwguXGFdMUO6gJauU+h9Xp8z6Sn2HcwwpoHweHxt2y08r3+w/8KiPFbs NUs0NCrdQUGu6D5idIc1tdcKUN+9BvMkSyaM3Q/TBDOUc9E0J5/IpXV+1H2548caSOL/ dWnYc+rN+62Iaqr/BlramwOBOWOctGEjMBrYuB4/7sYvP6BBzwDoz+sV/TI6mlRKdry0 OXSFuq2pzLSHkUWzLX3T+cDIoHNmG4OSI9Of+P6eC/2XQg+uWRtO56S/YHH8bwfYWqld ga0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=nbc0ZGZnZq6uO7NdAX6j2QHcIGBI5uBoVCda0ND3618=; b=pZ9zAMQ9p53wZwCPYIwLmKFLCkogO3Lwj0buPO0whmAqWTBasuKJPQJuZs4Uvz7LIM yvhcSBari43ZcV6oLxgDdeffs0xpyHKCqqtjRc6CjXgVWrBevjAC9CETKPcGzp4MjNxl rfWH2KKMPkt6kPsKswPveJi/gTp4+J8nJNSRLbL4AzyuiOuyykIzA9T9hfif5ylmFOew W1B3pulvx5LQpOEhBR4ZABKORNVqs2+dOxX5Y4UVKOCPgUpkFZzOtygNih4MJdITJn8F E5opyAncLVPYU31094kxdfgK1zlnSt47tjlvVRZNQaIennwTi2xHTT7raPrnVCGfaRpZ sdQw== 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 s10si15500584edi.563.2021.03.30.02.28.05; Tue, 30 Mar 2021 02:28:28 -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 S231686AbhC3J1I (ORCPT + 99 others); Tue, 30 Mar 2021 05:27:08 -0400 Received: from mga02.intel.com ([134.134.136.20]:29497 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbhC3J0j (ORCPT ); Tue, 30 Mar 2021 05:26:39 -0400 IronPort-SDR: DS+na1goAYLlBj/96DxtW4sLhU/3Sp2u5JboPgAb0IaWsuuj0S9gTXtjIEhXS1g7ndOXOVgo48 RP5crxo1+YtQ== X-IronPort-AV: E=McAfee;i="6000,8403,9938"; a="178860870" X-IronPort-AV: E=Sophos;i="5.81,290,1610438400"; d="scan'208";a="178860870" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 02:26:38 -0700 IronPort-SDR: JFuYIEolFJdWz4Sv28R+nQxwOke/2rsulxP06Fia9r9cjpjPcXAywFTcgkq40Tk6+sELd+CG/0 Ej8txvdJS3Pg== X-IronPort-AV: E=Sophos;i="5.81,290,1610438400"; d="scan'208";a="516364791" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 02:26:35 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lRAds-00HHww-Nn; Tue, 30 Mar 2021 12:26:32 +0300 Date: Tue, 30 Mar 2021 12:26:32 +0300 From: Andy Shevchenko To: Daniel Scally Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-acpi@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Yong Zhi , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Heikki Krogerus Subject: Re: [PATCH v2 5/6] software node: Introduce SOFTWARE_NODE_REFERENCE() helper macro Message-ID: References: <20210329151207.36619-1-andriy.shevchenko@linux.intel.com> <20210329151207.36619-5-andriy.shevchenko@linux.intel.com> <5e76c3b8-d154-e5ca-25d8-290376469e5a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5e76c3b8-d154-e5ca-25d8-290376469e5a@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 29, 2021 at 11:45:29PM +0100, Daniel Scally wrote: > On 29/03/2021 16:12, Andy Shevchenko wrote: > > This is useful to assign software node reference with arguments > > in a common way. Moreover, we have already couple of users that > > may be converted. And by the fact, one of them is moved right here > > to use the helper. ... > > + SOFTWARE_NODE_REFERENCE(&nodes[0]), > > + SOFTWARE_NODE_REFERENCE(&nodes[1], 3, 4), ... > > +#define SOFTWARE_NODE_REFERENCE(_ref_, ...) \ > > +(const struct software_node_ref_args) { \ > > + .node = _ref_, \ > > + .nargs = ARRAY_SIZE(((u64[]){ 0, ##__VA_ARGS__ })) - 1, \ > > + .args = { __VA_ARGS__ }, \ > > +} ... > > + { .pointer = &SOFTWARE_NODE_REFERENCE(_ref_, ##__VA_ARGS__), }, \ > > What are the .args intended to be used for? I actually had it in mind to > replace this with a simple pointer to a struct software_node, because I > can't see any users of them and the fact that it's actually storing a > pointer to a new variable is something that confused me for a good long > time when I wrote the cio2-bridge (though that's mostly due to my > relative inexperience of course, but still) It's to be in align with DT phandle references that can take arguments. While for now, indeed, we have no users of this, it might be changed in the future (I hadn't checked DesignWare DMA where I would like to transform the code to use device properties eventually and there it might be the case). -- With Best Regards, Andy Shevchenko