From ad81d4904ca9f710cf4d56de31eca994dc005844 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 21 Sep 2021 18:52:20 +0200 Subject: start using sparse's `-Wnon-pointer-null` While I personally don't see a reason to use NULL instead of 0, I assume that whoever made that a sparse default knew what they were doing. --- src/kernel/mem/virt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernel/mem') diff --git a/src/kernel/mem/virt.c b/src/kernel/mem/virt.c index 1fa5a10..b15297e 100644 --- a/src/kernel/mem/virt.c +++ b/src/kernel/mem/virt.c @@ -6,7 +6,7 @@ void virt_iter_new( struct virt_iter *iter, void __user *virt, size_t length, struct pagedir *pages, bool user, bool writeable) { - iter->frag = 0; + iter->frag = NULL; iter->frag_len = 0; iter->prior = 0; iter->error = false; @@ -35,7 +35,7 @@ bool virt_iter_next(struct virt_iter *iter) { iter->frag = pagedir_virt2phys(iter->_pages, iter->_virt, iter->_user, iter->_writeable); - if (iter->frag == 0) { + if (!iter->frag) { iter->error = true; return false; } -- cgit v1.2.3