Commit d1ab8244 authored by Bhagyashri P. Dighole's avatar Bhagyashri P. Dighole Committed by Greg Kroah-Hartman

staging: erofs: Modify conditional checks

Fix coding style alignment issues detected by checkpatch.pl
Use ! for NULL test rather than explicitly comparing to NULL.
Signed-off-by: default avatarBhagyashri P. Dighole <digholebhagyashri@gmail.com>
Reviewed-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f0950b02
...@@ -53,7 +53,7 @@ struct page *__erofs_get_meta_page(struct super_block *sb, ...@@ -53,7 +53,7 @@ struct page *__erofs_get_meta_page(struct super_block *sb,
repeat: repeat:
page = find_or_create_page(mapping, blkaddr, gfp); page = find_or_create_page(mapping, blkaddr, gfp);
if (unlikely(page == NULL)) { if (unlikely(!page)) {
DBG_BUGON(nofail); DBG_BUGON(nofail);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
...@@ -177,7 +177,7 @@ int erofs_map_blocks_iter(struct inode *inode, ...@@ -177,7 +177,7 @@ int erofs_map_blocks_iter(struct inode *inode,
{ {
/* by default, reading raw data never use erofs_map_blocks_iter */ /* by default, reading raw data never use erofs_map_blocks_iter */
if (unlikely(!is_inode_layout_compression(inode))) { if (unlikely(!is_inode_layout_compression(inode))) {
if (*mpage_ret != NULL) if (*mpage_ret)
put_page(*mpage_ret); put_page(*mpage_ret);
*mpage_ret = NULL; *mpage_ret = NULL;
...@@ -200,7 +200,7 @@ int erofs_map_blocks(struct inode *inode, ...@@ -200,7 +200,7 @@ int erofs_map_blocks(struct inode *inode,
int err; int err;
err = erofs_map_blocks_iter(inode, map, &mpage, flags); err = erofs_map_blocks_iter(inode, map, &mpage, flags);
if (mpage != NULL) if (mpage)
put_page(mpage); put_page(mpage);
return err; return err;
} }
...@@ -232,7 +232,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio, ...@@ -232,7 +232,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio,
} }
/* note that for readpage case, bio also equals to NULL */ /* note that for readpage case, bio also equals to NULL */
if (bio != NULL && if (bio &&
/* not continuous */ /* not continuous */
*last_block + 1 != current_block) { *last_block + 1 != current_block) {
submit_bio_retry: submit_bio_retry:
...@@ -240,7 +240,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio, ...@@ -240,7 +240,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio,
bio = NULL; bio = NULL;
} }
if (bio == NULL) { if (!bio) {
struct erofs_map_blocks map = { struct erofs_map_blocks map = {
.m_la = blknr_to_addr(current_block), .m_la = blknr_to_addr(current_block),
}; };
...@@ -342,7 +342,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio, ...@@ -342,7 +342,7 @@ static inline struct bio *erofs_read_raw_page(struct bio *bio,
unlock_page(page); unlock_page(page);
/* if updated manually, continuous pages has a gap */ /* if updated manually, continuous pages has a gap */
if (bio != NULL) if (bio)
submit_bio_out: submit_bio_out:
__submit_bio(bio, REQ_OP_READ, 0); __submit_bio(bio, REQ_OP_READ, 0);
...@@ -408,7 +408,7 @@ static int erofs_raw_access_readpages(struct file *filp, ...@@ -408,7 +408,7 @@ static int erofs_raw_access_readpages(struct file *filp,
DBG_BUGON(!list_empty(pages)); DBG_BUGON(!list_empty(pages));
/* the rare case (end in gaps) */ /* the rare case (end in gaps) */
if (unlikely(bio != NULL)) if (unlikely(bio))
__submit_bio(bio, REQ_OP_READ, 0); __submit_bio(bio, REQ_OP_READ, 0);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment