FBSD: cast lkmnosys appropriately
authorBen Kaduk <kaduk@mit.edu>
Sat, 23 Jul 2011 18:58:54 +0000 (14:58 -0400)
committerDerrick Brashear <shadow@dementia.org>
Sun, 24 Jul 2011 02:54:11 +0000 (19:54 -0700)
lkmnosys is a function, and as such has its own prototype which
includes a named struct specific to it (struct nosys_args).  When
comparing its address to an entry in the syscall table, we must
cast it to a sy_call_t to correctly do the comparison, lest gcc
warn us about comparing distinct pointer types without a cast.
This warning recently became an error due to bsd.kmod.mk, so it
causes the build to fail on 8.1 and earlier, which do not use
syscall_register() due to a conflicting entry for our syscall
in syscalls.master.

Change-Id: I606aaf73e433a50ea41adaab842d61ee69653bd5
Reported-by: Garrett Wollman
Reviewed-on: http://gerrit.openafs.org/5087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/FBSD/osi_vfsops.c

index b300ff4..35b6fca 100644 (file)
@@ -56,7 +56,7 @@ afs_init(struct vfsconf *vfc)
     }
 #else
     if (sysent[AFS_SYSCALL].sy_call != nosys
-        && sysent[AFS_SYSCALL].sy_call != lkmnosys) {
+        && sysent[AFS_SYSCALL].sy_call != (sy_call_t *)lkmnosys) {
         printf("AFS_SYSCALL in use. aborting\n");
         return EBUSY;
     }