All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Cc: hare@suse.de, JBottomley@parallels.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	julia.lawall@lip6.fr
Subject: Re: [PATCH] aic7xxx: replace kmalloc/memset by kzalloc
Date: Thu, 16 Oct 2014 12:28:40 -0700	[thread overview]
Message-ID: <1413487720.15773.1.camel@perches.com> (raw)
In-Reply-To: <1413486878-375-1-git-send-email-michael.opdenacker@free-electrons.com>

On Thu, 2014-10-16 at 21:14 +0200, Michael Opdenacker wrote:
> This replaces kmalloc + memset by a call to kzalloc.
[]
> diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
[]
> @@ -4780,10 +4779,10 @@ ahc_init_scbdata(struct ahc_softc *ahc)
>  	SLIST_INIT(&scb_data->sg_maps);
>  
>  	/* Allocate SCB resources */
> -	scb_data->scbarray = kmalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC, GFP_ATOMIC);
> +	scb_data->scbarray = kzalloc(sizeof(struct scb) * AHC_SCB_MAX_ALLOC,
> +				GFP_ATOMIC);
>  	if (scb_data->scbarray == NULL)
>  		return (ENOMEM);
> -	memset(scb_data->scbarray, 0, sizeof(struct scb) * AHC_SCB_MAX_ALLOC);
>  
>  	/* Determine the number of hardware SCBs and initialize them */
>  

Probably better as kcalloc.

  reply	other threads:[~2014-10-16 19:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 19:14 [PATCH] aic7xxx: replace kmalloc/memset by kzalloc Michael Opdenacker
2014-10-16 19:28 ` Joe Perches [this message]
2014-10-16 19:30   ` Michael Opdenacker
2014-10-16 20:05     ` Elliott, Robert (Server Storage)
2015-03-22 16:31       ` [PATCH] [RESEND] " Michael Opdenacker
2015-03-23  6:59         ` Hannes Reinecke
2015-03-24 20:46           ` Michael Opdenacker
2015-03-24 20:57             ` Joe Perches
2015-03-24 23:16               ` Elliott, Robert (Server Storage)
2015-03-27  0:38                 ` Michael Opdenacker
2015-03-27  0:51                   ` Michael Opdenacker
2015-03-27 19:48                   ` kcalloc/kmalloc_array could BUILD_BUG_ON for too-big constant arguments (was Re: [PATCH] [RESEND] aic7xxx: replace kmalloc/memset by kzalloc) Jeff Epler

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=1413487720.15773.1.camel@perches.com \
    --to=joe@perches.com \
    --cc=JBottomley@parallels.com \
    --cc=hare@suse.de \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michael.opdenacker@free-electrons.com \
    /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.