Skip to content

Commit b916e94

Browse files
robnlundman
authored andcommitted
Prefer VERIFY0P(n) over VERIFY(n == NULL)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <robn@despairlabs.com> Sponsored-by: https://despairlabs.com/sponsor/ Closes openzfs#17591
1 parent 190e8f7 commit b916e94

31 files changed

Lines changed: 97 additions & 97 deletions

cmd/zdb/zdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,7 @@ dsl_deadlist_entry_count_refd(void *arg, dsl_deadlist_entry_t *dle)
31103110
static int
31113111
dsl_deadlist_entry_dump(void *arg, dsl_deadlist_entry_t *dle)
31123112
{
3113-
ASSERT(arg == NULL);
3113+
ASSERT0P(arg);
31143114
if (dump_opt['d'] >= 5) {
31153115
char buf[128];
31163116
(void) snprintf(buf, sizeof (buf),
@@ -9749,7 +9749,7 @@ main(int argc, char **argv)
97499749
if (error == 0) {
97509750
if (dump_opt['k'] && (target_is_spa || dump_opt['R'])) {
97519751
ASSERT(checkpoint_pool != NULL);
9752-
ASSERT(checkpoint_target == NULL);
9752+
ASSERT0P(checkpoint_target);
97539753

97549754
error = spa_open(checkpoint_pool, &spa, FTAG);
97559755
if (error != 0) {

include/os/freebsd/spl/sys/proc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
7777
/*
7878
* Be sure there are no surprises.
7979
*/
80-
ASSERT(stk == NULL);
80+
ASSERT0P(stk);
8181
ASSERT0(len);
8282
ASSERT(state == TS_RUN);
8383

include/sys/dmu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,8 @@ dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync,
742742
dmu_buf_evict_func_t *evict_func_async,
743743
dmu_buf_t **clear_on_evict_dbufp __maybe_unused)
744744
{
745-
ASSERT(dbu->dbu_evict_func_sync == NULL);
746-
ASSERT(dbu->dbu_evict_func_async == NULL);
745+
ASSERT0P(dbu->dbu_evict_func_sync);
746+
ASSERT0P(dbu->dbu_evict_func_async);
747747

748748
/* must have at least one evict func */
749749
IMPLY(evict_func_sync == NULL, evict_func_async != NULL);

lib/libzfs/libzfs_sendrecv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5560,7 +5560,7 @@ zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap,
55605560
if ((cp = strchr(nonpackage_sendfs, '@')) != NULL)
55615561
*cp = '\0';
55625562
sendfs = nonpackage_sendfs;
5563-
VERIFY(finalsnap == NULL);
5563+
VERIFY0P(finalsnap);
55645564
}
55655565
return (zfs_receive_one(hdl, infd, tosnap, originsnap, flags,
55665566
&drr, &drr_noswap, sendfs, stream_nv, stream_avl, top_zfs,

module/avl/avl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ avl_nearest(avl_tree_t *tree, avl_index_t where, int direction)
225225
size_t off = tree->avl_offset;
226226

227227
if (node == NULL) {
228-
ASSERT(tree->avl_root == NULL);
228+
ASSERT0P(tree->avl_root);
229229
return (NULL);
230230
}
231231
data = AVL_NODE2DATA(node, off);
@@ -495,10 +495,10 @@ avl_insert(avl_tree_t *tree, void *new_data, avl_index_t where)
495495
AVL_SETBALANCE(node, 0);
496496
AVL_SETPARENT(node, parent);
497497
if (parent != NULL) {
498-
ASSERT(parent->avl_child[which_child] == NULL);
498+
ASSERT0P(parent->avl_child[which_child]);
499499
parent->avl_child[which_child] = node;
500500
} else {
501-
ASSERT(tree->avl_root == NULL);
501+
ASSERT0P(tree->avl_root);
502502
tree->avl_root = node;
503503
}
504504
/*
@@ -608,7 +608,7 @@ avl_insert_here(
608608
ASSERT(diff > 0 ? child == 1 : child == 0);
609609
#endif
610610
}
611-
ASSERT(node->avl_child[child] == NULL);
611+
ASSERT0P(node->avl_child[child]);
612612

613613
avl_insert(tree, new_data, AVL_MKINDEX(node, child));
614614
}
@@ -898,7 +898,7 @@ avl_destroy(avl_tree_t *tree)
898898
{
899899
ASSERT(tree);
900900
ASSERT0(tree->avl_numnodes);
901-
ASSERT(tree->avl_root == NULL);
901+
ASSERT0P(tree->avl_root);
902902
}
903903

904904

module/os/linux/spl/spl-condvar.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ void
6666
__cv_init(kcondvar_t *cvp, char *name, kcv_type_t type, void *arg)
6767
{
6868
ASSERT(cvp);
69-
ASSERT(name == NULL);
69+
ASSERT0P(name);
7070
ASSERT(type == CV_DEFAULT);
71-
ASSERT(arg == NULL);
71+
ASSERT0P(arg);
7272

7373
cvp->cv_magic = CV_MAGIC;
7474
init_waitqueue_head(&cvp->cv_event);
@@ -83,7 +83,7 @@ static int
8383
cv_destroy_wakeup(kcondvar_t *cvp)
8484
{
8585
if (!atomic_read(&cvp->cv_waiters) && !atomic_read(&cvp->cv_refs)) {
86-
ASSERT(cvp->cv_mutex == NULL);
86+
ASSERT0P(cvp->cv_mutex);
8787
ASSERT(!waitqueue_active(&cvp->cv_event));
8888
return (1);
8989
}

module/os/linux/spl/spl-kmem-cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,8 @@ spl_kmem_cache_create(const char *name, size_t size, size_t align,
679679
/*
680680
* Unsupported flags
681681
*/
682-
ASSERT(vmp == NULL);
683-
ASSERT(reclaim == NULL);
682+
ASSERT0P(vmp);
683+
ASSERT0P(reclaim);
684684

685685
might_sleep();
686686

module/os/linux/spl/spl-thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func,
8080

8181
/* Option pp is simply ignored */
8282
/* Variable stack size unsupported */
83-
ASSERT(stk == NULL);
83+
ASSERT0P(stk);
8484

8585
tp = kmem_alloc(sizeof (thread_priv_t), KM_PUSHPAGE);
8686
if (tp == NULL)

module/os/linux/zfs/zfs_acl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,7 @@ zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr)
22052205

22062206
error = zfs_aclset_common(zp, aclp, cr, tx);
22072207
ASSERT0(error);
2208-
ASSERT(zp->z_acl_cached == NULL);
2208+
ASSERT0P(zp->z_acl_cached);
22092209
zp->z_acl_cached = aclp;
22102210

22112211
if (fuid_dirtied)

module/os/linux/zfs/zfs_ctldir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ zfsctl_inode_lookup(zfsvfs_t *zfsvfs, uint64_t id,
590590
int
591591
zfsctl_create(zfsvfs_t *zfsvfs)
592592
{
593-
ASSERT(zfsvfs->z_ctldir == NULL);
593+
ASSERT0P(zfsvfs->z_ctldir);
594594

595595
zfsvfs->z_ctldir = zfsctl_inode_alloc(zfsvfs, ZFSCTL_INO_ROOT,
596596
&zpl_fops_root, &zpl_ops_root, 0);

0 commit comments

Comments
 (0)