Module rewrite 6/20: streq
PATCH 1/1 Module rewrite 6/20: streq
Name: streq implementation
Author: Rusty Russell
Status: Trivial
Depends: Misc/strcspn.patch.gz
D: I can't believe that after all these years I still make the "sense
D: of strcmp" mistake. So it's time to reintroduce my favorite macro.
include/linux/string.h +1 -0
@@ -16,6 +16,7 @@ extern char * strpbrk(const char *,constextern char *strsep (char **,const char *);extern __kernel_size_t strspn (const char *,const char *);extern __kernel_size_t strcspn (const char *,const char *); +#define streq (a,b) (strcmp((a),(b)) == 0)/* * Include machine specific inline routines
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Quoted 7 lines · Rusty Russell
Name: streq implementation
Author: Rusty Russell
Status: Trivial
Depends: Misc/strcspn.patch.gzD: I can't believe that after all these years I still make the "sense
D: of strcmp" mistake. So it's time to reintroduce my favorite macro.
So you replace something all the competent programmers understand with some weird Rusty specific macro that just makes it harder still for other people to follow kernel code.
Why ?