Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Tested-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Keith Busch and committed by
Jens Axboe
1165d20f e87d66ab

+3 -4
+3 -4
drivers/block/null_blk/main.c
··· 1161 1161 return 0; 1162 1162 } 1163 1163 1164 - static int copy_from_nullb(struct nullb *nullb, struct page *dest, 1164 + static void copy_from_nullb(struct nullb *nullb, struct page *dest, 1165 1165 unsigned int off, sector_t sector, size_t n) 1166 1166 { 1167 1167 size_t temp, count = 0; ··· 1184 1184 count += temp; 1185 1185 sector += temp >> SECTOR_SHIFT; 1186 1186 } 1187 - return 0; 1188 1187 } 1189 1188 1190 1189 static void nullb_fill_pattern(struct nullb *nullb, struct page *page, ··· 1247 1248 sector, len); 1248 1249 1249 1250 if (valid_len) { 1250 - err = copy_from_nullb(nullb, page, off, 1251 - sector, valid_len); 1251 + copy_from_nullb(nullb, page, off, sector, 1252 + valid_len); 1252 1253 off += valid_len; 1253 1254 len -= valid_len; 1254 1255 }