From: Eric Sesterhenn <snakebyte@gmx.de>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [Patch] kzalloc() conversion in drivers/block
Date: Sun, 05 Mar 2006 15:02:22 +0000 [thread overview]
Message-ID: <1141570942.13183.17.camel@alice> (raw)
In-Reply-To: <1140815848.26064.4.camel@alice>
[-- Attachment #1: Type: text/plain, Size: 4213 bytes --]
hi,
this patch converts drivers/block to kzalloc usage.
Compile tested with allyesconfig.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.16-rc5-mm1/drivers/block/paride/bpck6.c.orig 2006-03-05 11:07:13.000000000 +0100
+++ linux-2.6.16-rc5-mm1/drivers/block/paride/bpck6.c 2006-03-05 11:07:29.000000000 +0100
@@ -224,10 +224,9 @@ static void bpck6_log_adapter( PIA *pi,
static int bpck6_init_proto(PIA *pi)
{
- Interface *p = kmalloc(sizeof(Interface), GFP_KERNEL);
+ Interface *p = kzalloc(sizeof(Interface), GFP_KERNEL);
if (p) {
- memset(p, 0, sizeof(Interface));
pi->private = (unsigned long)p;
return 0;
}
--- linux-2.6.16-rc5-mm1/drivers/block/cciss_scsi.c.orig 2006-03-05 11:07:44.000000000 +0100
+++ linux-2.6.16-rc5-mm1/drivers/block/cciss_scsi.c 2006-03-05 11:08:09.000000000 +0100
@@ -1027,12 +1027,11 @@ cciss_update_non_disk_devices(int cntl_n
int i;
c = (ctlr_info_t *) hba[cntl_num];
- ld_buff = kmalloc(reportlunsize, GFP_KERNEL);
+ ld_buff = kzalloc(reportlunsize, GFP_KERNEL);
if (ld_buff == NULL) {
printk(KERN_ERR "cciss: out of memory\n");
return;
}
- memset(ld_buff, 0, reportlunsize);
inq_buff = kmalloc(OBDR_TAPE_INQ_SIZE, GFP_KERNEL);
if (inq_buff == NULL) {
printk(KERN_ERR "cciss: out of memory\n");
--- linux-2.6.16-rc5-mm1/drivers/block/cciss.c.orig 2006-03-05 11:09:08.000000000 +0100
+++ linux-2.6.16-rc5-mm1/drivers/block/cciss.c 2006-03-05 11:10:40.000000000 +0100
@@ -996,13 +996,11 @@ static int cciss_ioctl(struct inode *ino
status = -EINVAL;
goto cleanup1;
}
- buff = (unsigned char **) kmalloc(MAXSGENTRIES *
- sizeof(char *), GFP_KERNEL);
+ buff = kzalloc(MAXSGENTRIES * sizeof(char *), GFP_KERNEL);
if (!buff) {
status = -ENOMEM;
goto cleanup1;
}
- memset(buff, 0, MAXSGENTRIES);
buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int),
GFP_KERNEL);
if (!buff_size) {
@@ -2941,13 +2939,12 @@ static void cciss_getgeometry(int cntl_n
int block_size;
int total_size;
- ld_buff = kmalloc(sizeof(ReportLunData_struct), GFP_KERNEL);
+ ld_buff = kzalloc(sizeof(ReportLunData_struct), GFP_KERNEL);
if (ld_buff == NULL)
{
printk(KERN_ERR "cciss: out of memory\n");
return;
}
- memset(ld_buff, 0, sizeof(ReportLunData_struct));
size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL);
if (size_buff == NULL)
{
@@ -3061,10 +3058,9 @@ static int alloc_cciss_hba(void)
for(i=0; i< MAX_CTLR; i++) {
if (!hba[i]) {
ctlr_info_t *p;
- p = kmalloc(sizeof(ctlr_info_t), GFP_KERNEL);
+ p = kzalloc(sizeof(ctlr_info_t), GFP_KERNEL);
if (!p)
goto Enomem;
- memset(p, 0, sizeof(ctlr_info_t));
for (n = 0; n < NWD; n++)
p->gendisk[n] = disk[n];
hba[i] = p;
--- linux-2.6.16-rc5-mm1/drivers/block/DAC960.c.orig 2006-03-05 11:10:48.000000000 +0100
+++ linux-2.6.16-rc5-mm1/drivers/block/DAC960.c 2006-03-05 11:12:05.000000000 +0100
@@ -312,11 +312,10 @@ static boolean DAC960_CreateAuxiliaryStr
CommandsRemaining = CommandAllocationGroupSize;
CommandGroupByteCount =
CommandsRemaining * CommandAllocationLength;
- AllocationPointer = kmalloc(CommandGroupByteCount, GFP_ATOMIC);
+ AllocationPointer = kzalloc(CommandGroupByteCount, GFP_ATOMIC);
if (AllocationPointer == NULL)
return DAC960_Failure(Controller,
"AUXILIARY STRUCTURE CREATION");
- memset(AllocationPointer, 0, CommandGroupByteCount);
}
Command = (DAC960_Command_T *) AllocationPointer;
AllocationPointer += CommandAllocationLength;
@@ -2710,14 +2709,12 @@ DAC960_DetectController(struct pci_dev *
void __iomem *BaseAddress;
int i;
- Controller = (DAC960_Controller_T *)
- kmalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC);
+ Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC);
if (Controller == NULL) {
DAC960_Error("Unable to allocate Controller structure for "
"Controller at\n", NULL);
return NULL;
}
- memset(Controller, 0, sizeof(DAC960_Controller_T));
Controller->ControllerNumber = DAC960_ControllerCount;
DAC960_Controllers[DAC960_ControllerCount++] = Controller;
Controller->Bus = PCI_Device->bus->number;
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2006-03-05 15:02 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-24 21:17 [KJ] [Patch] kzalloc() conversion in drivers/video Eric Sesterhenn
2006-02-27 9:22 ` [KJ] [Patch] kzalloc() conversion in drivers/atm Eric Sesterhenn
2006-02-27 9:43 ` Tobias Klauser
2006-02-27 11:16 ` Eric Sesterhenn
2006-02-27 16:22 ` [KJ] [Patch] kzalloc() conversion in drivers/usb Eric Sesterhenn
2006-02-27 20:36 ` [KJ] [Patch] kzalloc() conversion in drivers/usb/gadget Eric Sesterhenn
2006-02-27 20:51 ` Jesper Juhl
2006-02-28 13:54 ` [KJ] [Patch] kzalloc() conversion in drivers/acpi Eric Sesterhenn
2006-02-28 13:54 ` [KJ] [Patch] kzalloc() conversion in drivers/s390 Eric Sesterhenn
2006-02-28 14:34 ` [KJ] [Patch] kzalloc() conversion in drivers/pci Eric Sesterhenn
2006-02-28 21:39 ` [KJ] [Patch] kzalloc() conversion in drivers/usb/gadget Alexey Dobriyan
2006-02-28 21:49 ` Jesper Juhl
2006-03-01 9:00 ` [KJ] [Patch] kzalloc() conversion in drivers/char Eric Sesterhenn
2006-03-01 23:29 ` [KJ] [Patch] kzalloc() conversion in drivers/mtd Eric Sesterhenn
2006-03-02 11:58 ` [KJ] [Patch] kzalloc() conversion in drivers/serial Eric Sesterhenn
2006-03-04 17:56 ` [KJ] [Patch] kzalloc() conversion in drivers/net Eric Sesterhenn
2006-03-04 17:56 ` Eric Sesterhenn
2006-03-04 19:09 ` [KJ] [Patch] kzalloc() conversion in drivers/md Eric Sesterhenn
2006-03-04 19:09 ` [KJ] [Patch] kzalloc() conversion in drivers/macintosh Eric Sesterhenn
2006-03-04 19:09 ` [KJ] [Patch] kzalloc() conversion in drivers/block Eric Sesterhenn
2006-03-05 8:41 ` [KJ] [Patch] kzalloc() conversion in drivers/sbus Eric Sesterhenn
2006-03-05 15:02 ` [KJ] [Patch] kzalloc() conversion in drivers/telephony/ Eric Sesterhenn
2006-03-05 15:02 ` [KJ] [Patch] kzalloc() conversion in drivers/rapidio Eric Sesterhenn
2006-03-05 15:02 ` [KJ] [Patch] kzalloc() conversion in drivers/misc/ Eric Sesterhenn
2006-03-05 15:02 ` [KJ] [Patch] kzalloc() conversion in drivers/mfd/ Eric Sesterhenn
2006-03-05 15:02 ` [KJ] [Patch] kzalloc() conversion in drivers/media/ Eric Sesterhenn
2006-03-05 15:02 ` Eric Sesterhenn [this message]
2006-03-05 21:02 ` [KJ] [Patch] kzalloc() conversion in drivers/sh Eric Sesterhenn
2006-03-05 21:02 ` [KJ] [Patch] kzalloc() conversion in drivers/pnp Eric Sesterhenn
2006-03-05 21:02 ` [KJ] [Patch] kzalloc() conversion in drivers/nubus Eric Sesterhenn
2006-03-05 21:02 ` [KJ] [Patch] kzalloc() conversion in drivers/message Eric Sesterhenn
2006-03-05 21:02 ` [KJ] [Patch] kzalloc() conversion in drivers/mca Eric Sesterhenn
2006-03-05 21:02 ` [KJ] [Patch] kzalloc() conversion in drivers/acorn/ Eric Sesterhenn
2006-03-06 20:13 ` [KJ] [Patch] kzalloc() conversion in drivers/parport/ Eric Sesterhenn
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=1141570942.13183.17.camel@alice \
--to=snakebyte@gmx.de \
--cc=kernel-janitors@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.