From 70020fe0fae7040b7fcf36c156e01de04a76496c Mon Sep 17 00:00:00 2001
From: dim <dim@FreeBSD.org>
Date: Fri, 20 Apr 2012 21:43:19 +0000
Subject: Fix the following compilation warnings in nxge(4):

  sys/dev/nxge/if_nxge.c:1276:11: error: case value not in enumerated type 'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch]
	      case XGE_LL_EVENT_TRY_XMIT_AGAIN:
		   ^
  sys/dev/nxge/if_nxge.c:1289:11: error: case value not in enumerated type 'xge_hal_event_e' (aka 'enum xge_hal_event_e') [-Werror,-Wswitch]
	      case XGE_LL_EVENT_DEVICE_RESETTING:
		   ^

This is because the switch uses xge_queue_item_t::event_type, which is
an enum xge_hal_event_e, while the XGE_LL_EVENT_xx values are of the
enum xge_event_e.

Since messing around with the enum definitions is too disruptive, the
simplest fix is to cast the argument of the switch to int.

Reviewed by:	gnn
MFC after:	1 week
---
 sys/dev/nxge/if_nxge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'sys/dev/nxge/if_nxge.c')

diff --git a/sys/dev/nxge/if_nxge.c b/sys/dev/nxge/if_nxge.c
index 0e67413..8c3ca5d 100644
--- a/sys/dev/nxge/if_nxge.c
+++ b/sys/dev/nxge/if_nxge.c
@@ -1272,7 +1272,7 @@ xge_callback_event(xge_queue_item_t *item)
 	lldev  = xge_hal_device_private(hldev);
 	ifnetp = lldev->ifnetp;
 
-	switch(item->event_type) {
+	switch((int)item->event_type) {
 	    case XGE_LL_EVENT_TRY_XMIT_AGAIN:
 	        if(lldev->initialized) {
 	            if(xge_hal_channel_dtr_count(lldev->fifo_channel[0]) > 0) {
-- 
cgit v1.1