Linux-i2c Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver"
@ 2021-02-09 11:05 Wolfram Sang
  2021-02-26 16:43 ` Jean Delvare
  2021-03-07  5:42 ` Wolfram Sang
  0 siblings, 2 replies; 16+ messages in thread
From: Wolfram Sang @ 2021-02-09 11:05 UTC (permalink / raw)
  To: linux-i2c, Jean Delvare; +Cc: linux-renesas-soc, Wolfram Sang

This reverts commit 34806fc4e7090b34e32fa1110d546ab5ce01a6a0. It was
developed against an experimental kernel. The regular kernel does not
update the new message length to userspace, so the check is always false
positive. We can't change the kernel behaviour because it would break
the ABI. So revert this commit.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Very embarrasing :( I am sorry for this. Jean, maybe this is worth a
4.2.1. release?

 tools/i2ctransfer.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/tools/i2ctransfer.c b/tools/i2ctransfer.c
index f2a4df8..b0e8d43 100644
--- a/tools/i2ctransfer.c
+++ b/tools/i2ctransfer.c
@@ -88,12 +88,7 @@ static void print_msgs(struct i2c_msg *msgs, __u32 nmsgs, unsigned flags)
 		int recv_len = msgs[i].flags & I2C_M_RECV_LEN;
 		int print_buf = (read && (flags & PRINT_READ_BUF)) ||
 				(!read && (flags & PRINT_WRITE_BUF));
-		__u16 len = msgs[i].len;
-
-		if (recv_len && print_buf && len != msgs[i].buf[0] + 1) {
-			fprintf(stderr, "Correcting wrong msg length after recv_len! Please fix the I2C driver and/or report.\n");
-			len = msgs[i].buf[0] + 1;
-		}
+		__u16 len = recv_len ? msgs[i].buf[0] + 1 : msgs[i].len;
 
 		if (flags & PRINT_HEADER) {
 			fprintf(output, "msg %u: addr 0x%02x, %s, len ",
-- 
2.28.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, back to index

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 11:05 [PATCH i2c-tools] Revert "tools: i2ctransfer: add check for returned length from driver" Wolfram Sang
2021-02-26 16:43 ` Jean Delvare
2021-03-10 20:46   ` Wolfram Sang
2021-04-10  8:14     ` Peter Korsgaard
2021-04-13 12:54       ` Wolfram Sang
2021-04-21 20:01         ` Peter Korsgaard
2021-05-21 11:21         ` Jean Delvare
2021-05-25 20:36           ` Wolfram Sang
2021-06-02  9:03             ` Jean Delvare
2021-06-02 16:25               ` Wolfram Sang
2021-06-04 13:57                 ` Jean Delvare
2021-06-04 19:21                   ` Wolfram Sang
2021-06-08 12:22                     ` Jean Delvare
2021-06-08 12:26                       ` Wolfram Sang
2021-05-21 11:16       ` Jean Delvare
2021-03-07  5:42 ` Wolfram Sang

Linux-i2c Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-i2c/0 linux-i2c/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-i2c linux-i2c/ https://lore.kernel.org/linux-i2c \
		linux-i2c@vger.kernel.org
	public-inbox-index linux-i2c

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-i2c


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git