Skip to content

Commit 1165d20

Browse files
keithbuschaxboe
authored andcommitted
null_blk: simplify copy_from_nullb
It always returns success, so the code that saves the errors status, but proceeds without checking it looks a bit odd. Clean this up. Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Tested-by: Hans Holmberg <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent e87d66a commit 1165d20

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/block/null_blk/main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ static int copy_to_nullb(struct nullb *nullb, struct page *source,
11611161
return 0;
11621162
}
11631163

1164-
static int copy_from_nullb(struct nullb *nullb, struct page *dest,
1164+
static void copy_from_nullb(struct nullb *nullb, struct page *dest,
11651165
unsigned int off, sector_t sector, size_t n)
11661166
{
11671167
size_t temp, count = 0;
@@ -1184,7 +1184,6 @@ static int copy_from_nullb(struct nullb *nullb, struct page *dest,
11841184
count += temp;
11851185
sector += temp >> SECTOR_SHIFT;
11861186
}
1187-
return 0;
11881187
}
11891188

11901189
static void nullb_fill_pattern(struct nullb *nullb, struct page *page,
@@ -1248,8 +1247,8 @@ static int null_transfer(struct nullb *nullb, struct page *page,
12481247
sector, len);
12491248

12501249
if (valid_len) {
1251-
err = copy_from_nullb(nullb, page, off,
1252-
sector, valid_len);
1250+
copy_from_nullb(nullb, page, off, sector,
1251+
valid_len);
12531252
off += valid_len;
12541253
len -= valid_len;
12551254
}

0 commit comments

Comments
 (0)