Commit fda02024 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

cocci: Remove redundant AN() checks after REPLACE()

Except those present in varnishtest/vtest.
parent 1b0a51cc
......@@ -246,7 +246,6 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg)
} else {
vsmw_mkent(vsmw, vsmw->idx);
REPLACE(t, VSB_data(vsmw->vsb));
AN(t);
fd = openat(vsmw->vdirfd,
t, O_WRONLY|O_CREAT|O_EXCL, vsmw->mode);
assert(fd >= 0);
......
......@@ -137,7 +137,6 @@ mgt_vcl_import_vmod(struct vclprog *vp, const struct vjsn_val *vv)
ALLOC_OBJ(vf, VMODFILE_MAGIC);
AN(vf);
REPLACE(vf->fname, v_dst);
AN(vf->fname);
VTAILQ_INIT(&vf->vcls);
AZ(mgt_vcl_cache_vmod(v_name, v_file, v_dst));
VTAILQ_INSERT_TAIL(&vmodhead, vf, list);
......
......@@ -1122,7 +1122,6 @@ main(int argc, char * const *argv)
if (format != NULL)
VUT_Error(vut, 1, "Format already set");
REPLACE(format, optarg);
AN(format);
break;
case 'f':
if (format != NULL)
......
......@@ -10,3 +10,10 @@ expression ptr, val;
- ptr = strdup(val);
- AN(ptr);
+ REPLACE(ptr, val);
@@
expression ptr, val;
@@
REPLACE(ptr, val);
- AN(ptr);
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