Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2010 23:38:25 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209082 - head/sys/sys
Message-ID:  <201006112338.o5BNcPC3024558@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Fri Jun 11 23:38:25 2010
New Revision: 209082
URL: http://svn.freebsd.org/changeset/base/209082

Log:
  Apply band-aid around function-like macro fdrop() without turning it into
  a real (inline) function or applying void casting for all its consumers.
  In most of places, the "return value" is not checked nor assigned, which
  causes too many warnings for some smart compilers, i.e., clang.
  
  Found by:	clang

Modified:
  head/sys/sys/file.h

Modified: head/sys/sys/file.h
==============================================================================
--- head/sys/sys/file.h	Fri Jun 11 22:59:47 2010	(r209081)
+++ head/sys/sys/file.h	Fri Jun 11 23:38:25 2010	(r209082)
@@ -201,10 +201,17 @@ int fgetvp_write(struct thread *td, int 
 int fgetsock(struct thread *td, int fd, struct socket **spp, u_int *fflagp);
 void fputsock(struct socket *sp);
 
+static __inline int
+_fnoop(void)
+{
+
+	return (0);
+}
+
 #define	fhold(fp)							\
 	(refcount_acquire(&(fp)->f_count))
 #define	fdrop(fp, td)							\
-	(refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : 0)
+	(refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : _fnoop())
 
 static __inline fo_rdwr_t	fo_read;
 static __inline fo_rdwr_t	fo_write;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006112338.o5BNcPC3024558>