linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
To: "ardeleanalex@gmail.com" <ardeleanalex@gmail.com>,
	"andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>
Cc: "namhyung@kernel.org" <namhyung@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
	"mingo@kernel.org" <mingo@kernel.org>
Subject: Re: [PATCH 1/2] lib: add __sysfs_match_string_with_gaps() helper
Date: Wed, 8 May 2019 11:34:42 +0000	[thread overview]
Message-ID: <904d4156a45a6f74ffdb4ef260498d91671b351c.camel@analog.com> (raw)
In-Reply-To: <20190506144620.GM9224@smile.fi.intel.com>

On Mon, 2019-05-06 at 17:46 +0300, andriy.shevchenko@linux.intel.com wrote:
> [External]
> 
> 
> On Mon, May 06, 2019 at 04:45:43PM +0300, Alexandru Ardelean wrote:
> > On Fri, Apr 26, 2019 at 5:27 PM andriy.shevchenko@linux.intel.com
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > 
> > > On Fri, Apr 26, 2019 at 12:29:11PM +0300, Alexandru Ardelean wrote:
> > > 
> > > > Hmm, I actually did not give much thought to that -1.
> > > > I'll check into this and see about a V3.
> > > > It may make more sense to just fix the original
> > > > `__sysfs_match_string()`, but I'll need to go through the users of
> > > > this function and see.
> > > 
> > > I was thinking about existing users of such (with "gaps") cases.
> > > Not all of them have NULL there and would like to avoid some members.
> > > Though, I think that we may ignore NULL items if -1 is supplied.
> > > 
> > > Think as well about ARRAY_SIZE() as given to that.
> > > 
> > 
> > I am a bit vague on what you are proposing.
> > Is it:
> > 
> > a) Leave __sysfs_match_string() as-is and introduce a new
> > `__sysfs_match_string_with_gaps()` helper/variant ?
> > b) Fix __sysfs_match_string() to break/exit on the first NULL, only if
> > -1 is provided ?
> > 
> > Either is fine, but I wanted to clarify.
> 
> The current logic something like "-1 to go till first NULL" and
> ARRAY_SIZE() in
> *some* cases is basically the synonym to above.
> 
> What I meant is to check if there is *any* case where ARRAY_SIZE()
> behaves in
> the same way as -1. Those cases should be fixed accordingly.
> 
> Otherwise, the b) is what would be preferred according to the discussion.
> 

Ack.

I sent a series.
I guess this is the noisiest I've ever been.
And I feel a bit bad/guilty [for generating that much noise], but I'll
probably grab a beer later to treat it.

I'll probably learn something from this.
Guilt-tripped experiences are pretty learnful.

Thanks
Alex

> > > And consider to fix match_string() accordingly.
> 
> --
> With Best Regards,
> Andy Shevchenko
> 
> 

      reply	other threads:[~2019-05-08 11:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22  8:32 [PATCH 1/2] lib: add __sysfs_match_string_with_gaps() helper Alexandru Ardelean
2019-04-22  8:32 ` [PATCH 2/2] iio: Handle enumerated properties with gaps Alexandru Ardelean
2019-04-22 10:38   ` Jonathan Cameron
2019-04-22 14:03   ` [PATCH 2/2][V2] " Alexandru Ardelean
2019-04-22 10:37 ` [PATCH 1/2] lib: add __sysfs_match_string_with_gaps() helper Jonathan Cameron
2019-04-22 11:16   ` Ardelean, Alexandru
2019-04-22 14:02 ` [PATCH 1/2][V2] " Alexandru Ardelean
2019-04-22 21:06 ` [PATCH 1/2] " Greg KH
2019-04-23  6:38   ` Ardelean, Alexandru
2019-04-24 12:34     ` Jonathan Cameron
2019-04-25 19:37       ` gregkh
2019-04-26  9:29         ` Alexandru Ardelean
2019-04-26 14:27           ` andriy.shevchenko
2019-05-06 13:45             ` Alexandru Ardelean
2019-05-06 14:46               ` andriy.shevchenko
2019-05-08 11:34                 ` Ardelean, Alexandru [this message]

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=904d4156a45a6f74ffdb4ef260498d91671b351c.camel@analog.com \
    --to=alexandru.ardelean@analog.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ardeleanalex@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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).