Commit 196ef5f3 authored by Pavel Zemlyanoy's avatar Pavel Zemlyanoy Committed by Greg Kroah-Hartman

staging: erofs: formatting fix to NULL comparison

This patch does not change the logic, it only
corrects the formatting and checkpatch checks by
to NULL comparison.

The patch fixes 5 checks of type:
"Comparison to NULL could be written".
Signed-off-by: default avatarPavel Zemlyanoy <zemlyanoy@ispras.ru>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Reviewed-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e84e1ed8
...@@ -42,8 +42,8 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages, ...@@ -42,8 +42,8 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages,
struct page *page = pages[i]; struct page *page = pages[i];
void *dst; void *dst;
if (page == NULL) { if (!page) {
if (src != NULL) { if (src) {
if (!mirrored[j]) if (!mirrored[j])
kunmap_atomic(src); kunmap_atomic(src);
src = NULL; src = NULL;
...@@ -64,7 +64,7 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages, ...@@ -64,7 +64,7 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages,
} }
if (i) { if (i) {
if (src == NULL) if (!src)
src = mirrored[i-1] ? src = mirrored[i-1] ?
percpu_data + (i-1) * PAGE_SIZE : percpu_data + (i-1) * PAGE_SIZE :
kmap_atomic(compressed_pages[i-1]); kmap_atomic(compressed_pages[i-1]);
...@@ -92,7 +92,7 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages, ...@@ -92,7 +92,7 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages,
kunmap_atomic(dst); kunmap_atomic(dst);
} }
if (src != NULL && !mirrored[j]) if (src && !mirrored[j])
kunmap_atomic(src); kunmap_atomic(src);
preempt_enable(); preempt_enable();
...@@ -136,7 +136,7 @@ int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages, ...@@ -136,7 +136,7 @@ int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages,
for (i = 0; i < nr_pages; ++i) { for (i = 0; i < nr_pages; ++i) {
j = min((unsigned int)PAGE_SIZE - pageofs, outlen); j = min((unsigned int)PAGE_SIZE - pageofs, outlen);
if (pages[i] != NULL) { if (pages[i]) {
if (ret < 0) if (ret < 0)
SetPageError(pages[i]); SetPageError(pages[i]);
else if (clusterpages == 1 && pages[i] == compressed_pages[0]) else if (clusterpages == 1 && pages[i] == compressed_pages[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