]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: pcs: simplify gray code to binary conversion 23984/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 28 Jun 2026 20:24:29 +0000 (22:24 +0200)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 28 Jun 2026 21:44:31 +0000 (23:44 +0200)
commit3a7595dcde9454e6a33c943a6acfbcf6a6931ef7
tree9c3c3095dd1eaeff9a8e971b4c4e5354110ff56b
parent8b0ce8e4e33f7ff53a244fb11aa06d39f22586be
realtek: pcs: simplify gray code to binary conversion

Gray conversion is b[i] = g[i] XOR g[i+1] XOR ... XOR g[n-1]
Make the code a 3 liner. For more details see [1].

[1] https://en.wikipedia.org/wiki/Gray_code#Converting_to_and_from_Gray_code

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23984
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c