Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5e3c2fa authored by Deepak Saxena's avatar Deepak Saxena Committed by Linus Torvalds
Browse files

[PATCH] ide: kmalloc + memset -> kzalloc conversion

parent 9c215384
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -3455,7 +3455,7 @@ static int ide_cd_probe(struct device *dev)
		printk(KERN_INFO "ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
		goto failed;
	}
	info = kmalloc(sizeof(struct cdrom_info), GFP_KERNEL);
	info = kzalloc(sizeof(struct cdrom_info), GFP_KERNEL);
	if (info == NULL) {
		printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name);
		goto failed;
@@ -3469,8 +3469,6 @@ static int ide_cd_probe(struct device *dev)

	ide_register_subdriver(drive, &ide_cdrom_driver);

	memset(info, 0, sizeof (struct cdrom_info));

	kref_init(&info->kref);

	info->drive = drive;
+1 −3
Original line number Diff line number Diff line
@@ -1215,7 +1215,7 @@ static int ide_disk_probe(struct device *dev)
	if (drive->media != ide_disk)
		goto failed;

	idkp = kmalloc(sizeof(*idkp), GFP_KERNEL);
	idkp = kzalloc(sizeof(*idkp), GFP_KERNEL);
	if (!idkp)
		goto failed;

@@ -1228,8 +1228,6 @@ static int ide_disk_probe(struct device *dev)

	ide_register_subdriver(drive, &idedisk_driver);

	memset(idkp, 0, sizeof(*idkp));

	kref_init(&idkp->kref);

	idkp->drive = drive;
+1 −3
Original line number Diff line number Diff line
@@ -2146,7 +2146,7 @@ static int ide_floppy_probe(struct device *dev)
		printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
		goto failed;
	}
	if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
	if ((floppy = (idefloppy_floppy_t *) kzalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
		printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
		goto failed;
	}
@@ -2159,8 +2159,6 @@ static int ide_floppy_probe(struct device *dev)

	ide_register_subdriver(drive, &idefloppy_driver);

	memset(floppy, 0, sizeof(*floppy));

	kref_init(&floppy->kref);

	floppy->drive = drive;
+1 −2
Original line number Diff line number Diff line
@@ -596,14 +596,13 @@ static inline u8 probe_for_drive (ide_drive_t *drive)
	 *	Also note that 0 everywhere means "can't do X"
	 */
 
	drive->id = kmalloc(SECTOR_WORDS *4, GFP_KERNEL);
	drive->id = kzalloc(SECTOR_WORDS *4, GFP_KERNEL);
	drive->id_read = 0;
	if(drive->id == NULL)
	{
		printk(KERN_ERR "ide: out of memory for id data.\n");
		return 0;
	}
	memset(drive->id, 0, SECTOR_WORDS * 4);
	strcpy(drive->id->model, "UNKNOWN");
	
	/* skip probing? */
+1 −3
Original line number Diff line number Diff line
@@ -4850,7 +4850,7 @@ static int ide_tape_probe(struct device *dev)
		printk(KERN_WARNING "ide-tape: Use drive %s with ide-scsi emulation and osst.\n", drive->name);
		printk(KERN_WARNING "ide-tape: OnStream support will be removed soon from ide-tape!\n");
	}
	tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL);
	tape = (idetape_tape_t *) kzalloc (sizeof (idetape_tape_t), GFP_KERNEL);
	if (tape == NULL) {
		printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
		goto failed;
@@ -4864,8 +4864,6 @@ static int ide_tape_probe(struct device *dev)

	ide_register_subdriver(drive, &idetape_driver);

	memset(tape, 0, sizeof(*tape));

	kref_init(&tape->kref);

	tape->drive = drive;
Loading