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

Commit 1aebe187 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Jens Axboe
Browse files

drivers/block/cciss.c: kmalloc + memset conversion to kzalloc



 drivers/block/cciss.c | 104285 -> 104168 (-117 bytes)
 drivers/block/cciss.o | 277400 -> 277124 (-276 bytes)

Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Acked-by: default avatarMike Miller <mike.miller@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 9b99628f
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
{
	ReadCapdata_struct *buf;
	int return_code;
	buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
	if (buf == NULL) {

	buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
	if (!buf) {
		printk(KERN_WARNING "cciss: out of memory\n");
		return;
	}
	memset(buf, 0, sizeof(ReadCapdata_struct));

	if (withirq)
		return_code = sendcmd_withirq(CCISS_READ_CAPACITY,
				ctlr, buf, sizeof(ReadCapdata_struct),
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
		printk(KERN_INFO "      blocks= %llu block_size= %d\n",
		(unsigned long long)*total_size+1, *block_size);
	kfree(buf);
	return;
}

static void
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
{
	ReadCapdata_struct_16 *buf;
	int return_code;
	buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
	if (buf == NULL) {

	buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
	if (!buf) {
		printk(KERN_WARNING "cciss: out of memory\n");
		return;
	}
	memset(buf, 0, sizeof(ReadCapdata_struct_16));

	if (withirq) {
		return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16,
			ctlr, buf, sizeof(ReadCapdata_struct_16),
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
	printk(KERN_INFO "      blocks= %llu block_size= %d\n",
	       (unsigned long long)*total_size+1, *block_size);
	kfree(buf);
	return;
}

static int cciss_revalidate(struct gendisk *disk)