All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: jkc@redhat.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: unisys: use kzalloc instead of kmalloc/memset 0
Date: Mon, 17 Mar 2014 14:41:45 -0700	[thread overview]
Message-ID: <20140317214145.GA29105@kroah.com> (raw)
In-Reply-To: <4376102.svyTz8ADVT@daeseok-laptop.cloud.net>

On Wed, Mar 12, 2014 at 07:37:50PM +0900, Daeseok Youn wrote:
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/unisys/uislib/uislib.c   |    5 +----
>  drivers/staging/unisys/uislib/uisutils.c |    2 +-
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
> index d77df9a..9748fcb 100644
> --- a/drivers/staging/unisys/uislib/uislib.c
> +++ b/drivers/staging/unisys/uislib/uislib.c
> @@ -339,8 +339,6 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
>  		return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
>  	}
>  
> -	memset(bus, 0, size);
> -
>  	/* Currently by default, the bus Number is the GuestHandle.
>  	 * Configure Bus message can override this.
>  	 */
> @@ -530,7 +528,6 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
>  		return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
>  	}
>  
> -	memset(dev, 0, sizeof(struct device_info));
>  	dev->channelTypeGuid = msg->cmd.createDevice.dataTypeGuid;
>  	dev->intr = msg->cmd.createDevice.intr;
>  	dev->channelAddr = msg->cmd.createDevice.channelAddr;
> @@ -1437,7 +1434,7 @@ uislib_malloc(size_t siz, gfp_t gfp, U8 contiguous, char *fn, int ln)
>  		* get memory for you (like, invoke oom killer), which
>  		* will probably cripple the system.
>  		*/
> -		p = kmalloc(siz, gfp | __GFP_NORETRY);
> +		p = kzalloc(siz, gfp | __GFP_NORETRY);
>  	}
>  	if (p == NULL) {
>  		LOGERR("uislib_malloc failed to alloc %d bytes @%s:%d",
> diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c
> index 208b7ea..2f05be1 100644
> --- a/drivers/staging/unisys/uislib/uisutils.c
> +++ b/drivers/staging/unisys/uislib/uisutils.c
> @@ -294,7 +294,7 @@ ReqHandlerAdd(GUID switchTypeGuid,
>  	rc = UISMALLOC(sizeof(*rc), GFP_ATOMIC);
>  	if (!rc)
>  		return NULL;
> -	memset(rc, 0, sizeof(*rc));
> +
>  	rc->switchTypeGuid = switchTypeGuid;
>  	rc->controlfunc = controlfunc;
>  	rc->min_channel_bytes = min_channel_bytes;

Can you just remove the UISMALLOC() macro completly, so that it's easier
to verify that changes like this are actually correct?

thanks,

greg k-h

  reply	other threads:[~2014-03-17 21:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 10:37 [PATCH] staging: unisys: use kzalloc instead of kmalloc/memset 0 Daeseok Youn
2014-03-17 21:41 ` Greg KH [this message]
2014-03-18  0:26   ` DaeSeok Youn
2014-03-18  0:37     ` Greg KH
2014-03-18  8:11       ` DaeSeok Youn
2014-03-19  0:03         ` DaeSeok Youn
2014-03-19  0:58           ` Greg KH
2014-03-19  1:04             ` DaeSeok Youn
2014-03-19  2:31               ` Greg KH
2014-03-19  4:32                 ` DaeSeok Youn
2014-03-18 13:00     ` Ken Cox
2014-03-19  0:09       ` DaeSeok Youn
2014-03-19  0:58         ` Greg KH
2014-03-18 20:07 ` [patch][wip] staging: unisys: kmalloc/memset move to kzalloc Silvio F
2014-03-18 20:07   ` [PATCH] staging: unisys: kmalloc/memset to kzalloc conversation Silvio F
2014-03-18 20:17     ` Joe Perches
2014-03-18 20:41       ` Greg KH
2014-03-18 20:41     ` Greg KH
2014-03-18 20:46       ` Silvio F.
2014-03-18 21:13 ` [patch][wip] staging: unisys: kmalloc/memset move to kzalloc Silvio F
2014-03-18 21:13   ` [PATCH] staging: unisys: kmalloc/memset to kzalloc conversation Silvio F

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140317214145.GA29105@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=daeseok.youn@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=jkc@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.