Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2018 13:35:06 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336062 - head/sys/net
Message-ID:  <201807071335.w67DZ6rl031106@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbruno
Date: Sat Jul  7 13:35:06 2018
New Revision: 336062
URL: https://svnweb.freebsd.org/changeset/base/336062

Log:
  struct ifmediareq *ifmrp is only used in the COMPAT_FREEBSD32 parts of
  ifioctl().  Move it inside the proper #ifdef.  This was throwing a valid
  "Assigned but unused" warning with gcc.
  
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D16063

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Sat Jul  7 12:28:16 2018	(r336061)
+++ head/sys/net/if.c	Sat Jul  7 13:35:06 2018	(r336062)
@@ -2969,8 +2969,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s
 #ifdef COMPAT_FREEBSD32
 	caddr_t saved_data = NULL;
 	struct ifmediareq ifmr;
-#endif
 	struct ifmediareq *ifmrp;
+#endif
 	struct ifnet *ifp;
 	struct ifreq *ifr;
 	int error;
@@ -3016,8 +3016,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s
 #endif
 	}
 
-	ifmrp = NULL;
 #ifdef COMPAT_FREEBSD32
+	ifmrp = NULL;
 	switch (cmd) {
 	case SIOCGIFMEDIA32:
 	case SIOCGIFXMEDIA32:



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