diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-11-16 15:07:10 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-02 05:07:53 (GMT) |
commit | 47974403c9caadc9fdb762e399569689efb02386 (patch) | |
tree | 52057d129cafceec54a9fd1e9cb5f9f6a1f8b057 /kernel | |
parent | dd758f82a3bf2f11843a59188cd0d7922dbcc731 (diff) | |
download | linux-47974403c9caadc9fdb762e399569689efb02386.tar.xz |
staging: wilc1000: simplify vif[i]->ndev accesses
commit 735bb39ca3bed8469b3b3a42d8cc57bdb9fc4dd7 upstream.
With gcc-7, I got a new warning for this driver:
wilc1000/linux_wlan.c: In function 'wilc_netdev_cleanup':
wilc1000/linux_wlan.c:1224:15: error: 'vif[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
wilc1000/linux_wlan.c:1224:15: error: 'vif[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
A closer look at the function reveals that it's more complex than
it needs to be, given that based on how the device is created
we always get
netdev_priv(vif->ndev) == vif
Based on this assumption, I found a few other places in the same file
that can be simplified. That code appears to be a relic from times
when the assumption above was not valid.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions