linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nelson Castillo" <arhuaco@freaks-unidos.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	andy@openmoko.com
Subject: Re: [PATCH 1/5] Add touchscreen filter API
Date: Fri, 16 Jan 2009 08:28:58 -0500	[thread overview]
Message-ID: <2accc2ff0901160528m31effcc9rc49418b4c826caf6@mail.gmail.com> (raw)
In-Reply-To: <20090115225532.8491d671.akpm@linux-foundation.org>

On Fri, Jan 16, 2009 at 1:55 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Fri, 16 Jan 2009 00:05:20 -0500 "Nelson Castillo" <arhuaco@freaks-unidos.net> wrote:
>
>> On Thu, Jan 15, 2009 at 6:47 PM, Andrew Morton
>> <akpm@linux-foundation.org> wrote:
>> > On Tue, 13 Jan 2009 18:39:39 -0500
>> > Nelson <arhuaco@freaks-unidos.net> wrote:
>> >
>> >> From: Nelson Castillo <arhuaco@freaks-unidos.net>
>> >>
>> >> Generic filters are not useful by themselves. They define an API that
>> >> actual filters have to implement.
>> >>
>> >> Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
>> >> ---
>>
>> (cut)
>>
>> >> +int ts_filter_create_chain(struct platform_device *pdev,
>> >> +                        struct ts_filter_api **api, void **config,
>> >> +                        struct ts_filter **list, int count_coords)
>> >> +{
>> >> +     int count = 0;
>> >> +     struct ts_filter *last = NULL;
>> >> +
>> >> +     if (!api)
>> >> +             return 0;
>> >> +
>> >> +     while (*api && count < MAX_TS_FILTER_CHAIN) {
>> >
>> >Why does MAX_TS_FILTER_CHAIN exist?  Why impose limits?
>>
>> "api" is actually a static array that is not zero_terminated by
>> convention. It can be zero-terminated, though. This check avoids
>> overrunning the loop if MAX_TS_FILTER_CHAIN filters are used.
>>
>> This snippet is taken from mach-gta02.c (link below) and
>> "filter_sequence" is what
>> we pass as the "api" array.
>>
>> static struct s3c2410_ts_mach_info gta02_ts_cfg = {
>>         .delay = 10000,
>>         .presc = 0xff, /* slow as we can go */
>>         .filter_sequence = {
>>                 [0] = &ts_filter_group_api,
>>                 [1] = &ts_filter_median_api,
>>                 [2] = &ts_filter_mean_api,
>>                 [3] = &ts_filter_linear_api,
>>         },
>>         .filter_config = {
>>                 [0] = &gta02_ts_group_config,
>>                 [1] = &gta02_ts_median_config,
>>                 [2] = &gta02_ts_mean_config,
>>                 [3] = &gta02_ts_linear_config,
>>         },
>> };
>
> so...  change the interface to require that the array be
> null-terminated, then fix callers.
>
> Null-terminating variable-length arrays in this manner is a quite
> common paradigm in the kernel.

Sure. We will change it.

>> >> diff --git a/drivers/input/touchscreen/ts_filter.c b/drivers/input/touchscreen/ts_filter.c
>> >> new file mode 100644
>> >> index 0000000..1508388
>> >> --- /dev/null
>> >> +++ b/drivers/input/touchscreen/ts_filter.c
>> >
>> > Confused.  Nothing appears to use the two functions which this file adds.
>>
>> http://git.openmoko.org/?p=kernel.git;a=shortlog;h=stable-tracking
>>
>> This branch is tracking the upstream Linux kernel and patches are
>> rebased/updated
>> when things change upstream. Openmoko has been doing this since one
>> goal is to be able to use upstream kernels with no patches for OM
>> devices.
>>
>> This is the driver can use the filters (s3c2410_ts.c) if they are
>> defined in the machine configuration:
>>
>> http://git.openmoko.org/?p=kernel.git;a=blob_plain;f=drivers/input/touchscreen/s3c2410_ts.c;hb=stable-tracking
>>
>> We are ready to send this driver upstream but before we need to trim
>> this file (mach-gta02.c) and send it:
>>
>> http://git.openmoko.org/?p=kernel.git;a=blob_plain;f=arch/arm/mach-s3c2440/mach-gta02.c;hb=stable-tracking
>>
>> We are depending on this mach-gta02.c file now and a streamlined
>> version of it must be sent upstream so that we can start adding
>> drivers. This file in turn depends on patches that are being sent
>> upstream also.
>>
>> Thus we have a chicken and egg problem and we decided to send the
>> filters for review because they are in the stable-tracking branch and
>> they need to be suitable for upstream inclusion / included upstream.
>
> Please hold off on the unused code until some code which actually uses
> is is submitted as well.

Sure, thanks for the review.

  reply	other threads:[~2009-01-16 13:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13 23:39 [PATCH 0/5][RFC] Touchscreen filters Nelson Castillo
2009-01-13 23:39 ` [PATCH 1/5] Add touchscreen filter API Nelson
2009-01-15 23:47   ` Andrew Morton
2009-01-16  5:05     ` Nelson Castillo
2009-01-16  6:55       ` Andrew Morton
2009-01-16 13:28         ` Nelson Castillo [this message]
2009-01-16  5:06     ` Nelson Castillo
2009-01-13 23:39 ` [PATCH 2/5] Add group filter Nelson
2009-01-15 23:47   ` Andrew Morton
2009-01-13 23:39 ` [PATCH 3/5] Add median filter Nelson
2009-01-15 23:47   ` Andrew Morton
2009-01-13 23:40 ` [PATCH 4/5] Add mean filter Nelson
2009-01-13 23:40 ` [PATCH 5/5] Add linear filter Nelson

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=2accc2ff0901160528m31effcc9rc49418b4c826caf6@mail.gmail.com \
    --to=arhuaco@freaks-unidos.net \
    --cc=akpm@linux-foundation.org \
    --cc=andy@openmoko.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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).