lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 30 Mar 2021 12:26:32 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Daniel Scally <djrscally@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
        linux-acpi@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Yong Zhi <yong.zhi@...el.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Bingbu Cao <bingbu.cao@...el.com>,
        Tianshu Qiu <tian.shu.qiu@...el.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Subject: Re: [PATCH v2 5/6] software node: Introduce
 SOFTWARE_NODE_REFERENCE() helper macro

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ