Skip to contentSkip to conversation

fat: remove redundant assignment of 0 to slots

PATCH Applied Colin King 2 participants 2 messages Oct 17, 2017 – Oct 18, 2017

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 fat: remove redundant assignment of 0 to slots

From: Colin Ian King <[email protected]>

The variable slots is being assigned a value of zero that is never read, slots is being updated again a few lines later. Remove this redundant assignment.
Cleans clang warning: Value stored to 'slots' is never read

---
 fs/fat/dir.c | 1 -
 1 file changed, 1 deletion(-)
fs/fat/dir.c +0 -1
index 81cecbe6d7cf..b833ffeee1e1 100644
@@ -291,7 +291,6 @@ static int fat_parse_long(struct inode *dir, loff_t *pos,
 		}
 	}
 parse_long:
-	slots = 0;
 	ds = (struct msdos_dir_slot *)*de;
 	id = ds->id;
 	if (!(id & 0x40))
Signature · 1 line
2.14.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variable slots is being assigned a value of zero that is never read, slots is being updated again a few lines later. Remove this redundant assignment.
Cleans clang warning: Value stored to 'slots' is never read

Looks like good (if old gcc didn't have false positive warning).

Quoted 16 lines
---
 fs/fat/dir.c | 1 -
 1 file changed, 1 deletion(-)
fs/fat/dir.c +0 -1
index 81cecbe6d7cf..b833ffeee1e1 100644
@@ -291,7 +291,6 @@ static int fat_parse_long(struct inode *dir, loff_t *pos,
 		}
 	}
 parse_long:
-	slots = 0;
 	ds = (struct msdos_dir_slot *)*de;
 	id = ds->id;
 	if (!(id & 0x40))
Signature · 1 line
OGAWA Hirofumi <[email protected]>