From 06ff37ffb4ba8bcbda0e9d19c712c954ef7b8a0a Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Wed, 8 Mar 2006 11:21:52 +0100 Subject: [PATCH] kzalloc() conversion in drivers/block this patch converts drivers/block to kzalloc usage. Compile tested with allyesconfig. Signed-off-by: Eric Sesterhenn Signed-off-by: Jens Axboe --- drivers/block/DAC960.c | 7 ++----- drivers/block/cciss.c | 10 +++------- drivers/block/cciss_scsi.c | 3 +-- drivers/block/paride/bpck6.c | 3 +-- 4 files changed, 7 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 9bdea2a5cf0..49c7cd558dd 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -311,11 +311,10 @@ static boolean DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) 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; @@ -2709,14 +2708,12 @@ DAC960_DetectController(struct pci_dev *PCI_Device, 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; diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 71ec9e66438..168da0c9ed3 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -996,13 +996,11 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, 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) { @@ -2940,13 +2938,12 @@ static void cciss_getgeometry(int cntl_num) 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) { @@ -3060,10 +3057,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; diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index 0e66e904bd8..597c007fe81 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -1027,12 +1027,11 @@ cciss_update_non_disk_devices(int cntl_num, int hostno) 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"); diff --git a/drivers/block/paride/bpck6.c b/drivers/block/paride/bpck6.c index 08d858ad64d..41a237c5957 100644 --- a/drivers/block/paride/bpck6.c +++ b/drivers/block/paride/bpck6.c @@ -224,10 +224,9 @@ static void bpck6_log_adapter( PIA *pi, char * scratch, int verbose ) 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; } -- cgit v1.2.3 From b8fca1c7682105c843319728d8e37b42b19092bb Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 21 Mar 2006 15:24:37 +0100 Subject: [PATCH] ide-cd: quiet down GPCMD_READ_CDVD_CAPACITY failure Some drives like to throw a: ATAPI device hdc: Error: Not ready -- (Sense key=0x02) Incompatible medium installed -- (asc=0x30, ascq=0x00) The failed "Read Cd/Dvd Capacity" packet command was: "25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 " warning on incompatible media, so quiet down this error. Signed-off-by: Jens Axboe --- drivers/ide/ide-cd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index c7671e18801..b4a41d6d071 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -2143,6 +2143,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, req.cmd[0] = GPCMD_READ_CDVD_CAPACITY; req.data = (char *)&capbuf; req.data_len = sizeof(capbuf); + req.flags |= REQ_QUIET; stat = cdrom_queue_packet_command(drive, &req); if (stat == 0) { -- cgit v1.2.3 From 89a7689e5c039090d99cbdc3625252c3dee50f7f Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Fri, 24 Mar 2006 10:00:57 +0100 Subject: [PATCH] unused label in drivers/block/cciss. this patch removes a warning about an unused label, by moving the label into the ifdef. Signed-off-by: Eric Sesterhenn Signed-off-by: Jens Axboe --- drivers/block/cciss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 168da0c9ed3..1b0fd31c57c 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -2727,9 +2727,9 @@ static void __devinit cciss_interrupt_mode(ctlr_info_t *c, struct pci_dev *pdev, return; } } +default_int_mode: #endif /* CONFIG_PCI_MSI */ /* if we get here we're going to use the default interrupt mode */ -default_int_mode: c->intr[SIMPLE_MODE_INT] = pdev->irq; return; } -- cgit v1.2.3