block: cleanup various NULL pointer comparisons
Subsystems (2)
PATCH 1/1 block: cleanup various NULL pointer comparisons
Remove open-coded NULL comparisons to follow kernel coding style guidelines. While at it, remove a trailing whitespace in blk-core.c.
Signed-off-by Alone Dangal <[email protected]>
--- block/badblocks.c | 2 +- block/bio.c | 2 +- block/blk-core.c | 4 ++-- block/blk-iolatency.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
block/badblocks.c +1 -1
@@ -1374,7 +1374,7 @@ EXPORT_SYMBOL_GPL(badblocks_clear);*/ void ack_all_badblocks (struct badblocks *bb) { -if (bb->page ==NULL || bb->changed) +if (!bb->page || bb->changed)/* no point even trying */ return ;write_seqlock_irq (&bb->lock);
block/bio.c +1 -1
@@ -762,7 +762,7 @@ static int __bio_alloc_cache_prune(struct bio_alloc_cache *cache,unsigned int i =0 ;struct bio *bio; -while ((bio = cache->free_list) !=NULL ) { +while ((bio = cache->free_list)) { cache->free_list = bio->bi_next; cache->nr--;bio_free (bio);
block/blk-core.c +2 -2
@@ -635,7 +635,7 @@ static void __submit_bio(struct bio *bio)blk_mq_submit_bio (bio); }else if (likely (bio_queue_enter (bio) ==0 )) {struct gendisk *disk = bio->bi_bdev->bd_disk; - +if ((bio->bi_opf &REQ_POLLED ) && !(disk->queue->limits.features &BLK_FEAT_POLL )) { bio->bi_status =BLK_STS_NOTSUPP ;
@@ -695,7 +695,7 @@ static void __submit_bio_noacct(struct bio *bio)*/ bio_list_init (&lower);bio_list_init (&same); -while ((bio =bio_list_pop (&bio_list_on_stack[0 ])) !=NULL ) +while ((bio =bio_list_pop (&bio_list_on_stack[0 ])))if (q ==bdev_get_queue (bio->bi_bdev))bio_list_add (&same, bio);else
block/blk-iolatency.c +1 -1
@@ -689,7 +689,7 @@ static void blkiolatency_timer_fn(struct timer_list *t)* We scaled down but don't have a scale_grp, scale up and carry * on. */ -if (lat_info->scale_grp ==NULL ) { +if (!lat_info->scale_grp) {scale_cookie_change (iolat->blkiolat, lat_info, true); goto next_lock; }
Signature · 1 line
2.53.0
Jens Axboe
maintainerQuoted 2 lines · Alone Dangal
Remove open-coded NULL comparisons to follow kernel coding style guidelines. While at it, remove a trailing whitespace in
blk-core.c.
This is just unnecessary churn.
Signature · 1 line
Jens Axboe