From 145cd5f74420f592a352535fa7d307a6e81d8ec9 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Sun, 7 Jan 2018 15:30:47 +0100
Subject: [PATCH] WIP easy -Wundef fixes related to __FreeBSD_version.

---
 sys/dev/netif/oce/oce_if.c |  4 ++--
 sys/dev/raid/mps/mps.c     |  2 +-
 sys/dev/raid/mps/mps_sas.c | 18 +++++++++---------
 sys/dev/raid/mps/mpsvar.h  |  4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/sys/dev/netif/oce/oce_if.c b/sys/dev/netif/oce/oce_if.c
index 0055854e47..3587340d66 100644
--- a/sys/dev/netif/oce/oce_if.c
+++ b/sys/dev/netif/oce/oce_if.c
@@ -1004,7 +1004,7 @@ oce_tx_restart(POCE_SOFTC sc, struct oce_wq *wq)
 	if ((sc->ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
-#if __FreeBSD_version >= 800000
+#if 0 /* __FreeBSD_version >= 800000 */
 	if (!drbr_empty(sc->ifp, wq->br))
 #else
 	if (!ifq_is_empty(&sc->ifp->if_snd))
@@ -1321,7 +1321,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_idx, struct oce_nic_rx_cqe *cqe)
 		}
 
 		m->m_pkthdr.rcvif = sc->ifp;
-#if __FreeBSD_version >= 800000
+#if 0 /* __FreeBSD_version >= 800000 */
 		if (rq->queue_index)
 			m->m_pkthdr.flowid = (rq->queue_index - 1);
 		else
diff --git a/sys/dev/raid/mps/mps.c b/sys/dev/raid/mps/mps.c
index 7260fb0eb3..a2b5a485b2 100644
--- a/sys/dev/raid/mps/mps.c
+++ b/sys/dev/raid/mps/mps.c
@@ -1020,7 +1020,7 @@ mps_setup_sysctl(struct mps_softc *sc)
 	    OID_AUTO, "max_chains", CTLFLAG_RD,
 	    &sc->max_chains, 0,"maximum chain frames that will be allocated");
 
-#if __FreeBSD_version >= 900030
+#if 0 /* __FreeBSD_version >= 900030 */
 	SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree),
 	    OID_AUTO, "chain_alloc_fail", CTLFLAG_RD,
 	    &sc->chain_alloc_fail, "chain allocation failures");
diff --git a/sys/dev/raid/mps/mps_sas.c b/sys/dev/raid/mps/mps_sas.c
index 8807b3c9e0..32673081e5 100644
--- a/sys/dev/raid/mps/mps_sas.c
+++ b/sys/dev/raid/mps/mps_sas.c
@@ -149,7 +149,7 @@ static void mpssas_direct_drive_io(struct mpssas_softc *sassc,
 static void mpssas_action_scsiio(struct mpssas_softc *, union ccb *);
 static void mpssas_scsiio_complete(struct mps_softc *, struct mps_command *);
 static void mpssas_action_resetdev(struct mpssas_softc *, union ccb *);
-#if __FreeBSD_version >= 900026
+#if 0 /* __FreeBSD_version >= 900026 */
 static void mpssas_smpio_complete(struct mps_softc *sc, struct mps_command *cm);
 static void mpssas_send_smpcmd(struct mpssas_softc *sassc, union ccb *ccb,
 			       uint64_t sasaddr);
@@ -161,7 +161,7 @@ static int  mpssas_send_reset(struct mps_softc *sc, struct mps_command *tm, uint
 static void mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb);
 static void mpssas_rescan_done(struct cam_periph *periph, union ccb *done_ccb);
 static void mpssas_scanner_thread(void *arg);
-#if __FreeBSD_version >= 1000006
+#if 0 /* __FreeBSD_version >= 1000006 */
 static void mpssas_async(void *callback_arg, uint32_t code,
 			 struct cam_path *path, void *arg);
 #else
@@ -685,7 +685,7 @@ int
 mps_attach_sas(struct mps_softc *sc)
 {
 	struct mpssas_softc *sassc;
-#if __FreeBSD_version >= 1000006
+#if 0 /* __FreeBSD_version >= 1000006 */
 	cam_status status;
 #endif
 	int unit, error = 0;
@@ -763,7 +763,7 @@ mps_attach_sas(struct mps_softc *sc)
 
 	sassc->tm_count = 0;
 
-#if __FreeBSD_version >= 1000006
+#if 0 /* __FreeBSD_version >= 1000006 */
 	status = xpt_register_async(AC_ADVINFO_CHANGED, mpssas_async, sc, NULL);
 	if (status != CAM_REQ_CMP) {
 		mps_printf(sc, "Error %#x registering async handler for "
@@ -805,7 +805,7 @@ mps_detach_sas(struct mps_softc *sc)
 	mps_lock(sc);
 
 	/* Deregister our async handler */
-#if __FreeBSD_version >= 1000006
+#if 0 /* __FreeBSD_version >= 1000006 */
 	xpt_register_async(0, mpssas_async, sc, NULL);
 #endif
 
@@ -923,7 +923,7 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb)
 		cpi->transport_version = 0;
 		cpi->protocol = PROTO_SCSI;
 		cpi->protocol_version = SCSI_REV_SPC;
-#if __FreeBSD_version >= 800001
+#if 0 /* __FreeBSD_version >= 800001 */
 		/*
 		 * XXX KDM where does this number come from?
 		 */
@@ -992,7 +992,7 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb)
 	case XPT_SCSI_IO:
 		mpssas_action_scsiio(sassc, ccb);
 		return;
-#if __FreeBSD_version >= 900026
+#if 0 /* __FreeBSD_version >= 900026 */
 	case XPT_SMP_IO:
 		mpssas_action_smpio(sassc, ccb);
 		return;
@@ -2392,7 +2392,7 @@ mpssas_direct_drive_io(struct mpssas_softc *sassc, struct mps_command *cm,
 	}
 }
 
-#if __FreeBSD_version >= 900026
+#if 0 /* __FreeBSD_version >= 900026 */
 static void
 mpssas_smpio_complete(struct mps_softc *sc, struct mps_command *cm)
 {
@@ -2946,7 +2946,7 @@ mpssas_rescan(struct mpssas_softc *sassc, union ccb *ccb)
 	wakeup(&sassc->ccb_scanq);
 }
 
-#if __FreeBSD_version >= 1000006
+#if 0 /* __FreeBSD_version >= 1000006 */
 static void
 mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path,
 	     void *arg)
diff --git a/sys/dev/raid/mps/mpsvar.h b/sys/dev/raid/mps/mpsvar.h
index d196dc5110..8f77da6456 100644
--- a/sys/dev/raid/mps/mpsvar.h
+++ b/sys/dev/raid/mps/mpsvar.h
@@ -301,7 +301,7 @@ struct mps_softc {
 	int				chain_free;
 	int				max_chains;
 	int				chain_free_lowwater;
-#if __FreeBSD_version >= 900030
+#if 0 /* __FreeBSD_version >= 900030 */
 	uint64_t			chain_alloc_fail;
 #endif
 	struct sysctl_ctx_list		sysctl_ctx;
@@ -493,7 +493,7 @@ mps_alloc_chain(struct mps_softc *sc)
 		if (sc->chain_free < sc->chain_free_lowwater)
 			sc->chain_free_lowwater = sc->chain_free;
 	}
-#if __FreeBSD_version >= 900030
+#if 0 /* __FreeBSD_version >= 900030 */
 	else
 		sc->chain_alloc_fail++;
 #endif
-- 
2.15.0

