From 91d7cd931a0362b5055c37fc7adc3f5d6015b573 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Fri, 20 Jul 2012 18:35:56 -0400 Subject: [PATCH] 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 --- src/afs/UKERNEL/afs_usrops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.39.5