]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging: ks7010: abstract connection status
authorTobin C. Harding <me@tobin.cc>
Thu, 27 Apr 2017 01:25:19 +0000 (11:25 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Apr 2017 09:47:26 +0000 (11:47 +0200)
commit0e24eb8abf93a2e80ecbe97419d2d1fe089a7386
tree843ed6348df2a10d81ff508083f646e993ee9591
parent11ce16da7b0f5335c7622ccc7c8151a387b44853
staging: ks7010: abstract connection status

Host interface connection status is handled using a 32 bit type. Top
byte is used as for FORCE_DISCONNECT status, low bits are used for
connect/disconnect status. Driver masks and checks integers to
ascertain status. If functions are defined to do the masking and
equality check then the details of how the status integer is used are
abstracted away. This makes the code easier to read. Also future
updates to the status handling will be easier because the code is in
one place.

Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as
values, as apposed to opaque values. Because of this driver code
checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as
apposed to negating a single check (ie 'foo != CONNECT_STATUS). In
order to maintain the current functionality we define two separate
functions is_connect_status() and is_disconnect_status().

Add functions to abstract the status integer check. Update all sites
that do the check manually to use the newly defined functions.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c
drivers/staging/ks7010/ks_hostif.c
drivers/staging/ks7010/ks_wlan.h
drivers/staging/ks7010/ks_wlan_net.c