Commit 1840c15b authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Greg Kroah-Hartman
Browse files

staging: rts_pstor: optimize kmalloc to kzalloc



Use kzalloc rather than kmalloc followed by memset with 0.
Found by coccinelle.

Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 12d0eb47
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -931,11 +931,10 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id
	dev = host_to_rtsx(host);
	memset(dev, 0, sizeof(struct rtsx_dev));

	dev->chip = (struct rtsx_chip *)kmalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
	dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
	if (dev->chip == NULL) {
		goto errout;
	}
	memset(dev->chip, 0, sizeof(struct rtsx_chip));

	spin_lock_init(&dev->reg_lock);
	mutex_init(&(dev->dev_mutex));