From: Garrett Wollman Date: Mon, 23 Jul 2012 02:57:41 +0000 (-0400) Subject: afs_bypasscache: parameters of afs_ReadNoCache can't be null X-Git-Tag: openafs-stable-1_8_0pre1~2163 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=78f1e230ce2b7167981e2f327bfdb5d50c94a95f afs_bypasscache: parameters of afs_ReadNoCache can't be null The first two parameters of afs_ReadNoCache() are unconditionally indirected through, and all existing callers appear to guarantee that these parameters are in fact non-null, so annotate the function declaration to so indicate, and remove the one test that checks whether avc (the first parameter) is null. I suspect that acred cannot be null either, but this code does not appear to depend on that, so it's not included in the non-null annotation. Change-Id: I496c868ffcbc9b894f91578019bc30bf7b14fefd Reviewed-on: http://gerrit.openafs.org/7837 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c index dd6ff1c..18d6d6c 100644 --- a/src/afs/afs_bypasscache.c +++ b/src/afs/afs_bypasscache.c @@ -492,7 +492,7 @@ afs_ReadNoCache(struct vcache *avc, /* the reciever will free this */ areq = osi_Alloc(sizeof(struct vrequest)); - if (avc && avc->vc_error) { + if (avc->vc_error) { code = EIO; afs_warn("afs_ReadNoCache VCache Error!\n"); goto cleanup; diff --git a/src/afs/afs_bypasscache.h b/src/afs/afs_bypasscache.h index 2a86eac..5b6d220 100644 --- a/src/afs/afs_bypasscache.h +++ b/src/afs/afs_bypasscache.h @@ -132,7 +132,7 @@ void afs_TransitionToCaching(struct vcache *, afs_ucred_t *, int); /* dispatch a no-cache read request */ afs_int32 afs_ReadNoCache(struct vcache *avc, struct nocache_read_request *bparms, - afs_ucred_t *acred); + afs_ucred_t *acred) AFS_NONNULL((1,2)); /* no-cache prefetch routine */ afs_int32