[PATCH] iio_trigger_find_by_name: Skip trailing newline if available
From: Hennerich, Michael
Date: Tue Mar 09 2010 - 08:00:48 EST
Skip trailing newline if available.
Signed-off-by: Michael Hennerich <Michael.Hennerich@xxxxxxxxxx>
Acked-by: Jonathan Cameron <jic23@xxxxxxxxx>
Index: drivers/staging/iio/industrialio-trigger.c
===================================================================
--- drivers/staging/iio/industrialio-trigger.c (revision 8368)
+++ drivers/staging/iio/industrialio-trigger.c (working copy)
@@ -155,6 +155,9 @@
struct iio_trigger *trig;
bool found = false;
+ if (len && name[len - 1] == '\n')
+ len--;
+
mutex_lock(&iio_trigger_list_lock);
list_for_each_entry(trig, &iio_trigger_list, list) {
if (strncmp(trig->name, name, len) == 0) {
------------------------------------------------------------------
********* Analog Devices GmbH Open Platform Solutions
** *****
** ** Wilhelm-Wagenfeld-Strasse 6
** ***** D-80807 Munich
********* Germany
Registergericht München HRB 40368, Geschäftsführer: Thomas Wessel, William A. Martin, Margaret K. Seif
--
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/