[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e4f803b-9416-e7fc-a001-16d4a5850e84@roeck-us.net>
Date: Thu, 19 Jan 2017 00:25:45 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Joe Perches <joe@...ches.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of
dereferencing it and other changes
On 01/18/2017 08:58 PM, Joe Perches wrote:
> On Wed, 2017-01-18 at 12:35 -0800, Guenter Roeck wrote:
>> On Wed, Jan 18, 2017 at 11:39:52AM -0800, Dmitry Torokhov wrote:
>>> On Wed, Jan 18, 2017 at 09:46:34AM -0800, Guenter Roeck wrote:
> []
>>>> diff --git a/drivers/input/misc/bfin_rotary.c b/drivers/input/misc/bfin_rotary.c
> []
>>>> @@ -141,25 +141,23 @@ static int bfin_rotary_probe(struct platform_device *pdev)
>>>>
>>>> /* Basic validation */
>>>> if ((pdata->rotary_up_key && !pdata->rotary_down_key) ||
>>>> - (!pdata->rotary_up_key && pdata->rotary_down_key)) {
>>>> + (!pdata->rotary_up_key && pdata->rotary_down_key))
>
> maybe just use ^
>
> if (!pdata->rotary_up_key ^ !pdata->rotary_down_key)
>
Interesting use case for a coccinelle rule.
To address the coccinelle related problem, I modified the rule to only apply
if the expression is in one line, and if the return statement is in the next
line. That works pretty well.
Guenter
Powered by blists - more mailing lists