From patchwork Thu Jan 7 23:22:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 7980361 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C05229F38D for ; Thu, 7 Jan 2016 23:22:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D874620172 for ; Thu, 7 Jan 2016 23:22:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC69020142 for ; Thu, 7 Jan 2016 23:22:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753538AbcAGXWk (ORCPT ); Thu, 7 Jan 2016 18:22:40 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:36457 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753792AbcAGXWd (ORCPT ); Thu, 7 Jan 2016 18:22:33 -0500 Received: by mail-pf0-f179.google.com with SMTP id n128so417366pfn.3; Thu, 07 Jan 2016 15:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=+Lud9H/9HaRvi1AWAYU97Co51oBHoYAXLgH+bIujVuE=; b=rAohy2T00T9SvCHCIpkNzWXmH7eu6JNpAQyv8pbFN+kKl2VgDQH1QW+RnKPRR620JW NOEOOe/gwDpOZAb5+038dIkQnS6ppgZIzems/QLFr4/ge5l3IAvM4EWF8ZEC+BXJcInb OOLwJSI7m0DxLw9Wb9ue60Up+9z9MTxTd9MDVQJ4xrAC6+RANmUs8gUQcJusSjnCeQQ9 ZtnB15Qc6IDYldlMKMU4lJG21IQRgQP+0dN6Xp5J7Px9KDOy8CvLco0lkG6B2L9bzd+q eyu0zr28YJjL1ABOOHOFYxMD6P7OPfly1u7ls25JK4SsEqLxvad0Tj6asySpUUEO5NP1 cftQ== X-Received: by 10.98.72.200 with SMTP id q69mr215193pfi.159.1452208952510; Thu, 07 Jan 2016 15:22:32 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:3438:d31f:8a03:32e6]) by smtp.gmail.com with ESMTPSA id n5sm102754pfi.3.2016.01.07.15.22.29 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 07 Jan 2016 15:22:30 -0800 (PST) Date: Thu, 7 Jan 2016 15:22:28 -0800 From: Dmitry Torokhov To: Tony Lindgren Cc: Dan Carpenter , Komal Shah , "linux-input@vger.kernel.org" , Janusz Krzysztofik , Aaro Koskinen , linux-omap@vger.kernel.org Subject: Re: [PATCH] OMAP: Add keypad driver Message-ID: <20160107232228.GA20533@dtor-ws> References: <20160107093751.GD27186@mwanda> <20160107201316.GF12600@atomide.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160107201316.GF12600@atomide.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jan 07, 2016 at 12:13:17PM -0800, Tony Lindgren wrote: > Hi, > > * Dmitry Torokhov [160107 10:54]: > > On Thu, Jan 7, 2016 at 1:37 AM, Dan Carpenter wrote: > > > Hello file (standard input) matches, > > > > > > The patch ad4e09b16ad3: "[PATCH] OMAP: Add keypad driver", leads to the > > > following static checker warning: > > > > > > drivers/input/keyboard/omap-keypad.c:158 omap_kp_tasklet() > > > warn: 'keycodes[]' is never negative. > > > > It looks like you are not resolving commits correctly, the original > > submission did not have this issue. > > > > > > > > drivers/input/keyboard/omap-keypad.c > ... > > > 152 #ifdef NEW_BOARD_LEARNING_MODE > > > 153 printk(KERN_INFO "omap-keypad: key %d-%d %s\n", col, > > > 154 row, (new_state[col] & (1 << row)) ? > > > 155 "pressed" : "released"); > > > 156 #else > > > 157 key = keycodes[MATRIX_SCAN_CODE(row, col, row_shift)]; > > > 158 if (key < 0) { > > > ^^^^^^^ > > > Never true. Not sure what was intended. > > > > It looks like this check was broken by > > da1f026b532ce944d74461497dc6d8c16456466e (Keyboard: omap-keypad: use > > matrix_keypad.h). Previously the driver would expect a list of known > > keys and would scan it and return -1 if key was not found. Now we have > > 2 options: > > > > 1. Simply remove the check > > 2. Change the condition to "if (key == KEY_RESERVED)" > > > > I do not really have preference. Tony? > > Sounds like the check is not needed if it has not been used for > past five years, so my preference is option #1 then. OK, how about the below then? Acked-by: Aaro Koskinen diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 75ad666..e0d72c8 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -155,14 +155,6 @@ static void omap_kp_tasklet(unsigned long data) "pressed" : "released"); #else key = keycodes[MATRIX_SCAN_CODE(row, col, row_shift)]; - if (key < 0) { - printk(KERN_WARNING - "omap-keypad: Spurious key event %d-%d\n", - col, row); - /* We scan again after a couple of seconds */ - spurious = 1; - continue; - } if (!(kp_cur_group == (key & GROUP_MASK) || kp_cur_group == -1))