Re: resource_size_t printk whinging

From: Geert Uytterhoeven
Date: Tue Feb 27 2007 - 06:03:18 EST


On Mon, 26 Feb 2007, Kyle McMartin wrote:
> I submitted this patch a while ago, but nobody commented on it.
> All these casts of resource_size_t to (unsigned long long) seem horribly
> wasteful to me...
>
> Of course, to add a new format qualifier, we lose out on checking the format
> string by gcc... Nowadays, this role can be done by sparse.

But we don't run sparse on every build. We do run gcc (a lot).

> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -477,6 +478,8 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
> num = (unsigned short) va_arg(args, int);
> if (flags & SIGN)
> num = (signed short) num;
> + } else if (qualifier == 'R' || qualifier == 'R') {
^ ^
One of them must be lowercase `r'.

> + num = va_arg(args, resource_size_t);
> } else {
> num = va_arg(args, unsigned int);
> if (flags & SIGN)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
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/