linux-iio.vger.kernel.org archive mirror
 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; 7+ 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 related	[flat|nested] 7+ messages in thread
* [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
@ 2010-03-09  9:35 Hennerich, Michael
  2010-03-09 12:42 ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Hennerich, Michael @ 2010-03-09  9:35 UTC (permalink / raw)
  To: Jonathan Cameron, gregkh@suse.de
  Cc: linux-iio@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org

Skip trailing newline if available.

From: Michael Hennerich <Michael.Hennerich@analog.com>

Index: drivers/staging/iio/industrialio-trigger.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 =3D false;

+       if (len && name[len - 1] =3D=3D '\n')
+               len--;
+
        mutex_lock(&iio_trigger_list_lock);
        list_for_each_entry(trig, &iio_trigger_list, list) {
                if (strncmp(trig->name, name, len) =3D=3D 0) {

------------------------------------------------------------------
********* Analog Devices GmbH              Open Platform Solutions
**  *****
**     ** Wilhelm-Wagenfeld-Strasse 6
**  ***** D-80807 Munich
********* Germany
Registergericht M=FCnchen HRB 40368,  Gesch=E4ftsf=FChrer: Thomas Wessel, W=
illiam A. Martin, Margaret K. Seif

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
@ 2010-03-08  9:31 Hennerich, Michael
  2010-03-22 20:37 ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Hennerich, Michael @ 2010-03-08  9:31 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org

Skip trailing newline if available.

From: Michael Hennerich <Michael.Hennerich@analog.com>

Index: drivers/staging/iio/industrialio-trigger.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- 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 =3D false;

+       if (len && name[len - 1] =3D=3D '\n')
+               len--;
+
        mutex_lock(&iio_trigger_list_lock);
        list_for_each_entry(trig, &iio_trigger_list, list) {
                if (strncmp(trig->name, name, len) =3D=3D 0) {

------------------------------------------------------------------
********* Analog Devices GmbH              Open Platform Solutions
**  *****
**     ** Wilhelm-Wagenfeld-Strasse 6
**  ***** D-80807 Munich
********* Germany
Registergericht M=FCnchen HRB 40368,  Gesch=E4ftsf=FChrer: Thomas Wessel, W=
illiam A. Martin, Margaret K. Seif

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

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

Thread overview: 7+ 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  9:35 Hennerich, Michael
2010-03-09 12:42 ` Jonathan Cameron
2010-03-08  9:31 Hennerich, Michael
2010-03-22 20:37 ` Jonathan Cameron
2010-03-23 12:23   ` Hennerich, Michael
2010-03-23 13:46     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).