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

Commit cd861280 authored by Robert P. J. Day's avatar Robert P. J. Day Committed by Linus Torvalds
Browse files

[PATCH] Fix numerous kcalloc() calls, convert to kzalloc()



All kcalloc() calls of the form "kcalloc(1,...)" are converted to the
equivalent kzalloc() calls, and a few kcalloc() calls with the incorrect
ordering of the first two arguments are fixed.

Signed-off-by: default avatarRobert P. J. Day <rpjday@mindspring.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 90aef12e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -551,7 +551,7 @@ static int adma_port_start(struct ata_port *ap)
		return rc;
		return rc;
	adma_enter_reg_mode(ap);
	adma_enter_reg_mode(ap);
	rc = -ENOMEM;
	rc = -ENOMEM;
	pp = kcalloc(1, sizeof(*pp), GFP_KERNEL);
	pp = kzalloc(sizeof(*pp), GFP_KERNEL);
	if (!pp)
	if (!pp)
		goto err_out;
		goto err_out;
	pp->pkt = dma_alloc_coherent(dev, ADMA_PKT_BYTES, &pp->pkt_dma,
	pp->pkt = dma_alloc_coherent(dev, ADMA_PKT_BYTES, &pp->pkt_dma,
@@ -672,7 +672,7 @@ static int adma_ata_init_one(struct pci_dev *pdev,
	if (rc)
	if (rc)
		goto err_out_iounmap;
		goto err_out_iounmap;


	probe_ent = kcalloc(1, sizeof(*probe_ent), GFP_KERNEL);
	probe_ent = kzalloc(sizeof(*probe_ent), GFP_KERNEL);
	if (probe_ent == NULL) {
	if (probe_ent == NULL) {
		rc = -ENOMEM;
		rc = -ENOMEM;
		goto err_out_iounmap;
		goto err_out_iounmap;
+1 −1
Original line number Original line Diff line number Diff line
@@ -945,7 +945,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
	 */
	 */
	tlen = sizeof(struct property) + len + 18;
	tlen = sizeof(struct property) + len + 18;


	prop = kcalloc(tlen, 1, GFP_KERNEL);
	prop = kzalloc(tlen, GFP_KERNEL);
	if (prop == NULL)
	if (prop == NULL)
		return NULL;
		return NULL;
	hdr = (struct smu_sdbp_header *)(prop + 1);
	hdr = (struct smu_sdbp_header *)(prop + 1);
+1 −1
Original line number Original line Diff line number Diff line
@@ -768,7 +768,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
	if (mtd->type != MTD_NORFLASH)
	if (mtd->type != MTD_NORFLASH)
		return;
		return;


	part = kcalloc(1, sizeof(struct partition), GFP_KERNEL);
	part = kzalloc(sizeof(struct partition), GFP_KERNEL);
	if (!part)
	if (!part)
		return;
		return;


+1 −1
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
	struct phy_device *dev;
	struct phy_device *dev;
	/* We allocate the device, and initialize the
	/* We allocate the device, and initialize the
	 * default values */
	 * default values */
	dev = kcalloc(1, sizeof(*dev), GFP_KERNEL);
	dev = kzalloc(sizeof(*dev), GFP_KERNEL);


	if (NULL == dev)
	if (NULL == dev)
		return (struct phy_device*) PTR_ERR((void*)-ENOMEM);
		return (struct phy_device*) PTR_ERR((void*)-ENOMEM);
+1 −1
Original line number Original line Diff line number Diff line
@@ -749,7 +749,7 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base)
	struct skge_element *e;
	struct skge_element *e;
	int i;
	int i;


	ring->start = kcalloc(sizeof(*e), ring->count, GFP_KERNEL);
	ring->start = kcalloc(ring->count, sizeof(*e), GFP_KERNEL);
	if (!ring->start)
	if (!ring->start)
		return -ENOMEM;
		return -ENOMEM;


Loading