Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3465842yba; Tue, 7 May 2019 01:29:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOF8mPpihOSQbMDI17I2/HMPkL1z5/a6nAO8h0dg4lE1YdlSAtBpMuvste8+sIuEcmw4OZ X-Received: by 2002:a17:902:904a:: with SMTP id w10mr38590025plz.156.1557217753313; Tue, 07 May 2019 01:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557217753; cv=none; d=google.com; s=arc-20160816; b=cpYHOuXbhs8w3ARflOPYCqQzwcmCVgT/vloET1CxfaaUBh+sTwvCgPt3P6P4G7z7Hx 4SRCxtkrI7GrsQG9cIm9R/RvG2GASchPN2OX2AzJir9Ran8fpePUnqtMvWgXivQa5rTD uENq9luA8lRHRMXA+eGKMGmBmsKBEwcs9kjBQN69udrm/IgPJo8jasy9CRgkER/PeITu lRmBVhFCGNUrhOdRUK2a5QfvPuE3vri4hZSd4vc9P3fEK/11E0CIAzS5ymG59aY2ED8k qoCRBkZVisgcPRfbfSsT3RzAEYO5Kyj/Y2+pNsUK5lPy0uqxVFweIw0kg7VQMKOKyOgA 56Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2q+SX5ysM+eJgpkwPBbiklVLVKN4lqt4X/eshikVH0g=; b=hqe3wA1sirC1cVDGwpbZmgXk63JJ9wVWI3mKVMt9E01RkkV5kb8LMH8+7LaVriJG7R kWjn+sksNqgjEjpkHJZkBXqcBqxGOaBQqVjxWN3zoHxgXKHELQlPYGWdA3cJiH5ibOS1 ceGyuzi3TY0an+wWY3h30kRozStYUcmDaOnPf+2bofuoIoRb6okCUGtp3VFd18m10bqK w6jYnPaIov9aICVyqojxg4YClge3xkSZPCygPOPWuKxsufsCUY5Bd3ANMfadf8xhGCqQ pEaw84ZLMuHAs4CPTmeciQkMuimfu31ICppt/ci5hcn3Tl9ShfNwWHtw1DcgssaHtu/t 8EPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=KNYFLCSO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b36si18868168pla.353.2019.05.07.01.28.56; Tue, 07 May 2019 01:29:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=KNYFLCSO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726381AbfEGI2G (ORCPT + 99 others); Tue, 7 May 2019 04:28:06 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33534 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbfEGI2G (ORCPT ); Tue, 7 May 2019 04:28:06 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x478JPdb108465; Tue, 7 May 2019 08:27:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=2q+SX5ysM+eJgpkwPBbiklVLVKN4lqt4X/eshikVH0g=; b=KNYFLCSOSKep/Gp8HP7PVdp1dahEu6lCYIaFenvm93nYuYM6nw7pPJDHtSXNKaRFq+VE yL5fXVDa1/lJhZ51dAhVGL7CuThevoEHR1TQSCjakRgO+/jOiAJTKR+gW3WKJhu6vKje 5mP0WmAnnMKkmhE++fpWIefsN3M/iaPiuQWSk4hyNk+DROJvAWw5XPxFaUWh3v6DNLQL NFobibX0/U6lhAEPRXYp/eebBuSaMmvWsSkzmEQMemNgWCZ+0Tp04rGl4SQXsHZ5+R+C kG0kO62v72iYLq7nBCfG2qzx7qZ/2BsJhzWnAwFqDcjU/SoX8PitvBy8M9eWQAg0/IOW 2w== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2s94b0kdxy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 May 2019 08:27:57 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x478Qxt0075221; Tue, 7 May 2019 08:27:56 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2s94b9bk6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 07 May 2019 08:27:56 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x478RpNt018312; Tue, 7 May 2019 08:27:52 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 07 May 2019 01:27:51 -0700 Date: Tue, 7 May 2019 11:27:44 +0300 From: Dan Carpenter To: Colin King Cc: Dmitry Torokhov , Rob Herring , Marco Felsch , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] Input: qt1050: fix less than zero comparison on an unsigned int Message-ID: <20190507082744.GK2269@kadam> References: <20190507082135.21538-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190507082135.21538-1-colin.king@canonical.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9249 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905070055 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9249 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905070055 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 07, 2019 at 09:21:35AM +0100, Colin King wrote: > From: Colin Ian King > > Currently the less than zero comparison of val is always false because > val is an unsigned int. Fix this by making val a signed int. > > Addresses-Coverity: ("Unsigned compared against zero") > Fixes: a33ff45923c8 ("Input: qt1050 - add Microchip AT42QT1050 support") > Signed-off-by: Colin Ian King > --- > drivers/input/keyboard/qt1050.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c > index 6b1603cb7515..4debddb13972 100644 > --- a/drivers/input/keyboard/qt1050.c > +++ b/drivers/input/keyboard/qt1050.c > @@ -222,7 +222,7 @@ static struct regmap_config qt1050_regmap_config = { > > static bool qt1050_identify(struct qt1050_priv *ts) > { > - unsigned int val; > + int val; This code is checking the wrong thing anyway. It should be: int ret; ret = regmap_read(&val); if (ret) return false; regards, dan carpenter