From: James Hogan <james.hogan@imgtec.com>
To: "David Härdeman" <david@hardeman.nu>
Cc: linux-media@vger.kernel.org, m.chehab@samsung.com
Subject: Re: [PATCH 05/11] rc-core: split dev->s_filter
Date: Fri, 04 Apr 2014 00:27:29 +0100 [thread overview]
Message-ID: <3169568.oAQQsFv03l@radagast> (raw)
In-Reply-To: <20140329161111.13234.73883.stgit@zeus.muc.hardeman.nu>
[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]
Hi David,
On Saturday 29 March 2014 17:11:11 David Härdeman wrote:
> Overloading dev->s_filter to do two different functions (set wakeup filters
> and generic hardware filters) makes it impossible to tell what the
> hardware actually supports, so create a separate dev->s_wakeup_filter and
> make the distinction explicit.
>
> Signed-off-by: David Härdeman <david@hardeman.nu>
> ---
> @@ -1121,9 +1126,11 @@ static ssize_t store_filter(struct device *device,
> if (ret < 0)
> return ret;
>
> - /* Scancode filter not supported (but still accept 0) */
> - if (!dev->s_filter && fattr->type != RC_FILTER_NORMAL)
> - return val ? -EINVAL : count;
> + /* Can the scancode filter be set? */
> + set_filter = (fattr->type == RC_FILTER_NORMAL)
> + ? dev->s_filter : dev->s_wakeup_filter;
> + if (!set_filter)
> + return -EINVAL;
Technically the removal of the "fattr->type != RC_FILTER_NORMAL" condition and
returning -EINVAL rather than "val ? -EINVAL : count" should be in patch 6
since it's for generic scancode filter support.
> - if (dev->s_filter) {
> - ret = dev->s_filter(dev, fattr->type, &local_filter);
> - if (ret < 0)
> - goto unlock;
> - }
> +
> + ret = set_filter(dev, &local_filter);
> + if (ret < 0)
> + goto unlock;
same here for removing the if condition.
Otherwise this patch looks okay to me.
Cheers
James
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-04-03 23:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-29 16:10 [PATCH 00/11] rc-core: My current patch queue David Härdeman
2014-03-29 16:10 ` [PATCH 01/11] bt8xx: fixup RC5 decoding David Härdeman
2014-03-29 16:10 ` [PATCH 02/11] rc-core: improve ir-kbd-i2c get_key functions David Härdeman
2014-03-29 16:11 ` [PATCH 03/11] rc-core: document the protocol type David Härdeman
2014-03-31 9:54 ` James Hogan
2014-03-31 19:39 ` David Härdeman
2014-03-29 16:11 ` [PATCH 04/11] rc-core: do not change 32bit NEC scancode format for now David Härdeman
2014-03-31 9:09 ` James Hogan
2014-03-29 16:11 ` [PATCH 05/11] rc-core: split dev->s_filter David Härdeman
2014-04-03 23:27 ` James Hogan [this message]
2014-03-29 16:11 ` [PATCH 06/11] rc-core: remove generic scancode filter David Härdeman
2014-03-31 9:29 ` James Hogan
2014-03-31 19:38 ` David Härdeman
2014-03-31 22:01 ` James Hogan
2014-03-29 16:11 ` [PATCH 07/11] dib0700: NEC scancode cleanup David Härdeman
2014-03-29 16:11 ` [PATCH 08/11] lmedm04: " David Härdeman
2014-03-29 16:11 ` [PATCH 09/11] saa7134: NEC scancode fix David Härdeman
2014-03-29 16:11 ` [PATCH 10/11] [RFC] rc-core: use the full 32 bits for NEC scancodes David Härdeman
2014-03-31 9:44 ` James Hogan
2014-03-31 10:19 ` David Härdeman
2014-03-31 10:56 ` James Hogan
2014-03-31 13:22 ` David Härdeman
2014-03-31 14:06 ` James Hogan
2014-03-31 15:26 ` Mauro Carvalho Chehab
2014-03-31 16:47 ` David Härdeman
2014-03-31 12:14 ` Mauro Carvalho Chehab
2014-03-31 12:58 ` David Härdeman
2014-03-31 13:15 ` Mauro Carvalho Chehab
2014-03-31 13:54 ` David Härdeman
2014-03-29 16:11 ` [PATCH 11/11] [RFC] rc-core: don't throw away protocol information David Härdeman
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=3169568.oAQQsFv03l@radagast \
--to=james.hogan@imgtec.com \
--cc=david@hardeman.nu \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
/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