linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"uclinux-dist-devel@blackfin.uclinux.org"
	<uclinux-dist-devel@blackfin.uclinux.org>
Subject: Re: [PATCH] iio_trigger_find_by_name: Skip trailing newline if available
Date: Tue, 23 Mar 2010 13:46:10 +0000	[thread overview]
Message-ID: <4BA8C622.6090505@cam.ac.uk> (raw)
In-Reply-To: <544AC56F16B56944AEC3BD4E3D5917712E5660F259@LIMKCMBX1.ad.analog.com>

On 03/23/10 12:23, Hennerich, Michael wrote:
> Jonathan Cameron wrote on 2010-03-22:
>> On 03/08/10 09:31, Hennerich, Michael wrote:
>>> Skip trailing newline if available.
>>>
>>> From: Michael Hennerich <Michael.Hennerich@analog.com>
>>
>> Dear Michael,
>>
>> Just found this one whilst trying to sort out a clean iio tree.
>> (sorry I completely failed to reply originally)
>>
>> Anyhow, I agree with the principal that we should be ignoring the
>> newline.  Actually we should be ignoring whitespace before and after
>> the string we are actually after.
> 
> Well - in most cases people use #echo so there shouldn't be a problem with white space before and after.
> However the newline is going to bug in case you don't use #echo -n.
> I've seen many sysfs_set functions also stripping the '\n' from the string.
Actually most uses beyond the debugging drivers stage are likely to be via
userspace libraries, but admittedly these aren't going to have excess white
space so it doesn't matter!


> 
>> Perhaps a cleaner approach is to
>> use sscanf to pull out the string alone?
> 
> sscanf() is certainly a alternative here.
> 
>> I don't think we need to
>> allow for whitespace in the trigger name (though obviously it should
>> be documented if we do not).  Technically I believe (via the
>> convenient lwn article last week on the topic) we should ignore white
>> space but return -EINVAL if there is say one word, some white space
>> and then another word...  Not sure if there is a particularly clean
>> way to do that however.
>>
>> What do you think?
> 
> I agree - Don't allow whitespace in the trigger name.

Alright, I don't really care how we do it, though agree dealing with the newline
is useful, so please send this onto Greg KH (if you haven't?) 

Jonathan

  reply	other threads:[~2010-03-23 13:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08  9:31 [PATCH] iio_trigger_find_by_name: Skip trailing newline if available Hennerich, Michael
2010-03-22 20:37 ` Jonathan Cameron
2010-03-23 12:23   ` Hennerich, Michael
2010-03-23 13:46     ` Jonathan Cameron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-09  9:35 Hennerich, Michael
2010-03-09 12:42 ` Jonathan Cameron
2010-04-26  8:49 michael.hennerich

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=4BA8C622.6090505@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=Michael.Hennerich@analog.com \
    --cc=linux-iio@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).