linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <michael.hennerich@analog.com>
To: gregkh@suse.de
Cc: jic23@cam.ac.uk, uclinux-dist-devel@blackfin.uclinux.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	Michael Hennerich <Michael.Hennerich@analog.com>
Subject: [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
Date: Mon, 26 Apr 2010 10:49:10 +0200	[thread overview]
Message-ID: <1272271750-6182-1-git-send-email-michael.hennerich@analog.com> (raw)

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) {

             reply	other threads:[~2010-04-26  8:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26  8:49 michael.hennerich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-09 13:00 [PATCH] iio_trigger_find_by_name: Skip trailing newline if available Hennerich, Michael

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1272271750-6182-1-git-send-email-michael.hennerich@analog.com \
    --to=michael.hennerich@analog.com \
    --cc=gregkh@suse.de \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).