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]
Message-ID: <1490274576.19767.189.camel@linux.intel.com>
Date:   Thu, 23 Mar 2017 15:09:36 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Lee Jones <lee.jones@...aro.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] mfd: core: Preserve PLATFORM_DEVID_NONE

On Thu, 2017-03-23 at 11:21 +0000, Lee Jones wrote:
> On Thu, 16 Mar 2017, Andy Shevchenko wrote:
> 
> > There is a potential flaw if cell has id > 0 and is going to be
> > registered with PLATFORM_DEVID_NONE.
> > 
> > Ignore if PLATFORM_DEVID_NONE is supplied.
> 
> This is a substantial change to a pretty tried and tested piece of
> sub-system code.  Can you put some more meat on the bones in the
> commit log, and include examples.

Example in pseudo code:

cells = {
 [0] = { .id = 0, .name = "moduleX", },
 [1] = { .id = 1, .name = "moduleY", },
 [2] = { .id = 2, .name = "moduleZ", },
 ...
};

mfd_add_devices(..., PLATFORM_DEVID_NONE, cells, ARRAY_SIZE(cells),
...);

Output (names of the devices in the drivers):
"moduleX"
"moduleY.0"
"moduleX.1"

Desired output:
"moduleX"
"moduleY"
"moduleZ"

Is it by design?

> 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > ---
> >  drivers/mfd/mfd-core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> > index c57e407020f1..c9583f895058 100644
> > --- a/drivers/mfd/mfd-core.c
> > +++ b/drivers/mfd/mfd-core.c
> > @@ -149,7 +149,7 @@ static int mfd_add_device(struct device *parent,
> > int id,
> >  	int platform_id;
> >  	int r;
> >  
> > -	if (id == PLATFORM_DEVID_AUTO)
> > +	if (id < 0)
> >  		platform_id = id;
> >  	else
> >  		platform_id = id + cell->id;
> 
> 

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ