Re: [PATCH] [TRIVIAL] kstrdup

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Wed Jan 15 2003 - 01:55:29 EST


In message <87bs2kkl50.fsf@goat.bogus.local> you write:
> +extern void *kmemdup(const void *, __kernel_size_t, int);
> +
> +static inline char *kstrdup(const char *s, int flags)
> + { return kmemdup(s, strlen(s) + 1, flags); }
> +static inline char *strdup(const char *s) { return kstrdup(s, GFP_KERNEL); }

I disagree with this approach. (1) because strdup hides an allocation
assumption: it's too dangerous an interface, (2) because introducing a
new interface is a much bigger deal than consolidating existing ones.

But really, I only keep the kstrdup patch around to irritate Linus.

Thanks!
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:53 EST