From: Garrett Wollman Date: Fri, 20 Jul 2012 22:35:56 +0000 (-0400) Subject: uafs: avoid type-punning in get_user_struct() X-Git-Tag: upstream/1.8.0_pre1^2~2181 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=91d7cd931a0362b5055c37fc7adc3f5d6015b573;p=packages%2Fo%2Fopenafs.git uafs: avoid type-punning in get_user_struct() There's no need for type-punning here; usr_getspecific() is a macro that just assigns to the variable whose address we provide, so the cast was just unnecessary (and erroneous) obfuscation. This is the only caller of usr_getspecific(), so if it needs to be more complex in the future, it should probably just be open-coded here. Change-Id: I81286cbce9a00908aa87073b728b07d8bcc8d1d1 Reviewed-on: http://gerrit.openafs.org/7799 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index b44e54bde..018bbd069 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -412,11 +412,12 @@ get_user_struct(void) { struct usr_user *uptr; int st; - st = usr_getspecific(afs_global_u_key, (void **)&uptr); + + st = usr_getspecific(afs_global_u_key, &uptr); usr_assert(st == 0); if (uptr == NULL) { uafs_InitThread(); - st = usr_getspecific(afs_global_u_key, (void **)&uptr); + st = usr_getspecific(afs_global_u_key, &uptr); usr_assert(st == 0); usr_assert(uptr != NULL); }