Skip to content

Commit f0418e4

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: remove unneeded variable done
Function gfs2_write_buf_to_page uses variable done to exit its loop, but it's unnecessary if we just code an infinite loop and exit when we need. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent d96dad2 commit f0418e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/gfs2/quota.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ static int gfs2_write_buf_to_page(struct gfs2_sbd *sdp, unsigned long index,
740740
u64 blk;
741741
unsigned bsize = sdp->sd_sb.sb_bsize, bnum = 0, boff = 0;
742742
unsigned to_write = bytes, pg_off = off;
743-
int done = 0;
744743

745744
blk = index << (PAGE_SHIFT - sdp->sd_sb.sb_bsize_shift);
746745
boff = off % bsize;
@@ -752,7 +751,7 @@ static int gfs2_write_buf_to_page(struct gfs2_sbd *sdp, unsigned long index,
752751
create_empty_buffers(page, bsize, 0);
753752

754753
bh = page_buffers(page);
755-
while (!done) {
754+
for(;;) {
756755
/* Find the beginning block within the page */
757756
if (pg_off >= ((bnum * bsize) + bsize)) {
758757
bh = bh->b_this_page;
@@ -781,7 +780,7 @@ static int gfs2_write_buf_to_page(struct gfs2_sbd *sdp, unsigned long index,
781780
boff = pg_off % bsize;
782781
continue;
783782
}
784-
done = 1;
783+
break;
785784
}
786785

787786
/* Write to the page, now that we have setup the buffer(s) */

0 commit comments

Comments
 (0)