mtd: doc: do not initialize mtd_info fields to 0 or NULL
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 29 Dec 2011 09:40:00 +0000 (11:40 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 9 Jan 2012 18:25:53 +0000 (18:25 +0000)
The 'struct mtd_info' object is allocated with 'kzalloc()', so it
contains only zeroes - no need to initialize various fields to 0 or
NULL.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/doc2000.c
drivers/mtd/devices/doc2001.c
drivers/mtd/devices/doc2001plus.c
drivers/mtd/devices/docg3.c

index e9fad915121924e636c32480b7b699bd6f76379f..b1cdf647901960fd88ef2bce4a787c21ace8a03d 100644 (file)
@@ -562,23 +562,14 @@ void DoC2k_init(struct mtd_info *mtd)
 
        mtd->type = MTD_NANDFLASH;
        mtd->flags = MTD_CAP_NANDFLASH;
-       mtd->size = 0;
-       mtd->erasesize = 0;
        mtd->writesize = 512;
        mtd->oobsize = 16;
        mtd->owner = THIS_MODULE;
        mtd->erase = doc_erase;
-       mtd->point = NULL;
-       mtd->unpoint = NULL;
        mtd->read = doc_read;
        mtd->write = doc_write;
        mtd->read_oob = doc_read_oob;
        mtd->write_oob = doc_write_oob;
-       mtd->sync = NULL;
-
-       this->totlen = 0;
-       this->numchips = 0;
-
        this->curfloor = -1;
        this->curchip = -1;
        mutex_init(&this->lock);
index a3f7a27499be86a711b4c57018b8e8b958671969..7543b98f46c46c1524a5f5aeec26b4c567e07d49 100644 (file)
@@ -343,25 +343,17 @@ void DoCMil_init(struct mtd_info *mtd)
 
        mtd->type = MTD_NANDFLASH;
        mtd->flags = MTD_CAP_NANDFLASH;
-       mtd->size = 0;
 
        /* FIXME: erase size is not always 8KiB */
        mtd->erasesize = 0x2000;
-
        mtd->writesize = 512;
        mtd->oobsize = 16;
        mtd->owner = THIS_MODULE;
        mtd->erase = doc_erase;
-       mtd->point = NULL;
-       mtd->unpoint = NULL;
        mtd->read = doc_read;
        mtd->write = doc_write;
        mtd->read_oob = doc_read_oob;
        mtd->write_oob = doc_write_oob;
-       mtd->sync = NULL;
-
-       this->totlen = 0;
-       this->numchips = 0;
        this->curfloor = -1;
        this->curchip = -1;
 
index 99351bc3e0ed32207ecf294ff03bad1b322ea74c..177510d0e7ee0c35a23450e6f66b7fdc944c5a6c 100644 (file)
@@ -467,23 +467,14 @@ void DoCMilPlus_init(struct mtd_info *mtd)
 
        mtd->type = MTD_NANDFLASH;
        mtd->flags = MTD_CAP_NANDFLASH;
-       mtd->size = 0;
-
-       mtd->erasesize = 0;
        mtd->writesize = 512;
        mtd->oobsize = 16;
        mtd->owner = THIS_MODULE;
        mtd->erase = doc_erase;
-       mtd->point = NULL;
-       mtd->unpoint = NULL;
        mtd->read = doc_read;
        mtd->write = doc_write;
        mtd->read_oob = doc_read_oob;
        mtd->write_oob = doc_write_oob;
-       mtd->sync = NULL;
-
-       this->totlen = 0;
-       this->numchips = 0;
        this->curfloor = -1;
        this->curchip = -1;
 
index 22d5099f7786b41fd0631ac32e27d32f7a993bc9..ad11ef0a81f401dc0f2b4e2440f5d27af10e4708 100644 (file)
@@ -1821,13 +1821,10 @@ static void __init doc_set_driver_info(int chip_id, struct mtd_info *mtd)
        mtd->oobsize = DOC_LAYOUT_OOB_SIZE;
        mtd->owner = THIS_MODULE;
        mtd->erase = doc_erase;
-       mtd->point = NULL;
-       mtd->unpoint = NULL;
        mtd->read = doc_read;
        mtd->write = doc_write;
        mtd->read_oob = doc_read_oob;
        mtd->write_oob = doc_write_oob;
-       mtd->sync = NULL;
        mtd->block_isbad = doc_block_isbad;
        mtd->ecclayout = &docg3_oobinfo;
 }