Re: [PATCH net-next v6 02/13] ax88179_178a: Split driver into library and device specific code

Jianhui Xu <[email protected]>
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
Hi Birger,

I noticed what looks like a typo in the newly added `ax88179_read_cmd()`:

```c
if (size == 2) {
	u16 buf = 0;

	ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf);
	le16_to_cpus(&buf);
	*((u16 *)data) = buf;
} else if (size == 2) {
	u32 buf = 0;

	ret = __ax88179_read_cmd(dev, cmd, value, index, size, &buf);
	le32_to_cpus(&buf);
	*((u32 *)data) = buf;
}
```

The second condition should presumably be:

```c
} else if (size == 4) {
```

The original implementation before this code was moved to `ax88179_lib.c`
also used `else if (4 == size)`.

As written, the `u32` branch is unreachable, so 4-byte reads fall through
to `__ax88179_read_cmd()` without the `le32_to_cpus()` conversion.

Regards,
Jianhui
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.