[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071024205701.GF27248@parisc-linux.org>
Date: Wed, 24 Oct 2007 14:57:01 -0600
From: Matthew Wilcox <matthew@....cx>
To: Joe Perches <joe@...ches.com>
Cc: Linus Torvalds <torvalds@...l.org>, Andrew Morton <akpm@...l.org>,
linux-kernel@...r.kernel.org
Subject: Re: Stringbuf, v2
On Wed, Oct 24, 2007 at 01:51:37PM -0700, Joe Perches wrote:
> On Wed, 2007-10-24 at 13:58 -0600, Matthew Wilcox wrote:
> > - Pass a gfp_t to sb_printk
>
> sb_printf
indeed.
> As it doesn't actually output anything but extends
> a buffer pointer in a struct, perhaps it's better to
> rename sb_printf to sb_sprintf.
printf prints to stdout. fprintf prints to a file. sprintf prints to
a string. sb_printf prints to an sb.
> I believe the common use will be GFP_ATOMIC.
An interesting belief. Of the three users I've converted, one uses
GFP_ATOMIC and two use GFP_KERNEL.
> Perhaps a default wrapper define and a renamed function?
>
> void sb_sprintf_gfp(struct stringbuf *sb, gfp_t gfp, const char *fmt, ...)
>
> #define sb_sprintf(sb, fmt, arg...) \
> sb_sprintf_gfp(sb, GFP_ATOMIC, fmt, ##arg)
If you look at the patches, you'll see that they basically all have a
wrapper around sb_printf that I was able to insert the GFP argument
into, so I don't see this as a win. I hadn't bothered with one for
ISDN, and that one involved much more editing.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
-
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