Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero

@@ -55,11 +55,11 @@
 static int
 dump_bytes(dmu_sendarg_t *dsp, void *buf, int len)
 {
         dsl_dataset_t *ds = dsp->dsa_os->os_dsl_dataset;
         ssize_t resid; /* have to get resid to get detailed errno */
-        ASSERT3U(len % 8, ==, 0);
+        ASSERT0(len % 8);
 
         fletcher_4_incremental_native(buf, len, &dsp->dsa_zc);
         dsp->dsa_err = vn_rdwr(UIO_WRITE, dsp->dsa_vp,
             (caddr_t)buf, len,
             0, UIO_SYSSPACE, FAPPEND, RLIM64_INFINITY, CRED(), &resid);

@@ -959,11 +959,11 @@
 {
         void *rv;
         int done = 0;
 
         /* some things will require 8-byte alignment, so everything must */
-        ASSERT3U(len % 8, ==, 0);
+        ASSERT0(len % 8);
 
         while (done < len) {
                 ssize_t resid;
 
                 ra->err = vn_rdwr(UIO_READ, ra->vp,

@@ -1643,11 +1643,11 @@
         mutex_exit(&ds->ds_recvlock);
         if (err == 0 && drc->drc_guid_to_ds_map != NULL)
                 (void) add_ds_to_guidmap(drc->drc_guid_to_ds_map, ds);
         dsl_dataset_disown(ds, dmu_recv_tag);
         myerr = dsl_dataset_destroy(drc->drc_real_ds, dmu_recv_tag, B_FALSE);
-        ASSERT3U(myerr, ==, 0);
+        ASSERT0(myerr);
         return (err);
 }
 
 static int
 dmu_recv_new_end(dmu_recv_cookie_t *drc)