From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A813C43461 for ; Wed, 16 Sep 2020 06:10:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9D132087D for ; Wed, 16 Sep 2020 06:10:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KBkoEoDK"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="tHgSfo1U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9D132087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=660tibwIMKpz3Tb18X3MZ7T+ye4m5aUwVxFr8fl1jGk=; b=KBkoEoDKYWF0PJBZ9bLlWyXqb 94VVHESGBMTxnOzRPPNRtliICCryct2kWLORTngl8NGu9hV94bOa9p4zWiGkllDC2dRWdA/jqcsf+ x+P2zXb1EKiUq1mRDcLiwXYhWqUzgsXLkoTpXHmX8rEfjnp1XMw0NOlUc/uKpkjVSqsx41pdgCfL5 y9+uBfshZhz4ogkYR8JRmyoDY30vUkYR+BmlZM6KIg3nookZnQHXtRS6pyhcTvi1YVpA7jRBDa7ms vDvXejPa/wsnecthtv0bRKzdJZpEWzxbuyo5NCDKbGghorMQ3qS1AZQC1KrkjSzRo+a6M+TwPVFWH LbWjCkAIQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIQcg-0003ka-O7; Wed, 16 Sep 2020 06:08:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIQcd-0003k7-8U for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 06:08:52 +0000 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19D54221E5 for ; Wed, 16 Sep 2020 06:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600236530; bh=yq+rh/yidum8ufs/ceMkyfzcJR8SkmGhPc5YlK4pJug=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tHgSfo1UbdAD9x6dURfRbzyyfotz9ZBhxm3dW4JLwBxzBD9dHm0P1NyWkaRGPOfI0 cA2iztOi+qNuXMyFFY0qPD3m3Am5owsuWc6YOrJorFoGmOqxFHLE99lW6/0R5LedMS 0deYcA0i2gnVQ4unVDdyyT/RjdQ4AriwyNzBYKd4= Received: by mail-ed1-f46.google.com with SMTP id a12so4995362eds.13 for ; Tue, 15 Sep 2020 23:08:50 -0700 (PDT) X-Gm-Message-State: AOAM5313/C0XYKaNWjNalZ18UpSDq+5dWAgXfZNY1LZY7C0Q6QWVa1Tc uU5v6iNhUL5SLKdCaKUS+Gt7RxRsJzbI1DL5GDQ= X-Google-Smtp-Source: ABdhPJxP81HSvrNQp5Kg5be5vASZ61X4kdfIAE4mMNX3H3Ax1gIcvuHBDdEtIIRGjRc/uSg3wZmhVjn1J9yVFQzvCSs= X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr25553137edb.298.1600236528625; Tue, 15 Sep 2020 23:08:48 -0700 (PDT) MIME-Version: 1.0 References: <20200828145744.3636-1-krzk@kernel.org> <20200828145744.3636-4-krzk@kernel.org> <20200916010140.GG1681290@dtor-ws> In-Reply-To: <20200916010140.GG1681290@dtor-ws> From: Krzysztof Kozlowski Date: Wed, 16 Sep 2020 08:08:36 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 4/4] Input: sun4i-ps2 - Fix handling of platform_get_irq() error To: Dmitry Torokhov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_020851_427803_B5D6E1B4 X-CRM114-Status: GOOD ( 21.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Chen-Yu Tsai , "linux-kernel@vger.kernel.org" , Maxime Ripard , linux-input@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 16 Sep 2020 at 03:01, Dmitry Torokhov wrote: > > On Fri, Aug 28, 2020 at 04:57:44PM +0200, Krzysztof Kozlowski wrote: > > platform_get_irq() returns -ERRNO on error. In such case comparison > > to 0 would pass the check. > > > > Fixes: e443631d20f5 ("Input: serio - add support for Alwinner A10/A20 PS/2 controller") > > Signed-off-by: Krzysztof Kozlowski > > > > --- > > > > Changes since v1: > > 1. None > > --- > > drivers/input/serio/sun4i-ps2.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c > > index a681a2c04e39..7da1ea8741fc 100644 > > --- a/drivers/input/serio/sun4i-ps2.c > > +++ b/drivers/input/serio/sun4i-ps2.c > > @@ -265,9 +265,8 @@ static int sun4i_ps2_probe(struct platform_device *pdev) > > > > /* Get IRQ for the device */ > > irq = platform_get_irq(pdev, 0); > > - if (!irq) { > > - dev_err(dev, "no IRQ found\n"); > > - error = -ENXIO; > > + if (irq < 0) { > > "irq" is unsigned here, so this will not work. I'll change it to use > drvdat->irq which happens to be signed, and drop "irq" variable. Yes, thanks. I wonder now why there was no warning of unsigned<0 comparison. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel