Skip to contentSkip to conversation

drivers: mtd: ftl.c: Remove intialization of static to 0

PATCH In review Hatice ERTÜRK 2 participants 2 messages Oct 4, 2015 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: mtd: ftl.c: Remove intialization of static to 0

initial value unassigned static variables are automatically set to zero. So it is unnecessary to assign the initial value to zero

---
 drivers/mtd/ftl.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/mtd/ftl.c +6 -6
index dabf084..afec65f 100644
@@ -651,7 +651,7 @@ static int reclaim_block(partition_t *part)
 		      "unit to be prepared...\n");
 		mtd_sync(part->mbd.mtd);
 	    } else {
-		static int ne = 0;
+		static int ne;
 		if (++ne < 5)
 		    printk(KERN_NOTICE "ftl_cs: reclaim failed: no "
 			   "suitable transfer units!\n");
@@ -681,7 +681,7 @@ static int reclaim_block(partition_t *part)
 		eun = i;
 	    }
 	if (best == 0) {
-	    static int ne = 0;
+	    static int ne;
 	    if (++ne < 5)
 		printk(KERN_NOTICE "ftl_cs: reclaim failed: "
 		       "no free blocks!\n");
@@ -765,7 +765,7 @@ static uint32_t find_free(partition_t *part)
 	if (BLOCK_FREE(le32_to_cpu(part->bam_cache[blk]))) break;
     if (blk == part->BlocksPerUnit) {
 #ifdef PSYCHO_DEBUG
-	static int ne = 0;
+	static int ne;
 	if (++ne == 1)
 	    dump_lists(part);
 #endif
@@ -861,7 +861,7 @@ static int set_bam_entry(partition_t *part, uint32_t log_addr,
     if (((virt_addr == 0xfffffffe) && !BLOCK_FREE(old_addr)) ||
 	((virt_addr == 0) && (BLOCK_TYPE(old_addr) != BLOCK_DATA)) ||
 	(!BLOCK_DELETED(virt_addr) && (old_addr != 0xfffffffe))) {
-	static int ne = 0;
+	static int ne;
 	if (++ne < 5) {
 	    printk(KERN_NOTICE "ftl_cs: set_bam_entry() inconsistency!\n");
 	    printk(KERN_NOTICE "ftl_cs:   log_addr = 0x%x, old = 0x%x"
@@ -874,7 +874,7 @@ static int set_bam_entry(partition_t *part, uint32_t log_addr,
     if (part->bam_index == eun) {
 #ifdef PSYCHO_DEBUG
 	if (le32_to_cpu(part->bam_cache[blk]) != old_addr) {
-	    static int ne = 0;
+	    static int ne;
 	    if (++ne < 5) {
 		printk(KERN_NOTICE "ftl_cs: set_bam_entry() "
 		       "inconsistency!\n");
@@ -931,7 +931,7 @@ static int ftl_write(partition_t *part, caddr_t buffer,
 	/* Grab a free block */
 	blk = find_free(part);
 	if (blk == 0) {
-	    static int ne = 0;
+	    static int ne;
 	    if (++ne < 5)
 		printk(KERN_NOTICE "ftl_cs: internal error: "
 		       "no free blocks!\n");
Signature · 1 line
1.9.1
#1 lore raw
Quoted 3 lines · On Sunday 04 October 2015 21:49:53 Hatice ERTÜRK wrote:

initial value unassigned static variables are automatically set to zero. So it is unnecessary to assign the initial value to zero

Hi Hatice,

This file is outside of drivers/staging, which means that Greg won't apply it to his staging tree, and we don't have a mentor that volunteered for drivers/mtd.

Also, the kind of change means that this is something most maintainers would not take. Purely cosmetic coding style changes are definitely ok for staging, but I'd recommend sending them for other subsystems.

Arnd