Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3469564yba; Tue, 7 May 2019 01:33:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwM0v/oXle39H7UsE7HAPNq2jF+h/ZuCMQYJRk3XF11t9krD5ePEjn4mSNNOTWKE0H6/K8y X-Received: by 2002:aa7:8e50:: with SMTP id d16mr38679061pfr.227.1557218024021; Tue, 07 May 2019 01:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557218024; cv=none; d=google.com; s=arc-20160816; b=K3Gofxg9oTqDKfedS5VoEDxZP1lu8DysYjsNCNx6fH0EB8f1+Wo2iwvRxZWAxOuwZ0 U0NcN/BLzRlLZV5ELIV5vOTjc/5CjlJvBdrbTrqCQkd8WPCuyywMG8VgZBvUjBotE31j W0KjjlMdW5/V8cAyahiZDfP9od7x1c8V838TeRTtYcPba8SuS+imhtjJIo5mG/oxvLmE cNF4JNZ2NBqc2vxX0XxEdmIcOE651ERpOl07z88pWgzy65Hk63UBR+xldc6JGbqCcMvB ZxdJYNKZLz35i64NWoauQogLg8RHVGJbRsZMhq1XG0ywpcSPL0+QETfP6XqN+V/KJNKj OH0A== 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; bh=VpqpAGdgFMhw7WY5bho+AwwNvmm8laJiaKnvt4ZT0FA=; b=bdh93lcRd0sYuSEpp7NI2+REv4YUziK4riZYSpQlRfyES4wYoifoHSQKwoihezEuhJ s1aVKInTrksYSeZ4DuQN4Jo/EFj/xMe9DBI92AgAev2XkL70kVpqnuuc/FxzfTInprVA kcg3uxTDQDvj3orRLsYHE0fBFUZfpKwDXFkgTvmfRQ6DK1FJXl0IgJvpUISojvtmR8oT ZkBNYTD34tBbJZ9VLv87B8nG4PKCdV8p/aNXZEw/xuhzSREAJX+F3mTGWSyhH/ZfjwPY B5PUOYn9+q5cjj3QW8w/REgUOgM2IB60auv7CasJtfhRV1+6lBJ+bLjCYOfXwFBo+VJy 7FQA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e26si17417227pfi.54.2019.05.07.01.33.25; Tue, 07 May 2019 01:33:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726928AbfEGIcT (ORCPT + 99 others); Tue, 7 May 2019 04:32:19 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:57173 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfEGIcT (ORCPT ); Tue, 7 May 2019 04:32:19 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hNvWJ-0000Ck-8h; Tue, 07 May 2019 10:32:15 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1hNvWI-0003SX-L7; Tue, 07 May 2019 10:32:14 +0200 Date: Tue, 7 May 2019 10:32:14 +0200 From: Marco Felsch To: Colin King Cc: Dmitry Torokhov , Rob Herring , 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: <20190507083214.rcew5cjfvlbwbov5@pengutronix.de> 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> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:29:30 up 108 days, 13:11, 83 users, load average: 0.00, 0.01, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ian, On 19-05-07 09:21, 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. Thanks for covering that, was an copy 'n' paste failure.. > > 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; I think the proper solution is to add a ret val, because this covers the success/fail. I will send a patch to fix this. Regards, Marco > /* Read Chip ID */ > regmap_read(ts->regmap, QT1050_CHIP_ID, &val); > -- > 2.20.1 > > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |