Skip to contentSkip to conversation

filefrag: remove useless assignment

PATCH Applied Jim Meyering 2 participants 2 messages Feb 2, 2011 – Feb 7, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 filefrag: remove useless assignment

Barely worth posting, but...
There's no point in setting fiemap->ANYTHING
when the very next statement zeros the entire buffer. The correct initialization is already done after the memset.

Quoted 1 line

From b2e2dd33c57dbae034b9ea7830d21681bc788fbe Mon Sep 17 00:00:00 2001

From: Jim Meyering <[email protected]>
Date: Tue, 1 Feb 2011 19:25:35 +0100
Subject: [PATCH] filefrag: remove useless assignment

The very next one memset's all bytes of fiemap to 0.

---
 misc/filefrag.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
misc/filefrag.c +0 -1
index bd4486d..d604b6c 100644
@@ -168,28 +168,26 @@ static int filefrag_fiemap(int fd, int blk_shift, int *num_extents)
 	struct fiemap *fiemap = (struct fiemap *)buf;
 	struct fiemap_extent *fm_ext = &fiemap->fm_extents[0];
 	int count = (sizeof(buf) - sizeof(*fiemap)) /
 			sizeof(struct fiemap_extent);
 	unsigned long long last_blk = 0;
 	unsigned long flags = 0;
 	unsigned int i;
 	static int fiemap_incompat_printed;
 	int fiemap_header_printed = 0;
 	int tot_extents = 1, n = 0;
 	int last = 0;
 	int rc;
 
-	fiemap->fm_length = ~0ULL;
Applied
#1 lore raw
Quoted 4 lines · Jim Meyering

Barely worth posting, but...
There's no point in setting fiemap->ANYTHING
when the very next statement zeros the entire buffer. The correct initialization is already done after the memset.

Thanks, applied.

- Ted