]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
Add a new sysfs_streq() string comparison function
authorDavid Brownell <david-b@pacbell.net>
Thu, 1 May 2008 11:34:42 +0000 (04:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 May 2008 15:03:59 +0000 (08:03 -0700)
commit34990cf702bdf2b4964e0629dab4af7669f8b2c5
tree33ec40ee97be1a9a6b3565dcf49d1dcffff191f9
parent7dffa3c673fbcf835cd7be80bb4aec8ad3f51168
Add a new sysfs_streq() string comparison function

Add a new sysfs_streq() string comparison function, which ignores
the trailing newlines found in sysfs inputs.  By example:

sysfs_streq("a", "b") ==> false
sysfs_streq("a", "a") ==> true
sysfs_streq("a", "a\n") ==> true
sysfs_streq("a\n", "a") ==> true

This is intended to simplify parsing of sysfs inputs, letting them
avoid the need to manually strip off newlines from inputs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/string.h
lib/string.c