linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Greg KH <gregkh@suse.de>
Cc: Jonathan Cameron <jic23@cam.ac.uk>, Greg KH <greg@kroah.com>,
	Jonathan Cameron <jic23@kernel.org>,
	devel@driverdev.osuosl.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH] staging:iio: Setup buffer access functions when allocating the buffer
Date: Tue, 13 Dec 2011 10:08:29 +0100	[thread overview]
Message-ID: <4EE7160D.1040208@metafoo.de> (raw)
In-Reply-To: <20111213073831.GB20154@suse.de>

On 12/13/2011 08:38 AM, Greg KH wrote:
> On Tue, Dec 13, 2011 at 07:23:48AM +0000, Jonathan Cameron wrote:
>>
>>
>> Greg KH <greg@kroah.com> wrote:
>>
>>> On Mon, Dec 12, 2011 at 11:09:05AM +0100, Lars-Peter Clausen wrote:
>>>> Setup the buffer access functions in the buffer allocate function.
>>> There is no
>>>> need to let each driver handle this on its own.
>>>
>>> That's nicer.
>>>
>>> So, you have different ways to have "buffers" and the driver doesn't
>>> know what type you have, and it's chosen at build time?  Why are you
>>> making the kernel builder make such a decision?  Why not just pick one,
>>> that you know works well, and use it?
>>>
>>> You would get rid of a whole level of indirection that I really don't
>>> think you need at all, right?
>>
>> Because there is not currently a buffer that suits all use cases.
>> One might be possible but would involve autoswitching between
>> different approaches a hence have this indirection anyway, be it
>> burried. Also note that some of the buffers are hardware.  Plus the
>> pseudo buffer used for in kernel push interfaces is different again.
>> That code has only reached RFC state so far.
> 
> So who choses the buffer type, the driver, or the kernel configurator,
> or something else?
> 
>>> Make a decision, don't force someone else to make it for you...
>> Defaults are sensible. Preventing other peoples use cases are not.
> 
> Ok, but you do agree that this patch is broken as-is, right?

We have different buffer implementations. Each buffer implementation has their
internal data structure, which is only visible to this buffer implementation.
Each buffer implementation provides a set of functions which work on this data
structure. Also each buffer implementation has one function which allocates the
data structure. So the set of functions the buffer implementation provides will
only work on the data structure allocated by the allocation function this
specific buffer implementation provides. Moving the assignment of access
functions inside the allocation function instead of doing it manually in driver
code is obviously the right thing to do.

  parent reply	other threads:[~2011-12-13  9:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 10:09 [PATCH] staging:iio: Setup buffer access functions when allocating the buffer Lars-Peter Clausen
2011-12-13  0:46 ` Greg KH
2011-12-13  7:23   ` Jonathan Cameron
2011-12-13  7:38     ` Greg KH
2011-12-13  8:48       ` J.I. Cameron
2011-12-14  0:00         ` Greg KH
2011-12-14  7:21           ` Jonathan Cameron
2011-12-13  9:08       ` Lars-Peter Clausen [this message]
2011-12-13  0:52 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2011-12-28 11:32 Lars-Peter Clausen
2011-12-31 20:01 ` Jonathan Cameron
2012-01-03 10:02 Lars-Peter Clausen

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=4EE7160D.1040208@metafoo.de \
    --to=lars@metafoo.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=jic23@cam.ac.uk \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.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).