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:	Thu, 5 Jun 2014 09:58:57 -0400
From:	Vivek Goyal <vgoyal@...hat.com>
To:	Borislav Petkov <bp@...en8.de>
Cc:	linux-kernel@...r.kernel.org, kexec@...ts.infradead.org,
	ebiederm@...ssion.com, hpa@...or.com, mjg59@...f.ucam.org,
	greg@...ah.com, jkosina@...e.cz, dyoung@...hat.com,
	chaowang@...hat.com, bhe@...hat.com, akpm@...ux-foundation.org,
	Yinghai Lu <yinghai@...nel.org>
Subject: Re: [PATCH 04/13] resource: Provide new functions to walk through
 resources

On Wed, Jun 04, 2014 at 12:24:20PM +0200, Borislav Petkov wrote:
> On Tue, Jun 03, 2014 at 09:06:53AM -0400, Vivek Goyal wrote:
> > @@ -322,7 +327,71 @@ int release_resource(struct resource *old)
> >  
> >  EXPORT_SYMBOL(release_resource);
> >  
> > -#if !defined(CONFIG_ARCH_HAS_WALK_MEMORY)
> > +/*
> > + * Finds the lowest iomem reosurce exists with-in [res->start.res->end)
> > + * the caller must specify res->start, res->end, res->flags and "name".
> > + * If found, returns 0, res is overwritten, if not found, returns -1.
> > + * This walks through whole tree and not just first level children.
> > + */
> > +static int find_next_iomem_res(struct resource *res, char *name)
> > +{
> > +	resource_size_t start, end;
> > +	struct resource *p;
> > +
> > +	BUG_ON(!res);
> > +
> > +	start = res->start;
> > +	end = res->end;
> > +	BUG_ON(start >= end);
> > +
> > +	read_lock(&resource_lock);
> > +	p = &iomem_resource;
> > +	while ((p = next_resource(p))) {
> 
> Just a thought - this function differs from find_next_system_ram() only
> in the traversal mode through resources. I wonder if next_resource()
> could be given a flag, say TRAVERSE_SIBLINGS_ONLY or so and be called
> from both, once with the flag set and once without and thus save us the
> code duplication.

Yep, that makes sense. I will change it and start passing a flag.

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ