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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 B83E4C43603 for ; Wed, 12 May 2021 17:13:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9933461285 for ; Wed, 12 May 2021 17:13:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbhELRNz (ORCPT ); Wed, 12 May 2021 13:13:55 -0400 Received: from gofer.mess.org ([88.97.38.141]:38857 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237228AbhELQiC (ORCPT ); Wed, 12 May 2021 12:38:02 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 695A3C6387; Wed, 12 May 2021 17:36:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mess.org; s=2020; t=1620837411; bh=zc9wSP/5PcWYTdlf6TKylEppKxg8dlAf3sV4hJ2wvG4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X36RAd/uNzLbxW7hP2mmhN6Z+JtKLXOu9Q5uoJyKBRRsLPO3oYIXb5hIK6IpAWleJ 7z21F7uio3/LgI73Fns+nydzX285A/DmSDwjV4yVQ5HE+Sf54wOskamBNcumZ9CLWC 9u1Yy5+uYFtMhf5Dzy4Mu9iQZ/Yn6BRtWF2uSBLDjBlBzTM8rPCRqCMUa3eThLXah3 +HXQ01IysGuE0Wlxb0r7SWuKrxfea4NxbuknOSEkZHGE+12Qf8p3SquiUozL4yNYVu jJcR2SD+qp0s5nc8/Y6smZPEh+DdhawUaJNMnHx8XMC4W+TNS0/GMzoP4UVUCSz7Vr XaEj7YucoHuLg== Date: Wed, 12 May 2021 17:36:51 +0100 From: Sean Young To: Christophe JAILLET Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] media: rc: i2c: Fix an error message Message-ID: <20210512163651.GA5987@gofer.mess.org> References: <179fb4cda2b79904fc9cf1d7d8e61153e30fae6b.1620279452.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <179fb4cda2b79904fc9cf1d7d8e61153e30fae6b.1620279452.git.christophe.jaillet@wanadoo.fr> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: kernel-janitors@vger.kernel.org On Thu, May 06, 2021 at 07:38:56AM +0200, Christophe JAILLET wrote: > 'ret' is known to be 1 here. In fact 'i' is expected instead. > Store the return value of 'i2c_master_recv()' in 'ret' so that the error > message print the correct error code. Nice catch, applied! Thanks Sean > > Fixes: acaa34bf06e9 ('media: rc: implement zilog transmitter") > Signed-off-by: Christophe JAILLET > --- > drivers/media/i2c/ir-kbd-i2c.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c > index e8119ad0bc71..92376592455e 100644 > --- a/drivers/media/i2c/ir-kbd-i2c.c > +++ b/drivers/media/i2c/ir-kbd-i2c.c > @@ -678,8 +678,8 @@ static int zilog_tx(struct rc_dev *rcdev, unsigned int *txbuf, > goto out_unlock; > } > > - i = i2c_master_recv(ir->tx_c, buf, 1); > - if (i != 1) { > + ret = i2c_master_recv(ir->tx_c, buf, 1); > + if (ret != 1) { > dev_err(&ir->rc->dev, "i2c_master_recv failed with %d\n", ret); > ret = -EIO; > goto out_unlock; > -- > 2.30.2