mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
@ 2010-04-26  8:49 michael.hennerich
  0 siblings, 0 replies; 2+ messages in thread
From: michael.hennerich @ 2010-04-26  8:49 UTC (permalink / raw)
  To: gregkh
  Cc: jic23, uclinux-dist-devel, linux-kernel, linux-iio, Michael Hennerich

Skip trailing newline if available.

Signed-off-by: Michael Hennerich <Michael.Hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>

 drivers/staging/iio/industrialio-trigger.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/iio/industrialio-trigger.c b/drivers/staging/iio/industrialio-trigger.c
index 693ebc4..5f76fc1 100644
--- a/drivers/staging/iio/industrialio-trigger.c
+++ b/drivers/staging/iio/industrialio-trigger.c
@@ -155,6 +155,9 @@ struct iio_trigger *iio_trigger_find_by_name(const char *name, size_t len)
 	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) {

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
@ 2010-03-09 13:00 Hennerich, Michael
  0 siblings, 0 replies; 2+ messages in thread
From: Hennerich, Michael @ 2010-03-09 13:00 UTC (permalink / raw)
  To: gregkh; +Cc: linux-iio, LKML, uclinux-dist-devel, Jonathan Cameron

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-26  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26  8:49 [PATCH] iio_trigger_find_by_name: Skip trailing newline if available michael.hennerich
  -- strict thread matches above, loose matches on Subject: below --
2010-03-09 13:00 Hennerich, Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®