From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD26AFBE5 for ; Fri, 22 Dec 2023 09:48:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C8g3yywj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B289BC433C8; Fri, 22 Dec 2023 09:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703238515; bh=HgWUu3jgLiF/HoUr4aEQ4OJhT6SnjVYCiVI9BJj4x84=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C8g3yywjn9FsMA4+sFjx/8s5roswFxukqOU46JZ6HaxqpNs0CgI5s8lGX9DlmYq94 fzxAekFB0Bgc9hfXPxQJyHbg40bUxyWiUyMurz3HwKe2InVKfQ8+CqMe8m0zN4JhFO OUAG0VzKZiUbr7UF6NbKI1EZNE2cXiRCsJf+Ccj+gTz1YwgsV/Jb8dOxdr2mqdKwr+ SNpeb/LaCjgSRNzxsnnb1/C+C0/6y007RbcOjMpeLM0GM1OEVKNehNKFa/8TufItvG oOSZ4mcqRaMjns/AAkW76gO5A4/fV8ZuPu8gRpXqci7yaeYvErOirc27c4KoZgVcmW FDPjVakS03zJg== Date: Fri, 22 Dec 2023 10:48:32 +0100 From: Wolfram Sang To: Hans Hu Cc: andi.shyti@kernel.org, linux-i2c@vger.kernel.org, cobechen@zhaoxin.com Subject: Re: [PATCH v3 05/12] i2c: wmt: Reduce redundant: function parameter Message-ID: Mail-Followup-To: Wolfram Sang , Hans Hu , andi.shyti@kernel.org, linux-i2c@vger.kernel.org, cobechen@zhaoxin.com References: Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fS/0nGT/kBkKDXee" Content-Disposition: inline In-Reply-To: --fS/0nGT/kBkKDXee Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 02, 2023 at 10:53:55AM +0800, Hans Hu wrote: > Use more appropriate parameter passing to reduce the amount of code >=20 > Signed-off-by: Hans Hu > --- Because I like most cleanups here: applied to for-next, thanks! But this patch likely reveals a bug in the driver: > -static int wmt_i2c_read(struct i2c_adapter *adap, struct i2c_msg *pmsg, > - int last) > +static int wmt_i2c_read(struct wmt_i2c_dev *i2c_dev, struct i2c_msg *pms= g) It is valid for an I2C transfer, that the last message is a read message. So, instead of dropping it, I think the read function needs to handle 'last' as well. Because this bug is already present in the driver, and I don't want to make rebasing a next version of this series too difficult, I argue that we fix it after your changes are included. Happy hacking! --fS/0nGT/kBkKDXee Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmWFW28ACgkQFA3kzBSg KbZeJw//YcCiaL/x2KZAAJaKub7PWCyx0vEwxBhIlRTAMHtg1uZra8esCiQTQMYC vq1Tpxo62v17Ve8eYFsAznPf7V4TKJoVcBMjEZGcROBiofMvgZDKFrsQw/zA+Vla ZzvOxuM/jnFPIobUmTmeJz4j5ZRhgSK/XdSREgiLSq06qK91vUejkGlmAkDVTUwZ SwRrQPpd0gHxIS3cX1kTczNrxN929m57XMRoeFJUpEeAWR2At65kGnseNYnN7PgU 50VqakfPYPVz17muduBzKaxFWWM0fkjO6Q264AMHlVYYq6jWNJ03cHj3+m5X/goi GPi/p5T7Egul644WTotJDs5a02omGzZTeoK6ARwV+AO4PvTjrYcSY1Yl951sHoPi GEDYPG7b13vM+01xUb89jbWvX8X6P2hMvFBDx/XxTIm5+YK2AppSivhidXLpz1ZU IXKlP2B3SPqur9Z8cewQNjQe5POR0LMq/ZoOLRQEN8A3tYdDIdb8jpEp/iA/Oy3E ESgZ0cMlztKbWQBElhnqqI779V47AgAjpzFmPcEM0rDD/tDOhqYkggYGX7ZP9cDQ CSRFlwDXCfPr0hMx5H+iwyL0keGZKufz/u1n+YenS8IulTG1cLhxXxWUeMAvpLut 7zhXNPJYq6LjPPDs5Cflm1ynY8m1dZwaXwalKf1yij264FNstAc= =dxDg -----END PGP SIGNATURE----- --fS/0nGT/kBkKDXee--