[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1272271750-6182-1-git-send-email-michael.hennerich@analog.com>
Date: Mon, 26 Apr 2010 10:49:10 +0200
From: <michael.hennerich@...log.com>
To: gregkh@...e.de
CC: jic23@....ac.uk, uclinux-dist-devel@...ckfin.uclinux.org,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
Michael Hennerich <Michael.Hennerich@...log.com>
Subject: [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
Skip trailing newline if available.
Signed-off-by: Michael Hennerich <Michael.Hennerich@...log.com>
Acked-by: Jonathan Cameron <jic23@....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) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists