]> git.baikalelectronics.ru Git - kernel.git/commit
rndis_wlan: Remove logically dead code
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 5 May 2020 23:52:05 +0000 (18:52 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 12 May 2020 08:53:19 +0000 (11:53 +0300)
commitea91d80ade059e183290de70425af6891047b92a
tree00976c6bfa0b111071da0f9087478f9f53e196eb
parentb036905d6b2cfe35542d29fca0a71e92b5730666
rndis_wlan: Remove logically dead code

caps_buf is always of size sizeof(*caps) because
sizeof(caps->auth_encr_pair) * 16 is always zero. Notice
that when using zero-length arrays, sizeof evaluates to zero[1].

So, the code introduced by
commit 3f7ba0fcfab4 ("rndis_wlan: get max_num_pmkids from device")
is logically dead, hence is never executed and can be removed. As a
consequence, the rest of the related code can be refactored a bit.

Notice that this code has been out there since March 2010.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200505235205.GA18539@embeddedor
Link: https://lore.kernel.org/r/20200507110741.37757-1-yanaijie@huawei.com
drivers/net/wireless/rndis_wlan.c