From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751226AbdASI0P (ORCPT ); Thu, 19 Jan 2017 03:26:15 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:50155 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbdASI0N (ORCPT ); Thu, 19 Jan 2017 03:26:13 -0500 Subject: Re: [PATCH 13/33] Input: bfin_rotary - Use 'dev' instead of dereferencing it and other changes To: Joe Perches , Dmitry Torokhov References: <1484761614-12225-1-git-send-email-linux@roeck-us.net> <1484761614-12225-14-git-send-email-linux@roeck-us.net> <20170118193952.GG33920@dtor-ws> <20170118203517.GB6807@roeck-us.net> <1484801932.18392.1.camel@perches.com> Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org From: Guenter Roeck Message-ID: <3e4f803b-9416-e7fc-a001-16d4a5850e84@roeck-us.net> Date: Thu, 19 Jan 2017 00:25:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1484801932.18392.1.camel@perches.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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