diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2011-09-13 15:21:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-16 20:07:19 +0200 |
commit | 6f27457b50c0439388e34d528f0fc200ddedb9a4 (patch) | |
tree | 1910ab0f2a3a378e36ab6207b7bb306182ac79d8 | |
parent | 3c4debad4290a31d3537bf89837f49d5e48b8271 (diff) | |
download | op-kernel-dev-6f27457b50c0439388e34d528f0fc200ddedb9a4.zip op-kernel-dev-6f27457b50c0439388e34d528f0fc200ddedb9a4.tar.gz |
Staging: hv: netvsc: Cleanup the name and type of link_stat variable
Consistently name the variable tracking the link status. Use a consistent
type for this variable and get rid of some unnecessary parentheses as well.
I would like to thank Joe Perches <joe@perches.com> for suggesting these
changes and patiently helping me get here!
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/hv/rndis_filter.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c index 963582a..ef43f2e 100644 --- a/drivers/staging/hv/rndis_filter.c +++ b/drivers/staging/hv/rndis_filter.c @@ -41,7 +41,7 @@ struct rndis_device { struct netvsc_device *net_dev; enum rndis_device_state state; - u32 link_stat; + bool link_state; atomic_t new_req_id; spinlock_t request_lock; @@ -511,10 +511,15 @@ static int rndis_filter_query_device_mac(struct rndis_device *dev) static int rndis_filter_query_device_link_status(struct rndis_device *dev) { u32 size = sizeof(u32); + u32 link_status; + int ret; - return rndis_filter_query_device(dev, + ret = rndis_filter_query_device(dev, RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, - &dev->link_stat, &size); + &link_status, &size); + dev->link_state = (link_status != 0) ? true : false; + + return ret; } static int rndis_filter_set_packet_filter(struct rndis_device *dev, @@ -736,11 +741,11 @@ int rndis_filter_device_add(struct hv_device *dev, rndis_filter_query_device_link_status(rndis_device); - device_info->link_state = rndis_device->link_stat; + device_info->link_state = rndis_device->link_state; - dev_info(&dev->device, "Device MAC %pM link state %s", + dev_info(&dev->device, "Device MAC %pM link state %s\n", rndis_device->hw_mac_adr, - ((device_info->link_state) ? ("down\n") : ("up\n"))); + device_info->link_state ? "down" : "up"); return ret; } |