net: lan78xx: Avoid unnecessary self assignment
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 20 Sep 2018 22:48:30 +0000 (15:48 -0700)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 2 Apr 2020 04:09:02 +0000 (13:09 +0900)
commit5f1035d1efc6ca31f929d79009d290dc3f503c65
tree8a5f093c33ed8134aee53a2de6f4cf5f19df364f
parent231cf5132f6a82e06329b390fb9591aa4902c65f
net: lan78xx: Avoid unnecessary self assignment

Clang warns when a variable is assigned to itself.

drivers/net/usb/lan78xx.c:940:11: warning: explicitly assigning value of
variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign]
                        offset = offset;
                        ~~~~~~ ^ ~~~~~~
1 warning generated.

Reorder the if statement to acheive the same result and avoid a self
assignment warning.

Link: https://github.com/ClangBuiltLinux/linux/issues/129
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[sw0312.kim: cherry-pick mainline commit 94e7c844990f to remove build warning with llvm/clang]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I18dc3e4145348830101d9474c38700565faf4761
drivers/net/usb/lan78xx.c