Messages in this thread Patch in this message | | | From | "Hennerich, Michael" <> | Date | Tue, 9 Mar 2010 13:00:38 +0000 | Subject | [PATCH] iio_trigger_find_by_name: Skip trailing newline if available |
| |
Skip trailing newline if available.
Signed-off-by: Michael Hennerich <Michael.Hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |