lkml.org 
[lkml]   [2008]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 22/53] PNP: factor pnp_init_resource_table() and pnp_clean_resource_table()
Date
On Friday 18 April 2008 4:29:15 pm Rene Herman wrote:
> On 18-04-08 22:50, Bjorn Helgaas wrote:
> > Move the common part of pnp_init_resource_table() and
> > pnp_clean_resource_table() into a new pnp_init_resource().
> > This reduces a little code duplication and will be
> > useful later to initialize an individual resource.
>
> This can't be right, can it? :
> > +void pnp_init_resource(struct resource *res)
> > +{
> > + unsigned long type;
> > +
> > + type = res->flags & (IORESOURCE_IO | IORESOURCE_MEM |
> > + IORESOURCE_IRQ | IORESOURCE_DMA);
> > +
> > + res->name = NULL;
> > + res->flags = type | IORESOURCE_AUTO | IORESOURCE_UNSET;
> > + if (type == IORESOURCE_IRQ || type == IORESOURCE_DMA) {
> > + res->start = -1;
> > + res->end = -1;
> > + } else {
> > + res->start = 0;
> > + res->end = 0;
> > + }
> > +}
>
> This depends on the type already being set in res->flags, yet:

Yep, you're right. I fixed it, but it requires changes to a couple
other patches down the line, so I'll wait to repost the series until
next week in case you find more problems.

I think this is only a problem for bisection. By the time you
apply the whole series, we start with an empty resource list, and
every time we add one, we set the type in pnp_new_resource().

That makes me wonder whether pnp_init_resources() should just
free the whole list, so we just start again with an empty list.

Bjorn


\
 
 \ /
  Last update: 2008-04-19 06:05    [W:0.088 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site