OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-4596-gfb499c2
Gerrit Code Review
Thu, 26 Feb 2015 12:35:33 -0500
The following commit has been merged in the master branch:
Author: Ben Kaduk <firstname.lastname@example.org>
Date: Wed Feb 11 17:47:10 2015 -0500
Remove spurious NULL checks
clang 3.5 is more aggressive about these checks than the previous
FreeBSD system compiler, so new warnings (which became errors)
appeared on FreeBSD 11-CURRENT.
In afs_dcache.c, checking &tdc->f for NULL-ness has no effect.
The struct fcache f member of struct dcache is an ordinary structure
element; its address will be the value of tdc plus the offset of
f within struct dcache, which will not be NULL even if tdc is NULL.
In ubik_db_if.c, udbHandle is a file-scope global and thus has
allocated storage; the address of a member variable will never
be NULL. The 0 it was compared against was spelled RX_SECIDX_NULL,
which shows the intended check, which is for the value of the
uh_scIndex member variable, not its address.
In afscp_server.c, srv->conns can never be NULL since conns is a member
variable of struct afscp_server (of array type, containing pointers
to struct rx_connection). Comparing the array member variable against
NULL is comparing the address of the array, which is never NULL since
it is not allocated separately from struct afscp_server.
In fssync-debug.c, state.vop->partName is never NULL because
common_volop_prolog always allocates for state.vop, and the
partName member variable of struct fssync_state is of array type,
and thus is not separately allocated from the containing structure.
Reviewed-by: Chas Williams - CONTRACTOR <email@example.com>
Reviewed-by: Perry Ruiter <firstname.lastname@example.org>
Reviewed-by: Benjamin Kaduk <email@example.com>
Tested-by: BuildBot <firstname.lastname@example.org>
src/afs/afs_dcache.c | 14 ++++++--------
src/bucoord/ubik_db_if.c | 2 +-
src/libafscp/afscp_server.c | 2 +-
src/vol/fssync-debug.c | 2 +-
4 files changed, 9 insertions(+), 11 deletions(-)
OpenAFS Master Repository