From patchwork Tue Dec 18 08:18:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10735085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24E9B924 for ; Tue, 18 Dec 2018 08:19:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 167B629895 for ; Tue, 18 Dec 2018 08:19:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AC76298B6; Tue, 18 Dec 2018 08:19:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA1B829895 for ; Tue, 18 Dec 2018 08:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbeLRITC (ORCPT ); Tue, 18 Dec 2018 03:19:02 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:43710 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726556AbeLRITB (ORCPT ); Tue, 18 Dec 2018 03:19:01 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBI8IvHi093264; Tue, 18 Dec 2018 08:18:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=l5OfBzg2Ea4Jq0OaqUa1cFPR2h7pVmsMadIvSav6pBI=; b=PFKGpz79/bYCYNxae3MFjflyQ0lT7Sn7AcjUqgT2pFepPiHj3KaRI9sXMVoDR7gb0Z0K jvkoYRVvVIoylHt4yvhMZOzOmq67i6HiAY9KQK5X/H3AP7xDJZlXjDMNcalC5LbYd7fI mmVft8XsoeOzngrLNnYs2zNbmqIjCKvFnUDljVCuMMabOpT+PaG7jDxJT6MTqojly3Ql zK9Z5Q3iUUUauZ9Dqh2U99Daj3ebQPQfO9WkfQ6aA/OFY3mJFWSWTTaR4xg6ISxAcqRJ PyoKVLTEELlvgYTfO8h4gOCJVlaodakdUC7R9CCSVaONTp4452Uo0in8aaPBkEWnjIQN kw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2pcs1thpw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 08:18:57 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBI8It5X014930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 08:18:55 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wBI8IsoJ023885; Tue, 18 Dec 2018 08:18:54 GMT Received: from kadam (/197.157.0.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Dec 2018 00:18:53 -0800 Date: Tue, 18 Dec 2018 11:18:54 +0300 From: Dan Carpenter To: Dmitry Torokhov , Sundar Iyer Cc: linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] Input: nomadik-ske-keypad - Fix a loop timeout test Message-ID: <20181218081854.GC32567@kadam> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9110 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=944 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812180075 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The loop exits with "timeout" set to -1 not to 0. Fixes: 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller") Signed-off-by: Dan Carpenter --- drivers/input/keyboard/nomadik-ske-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 8567ee47761e..ae3b04557074 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad) while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--) cpu_relax(); - if (!timeout) + if (timeout == -1) return -EINVAL; /*