Skip to contentSkip to conversation

: ir247_debug_warn.diff

PATCH New Jean Tourrilhes 1 participant 1 message Jan 9, 2002 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : ir247_debug_warn.diff

ir247_debug_warn.diff :
---------------------
<Patch from Kai Germaschewski>
o [FEATURE] Remove compiler warning when not using DEBUG

net/irda/irda_device.c renamed from net/irda/irda_device.d8.c +2 -0
diff -u -p linux/net/irda/irda_device.d8.c linux/net/irda/irda_device.c
@@ -81,6 +81,7 @@ const char *infrared_mode[] = {
 	"TV_REMOTE",
 };
 
+#ifdef CONFIG_IRDA_DEBUG
 static const char *task_state[] = {
 	"IRDA_TASK_INIT",
 	"IRDA_TASK_DONE", 
@@ -92,6 +93,7 @@ static const char *task_state[] = {
 	"IRDA_TASK_CHILD_WAIT",
 	"IRDA_TASK_CHILD_DONE",
 };
+#endif	/* CONFIG_IRDA_DEBUG */
 
 static void irda_task_timer_expired(void *data);
 
net/irda/iriap.c renamed from net/irda/iriap.d8.c +2 -0
diff -u -p linux/net/irda/iriap.d8.c linux/net/irda/iriap.c
@@ -41,6 +41,7 @@
 #include <net/irda/iriap_event.h>
 #include <net/irda/iriap.h>
 
+#ifdef CONFIG_IRDA_DEBUG
 /* FIXME: This one should go in irlmp.c */
 static const char *ias_charset_types[] = {
 	"CS_ASCII",
@@ -55,6 +56,7 @@ static const char *ias_charset_types[] =
 	"CS_ISO_8859_9",
 	"CS_UNICODE"
 };
+#endif	/* CONFIG_IRDA_DEBUG */
 
 static hashbin_t *iriap = NULL;
 static __u32 service_handle; 
net/irda/irlap.c renamed from net/irda/irlap.d8.c +2 -0
diff -u -p linux/net/irda/irlap.d8.c linux/net/irda/irlap.c
@@ -59,6 +59,7 @@ int sysctl_warn_noreply_time = 3;
 extern void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb);
 static void __irlap_close(struct irlap_cb *self);
 
+#ifdef CONFIG_IRDA_DEBUG
 static char *lap_reasons[] = {
 	"ERROR, NOT USED",
 	"LAP_DISC_INDICATION",
@@ -69,6 +70,7 @@ static char *lap_reasons[] = {
 	"LAP_PRIMARY_CONFLICT",
 	"ERROR, NOT USED",
 };
+#endif	/* CONFIG_IRDA_DEBUG */
 
 #ifdef CONFIG_PROC_FS
 int irlap_proc_read(char *, char **, off_t, int);
net/irda/irlap_event.c renamed from net/irda/irlap_event.d8.c +5 -1
diff -u -p linux/net/irda/irlap_event.d8.c linux/net/irda/irlap_event.c
@@ -77,6 +77,7 @@ static int irlap_state_sclose (struct ir
 static int irlap_state_reset_check(struct irlap_cb *, IRLAP_EVENT event, 
 				   struct sk_buff *, struct irlap_info *);
 
+#ifdef CONFIG_IRDA_DEBUG
 static const char *irlap_event[] = {
 	"DISCOVERY_REQUEST",
 	"CONNECT_REQUEST",
@@ -117,6 +118,7 @@ static const char *irlap_event[] = {
 	"BACKOFF_TIMER_EXPIRED",
 	"MEDIA_BUSY_TIMER_EXPIRED",
 };
+#endif	/* CONFIG_IRDA_DEBUG */
 
 const char *irlap_state[] = {
 	"LAP_NDM",
@@ -312,7 +314,6 @@ static int irlap_state_ndm(struct irlap_
 {
 	discovery_t *discovery_rsp;
 	int ret = 0;
-	int i;
 
 	ASSERT(self != NULL, return -1;);
 	ASSERT(self->magic == LAP_MAGIC, return -1;);
@@ -478,6 +479,8 @@ static int irlap_state_ndm(struct irlap_
 		break;
 #ifdef CONFIG_IRDA_ULTRA
 	case SEND_UI_FRAME:
+	{   
+		int i;
 		/* Only allowed to repeat an operation twice */
 		for (i=0; ((i<2) && (self->media_busy == FALSE)); i++) {
 			skb = skb_dequeue(&self->txq_ultra);
@@ -492,6 +495,7 @@ static int irlap_state_ndm(struct irlap_
 			irda_device_set_media_busy(self->netdev, TRUE);
 		}
 		break;
+	}
 	case RECV_UI_FRAME:
 		/* Only accept broadcast frames in NDM mode */
 		if (info->caddr != CBROADCAST) {
net/irda/irlmp_event.c renamed from net/irda/irlmp_event.d8.c +2 -0
diff -u -p linux/net/irda/irlmp_event.d8.c linux/net/irda/irlmp_event.c
@@ -49,6 +49,7 @@ const char *irlsap_state[] = {
 	"LSAP_SETUP_PEND",
 };
 
+#ifdef CONFIG_IRDA_DEBUG
 static const char *irlmp_event[] = {
 	"LM_CONNECT_REQUEST",
  	"LM_CONNECT_CONFIRM",
@@ -75,6 +76,7 @@ static const char *irlmp_event[] = {
  	"LM_LAP_DISCOVERY_CONFIRM",
 	"LM_LAP_IDLE_TIMEOUT",
 };
+#endif	/* CONFIG_IRDA_DEBUG */
 
 /* LAP Connection control proto declarations */
 static void irlmp_state_standby  (struct lap_cb *, IRLMP_EVENT, 
net/irda/irsyms.c renamed from net/irda/irsyms.d8.c +1 -1
diff -u -p linux/net/irda/irsyms.d8.c linux/net/irda/irsyms.c
@@ -198,7 +198,7 @@ int __init irda_init(void)
 	return 0;
 }
 
-static void __exit irda_cleanup(void)
+void __exit irda_cleanup(void)
 {
 #ifdef CONFIG_SYSCTL
 	irda_sysctl_unregister();