From: K. Y. Srinivasan Date: Mon, 7 Mar 2011 21:33:41 +0000 (-0800) Subject: Staging: hv: Eliminate netvsc_driver_context X-Git-Tag: firefly_0821_release~7613^2~2197^2~224 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8de5dc6847e9272d3c648e62f6481ac5b200eb6;p=firefly-linux-kernel-4.4.55.git Staging: hv: Eliminate netvsc_driver_context With the consolidation of all driver state into one data structure; netvsc_driver_context structure is not needed; get rid of it. Signed-off-by: K. Y. Srinivasan Signed-off-by: Abhishek Kane Signed-off-by: Haiyang Zhang Signed-off-by: Hank Janssen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index fdcc8aab2177..f0d258cc5839 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c @@ -48,9 +48,6 @@ struct net_device_context { unsigned long avail; }; -struct netvsc_driver_context { - struct netvsc_driver drv_obj; -}; #define PACKET_PAGES_LOWATER 8 /* Need this many pages to handle worst case fragmented packet */ @@ -61,7 +58,7 @@ module_param(ring_size, int, S_IRUGO); MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); /* The one and only one */ -static struct netvsc_driver_context g_netvsc_drv; +static struct netvsc_driver g_netvsc_drv; /* no-op so the netdev core doesn't return -EINVAL when modifying the the * multicast address list in SIOCADDMULTI. hv is setup to get all multicast @@ -134,9 +131,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) struct net_device_context *net_device_ctx = netdev_priv(net); struct hv_driver *drv = drv_to_hv_drv(net_device_ctx->device_ctx->device.driver); - struct netvsc_driver_context *net_drv_ctx = - (struct netvsc_driver_context *)drv->priv; - struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj; + struct netvsc_driver *net_drv_obj = drv->priv; struct hv_netvsc_packet *packet; int ret; unsigned int i, num_pages; @@ -339,9 +334,7 @@ static int netvsc_probe(struct device *device) { struct hv_driver *drv = drv_to_hv_drv(device->driver); - struct netvsc_driver_context *net_drv_ctx = - (struct netvsc_driver_context *)drv->priv; - struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj; + struct netvsc_driver *net_drv_obj = drv->priv; struct vm_device *device_ctx = device_to_vm_device(device); struct hv_device *device_obj = &device_ctx->device_obj; struct net_device *net = NULL; @@ -411,9 +404,7 @@ static int netvsc_remove(struct device *device) { struct hv_driver *drv = drv_to_hv_drv(device->driver); - struct netvsc_driver_context *net_drv_ctx = - (struct netvsc_driver_context *)drv->priv; - struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj; + struct netvsc_driver *net_drv_obj = drv->priv; struct vm_device *device_ctx = device_to_vm_device(device); struct net_device *net = dev_get_drvdata(&device_ctx->device); struct hv_device *device_obj = &device_ctx->device_obj; @@ -458,8 +449,8 @@ static int netvsc_drv_exit_cb(struct device *dev, void *data) static void netvsc_drv_exit(void) { - struct netvsc_driver *netvsc_drv_obj = &g_netvsc_drv.drv_obj; - struct hv_driver *drv = &g_netvsc_drv.drv_obj.base; + struct netvsc_driver *netvsc_drv_obj = &g_netvsc_drv; + struct hv_driver *drv = &g_netvsc_drv.base; struct device *current_dev; int ret; @@ -493,8 +484,8 @@ static void netvsc_drv_exit(void) static int netvsc_drv_init(int (*drv_init)(struct hv_driver *drv)) { - struct netvsc_driver *net_drv_obj = &g_netvsc_drv.drv_obj; - struct hv_driver *drv = &g_netvsc_drv.drv_obj.base; + struct netvsc_driver *net_drv_obj = &g_netvsc_drv; + struct hv_driver *drv = &g_netvsc_drv.base; int ret; net_drv_obj->ring_buf_size = ring_size * PAGE_SIZE;