diff mbox series

[2/7] dm vdo: fix sparse 'warning: Using plain integer as NULL pointer'

Message ID 454e6715c7d8811765295ba656e60a09f294373d.1707184413.git.msakai@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series dm vdo: fix sparse warnings | expand

Commit Message

Matthew Sakai Feb. 6, 2024, 2:04 a.m. UTC
From: Mike Snitzer <snitzer@kernel.org>

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
---
 drivers/md/dm-vdo/index.c | 8 ++++----
 drivers/md/dm-vdo/vdo.c   | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/md/dm-vdo/index.c b/drivers/md/dm-vdo/index.c
index e343a973881d..1596f6ba43a5 100644
--- a/drivers/md/dm-vdo/index.c
+++ b/drivers/md/dm-vdo/index.c
@@ -732,18 +732,18 @@  static void close_chapters(void *arg)
 
 static void stop_chapter_writer(struct chapter_writer *writer)
 {
-	struct thread *writer_thread = 0;
+	struct thread *writer_thread = NULL;
 
 	uds_lock_mutex(&writer->mutex);
-	if (writer->thread != 0) {
+	if (writer->thread != NULL) {
 		writer_thread = writer->thread;
-		writer->thread = 0;
+		writer->thread = NULL;
 		writer->stop = true;
 		uds_broadcast_cond(&writer->cond);
 	}
 	uds_unlock_mutex(&writer->mutex);
 
-	if (writer_thread != 0)
+	if (writer_thread != NULL)
 		uds_join_threads(writer_thread);
 }
 
diff --git a/drivers/md/dm-vdo/vdo.c b/drivers/md/dm-vdo/vdo.c
index 1ead769f0150..e0eddd4007b8 100644
--- a/drivers/md/dm-vdo/vdo.c
+++ b/drivers/md/dm-vdo/vdo.c
@@ -889,7 +889,8 @@  int vdo_synchronous_flush(struct vdo *vdo)
 	int result;
 	struct bio bio;
 
-	bio_init(&bio, vdo_get_backing_device(vdo), 0, 0, REQ_OP_WRITE | REQ_PREFLUSH);
+	bio_init(&bio, vdo_get_backing_device(vdo), NULL, 0,
+		 REQ_OP_WRITE | REQ_PREFLUSH);
 	submit_bio_wait(&bio);
 	result = blk_status_to_errno(bio.bi_status);