lkml.org 
[lkml]   [2011]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/25] Staging: hv: util: Perform some service specific de-initialization in util_remove()
On Thu, Sep 08, 2011 at 07:24:20AM -0700, K. Y. Srinivasan wrote:
> In preparation for modifying the util driver to fully conform to the
> Linux Driver Model, perform some service specific de-initialization in
> util_remove() as opposed to in exit_hyperv_utils() as is currently done.
>
>
> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
> drivers/staging/hv/hv_util.c | 29 ++++++++++++++++++++++++-----
> 1 files changed, 24 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
> index b86128a..2475ab2 100644
> --- a/drivers/staging/hv/hv_util.c
> +++ b/drivers/staging/hv/hv_util.c
> @@ -291,6 +291,30 @@ error:
> static int util_remove(struct hv_device *dev,
> const struct hv_vmbus_device_id *dev_id)
> {
> + int service = dev_id->driver_data;
> +
> + switch (service) {
> + case HV_SHUTDOWN:
> + kfree(shut_txf_buf);
> + break;

This switch and "static" pointers you need to free aren't needed at all
if you do this code logic correctly (i.e. a per-device buffer.)

{sigh}

I'm stopping reviewing now, this is making me grumpy, someone owes me a
bunch of beer...

greg k-h


\
 
 \ /
  Last update: 2011-09-09 22:51    [W:0.214 / U:1.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site