Skip to content

Commit 51590df

Browse files
zhengbin13dhowells
authored andcommitted
afs: Remove set but not used variables 'before', 'after'
Fixes gcc '-Wunused-but-set-variable' warning: fs/afs/dir_edit.c: In function afs_set_contig_bits: fs/afs/dir_edit.c:75:20: warning: variable after set but not used [-Wunused-but-set-variable] fs/afs/dir_edit.c: In function afs_set_contig_bits: fs/afs/dir_edit.c:75:12: warning: variable before set but not used [-Wunused-but-set-variable] fs/afs/dir_edit.c: In function afs_clear_contig_bits: fs/afs/dir_edit.c:100:20: warning: variable after set but not used [-Wunused-but-set-variable] fs/afs/dir_edit.c: In function afs_clear_contig_bits: fs/afs/dir_edit.c:100:12: warning: variable before set but not used [-Wunused-but-set-variable] They are never used since commit 63a4681. Fixes: 63a4681 ("afs: Locally edit directory data for mkdir/create/unlink/...") Reported-by: Hulk Robot <[email protected]> Signed-off-by: zhengbin <[email protected]> Signed-off-by: David Howells <[email protected]>
1 parent 2e2fae9 commit 51590df

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

fs/afs/dir_edit.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,11 @@ static int afs_find_contig_bits(union afs_xdr_dir_block *block, unsigned int nr_
6868
static void afs_set_contig_bits(union afs_xdr_dir_block *block,
6969
int bit, unsigned int nr_slots)
7070
{
71-
u64 mask, before, after;
71+
u64 mask;
7272

7373
mask = (1 << nr_slots) - 1;
7474
mask <<= bit;
7575

76-
before = *(u64 *)block->hdr.bitmap;
77-
7876
block->hdr.bitmap[0] |= (u8)(mask >> 0 * 8);
7977
block->hdr.bitmap[1] |= (u8)(mask >> 1 * 8);
8078
block->hdr.bitmap[2] |= (u8)(mask >> 2 * 8);
@@ -83,8 +81,6 @@ static void afs_set_contig_bits(union afs_xdr_dir_block *block,
8381
block->hdr.bitmap[5] |= (u8)(mask >> 5 * 8);
8482
block->hdr.bitmap[6] |= (u8)(mask >> 6 * 8);
8583
block->hdr.bitmap[7] |= (u8)(mask >> 7 * 8);
86-
87-
after = *(u64 *)block->hdr.bitmap;
8884
}
8985

9086
/*
@@ -93,13 +89,11 @@ static void afs_set_contig_bits(union afs_xdr_dir_block *block,
9389
static void afs_clear_contig_bits(union afs_xdr_dir_block *block,
9490
int bit, unsigned int nr_slots)
9591
{
96-
u64 mask, before, after;
92+
u64 mask;
9793

9894
mask = (1 << nr_slots) - 1;
9995
mask <<= bit;
10096

101-
before = *(u64 *)block->hdr.bitmap;
102-
10397
block->hdr.bitmap[0] &= ~(u8)(mask >> 0 * 8);
10498
block->hdr.bitmap[1] &= ~(u8)(mask >> 1 * 8);
10599
block->hdr.bitmap[2] &= ~(u8)(mask >> 2 * 8);
@@ -108,8 +102,6 @@ static void afs_clear_contig_bits(union afs_xdr_dir_block *block,
108102
block->hdr.bitmap[5] &= ~(u8)(mask >> 5 * 8);
109103
block->hdr.bitmap[6] &= ~(u8)(mask >> 6 * 8);
110104
block->hdr.bitmap[7] &= ~(u8)(mask >> 7 * 8);
111-
112-
after = *(u64 *)block->hdr.bitmap;
113105
}
114106

115107
/*

0 commit comments

Comments
 (0)