Re: [PATCH] Fix broken debug output reserve_region_with_split()

From: Benjamin Herrenschmidt
Date: Thu Oct 16 2008 - 23:48:26 EST



> >
> > +static char *resource_string(char *buf, char *end, struct resource *res, int field_width, int precision, int flags)
> > +{
> > + /* room for the actual numbers, the two "0x", -, [, ] and the final zero */
> > + char sym[4*sizeof(resource_size_t) + 8];
> > + char *p = sym, *pend = sym + sizeof(sym);
> > +
> > + *p++ = '[';
> > + p = number(p, pend, res->start, 16, -1, -1, SPECIAL | SMALL);
> > + *p++ = '-';
> > + p = number(p, pend, res->end, 16, -1, -1, SPECIAL | SMALL);
> > + *p++ = ']';
> > + *p = 0;
> > +
> > + return string(buf, end, sym, field_width, precision, flags);
>
> so x64 64bit,io ports will be print out 8 digital?

With that patch, it will use just as many digits as necessary to display
a given number. The question I'm asking in the comments is whether we
want to instead use fixed digits with zero padding, and in that case,
do we want a hook or something for archs to decide how many digits
for IO vs. memory.

But at least with that in, we can start converting callers. I have a
patch converting PCI that I'll post once that goes in and I'll start
scrubbing arch/powerpc soon.

Cheers,
Ben.

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