Skip to contentSkip to conversation

drivers: staging: remove last usage of NIPQUAD and NIP6 in gdm72xx

PATCH In review Shan Wei 2 participants 3 messages Nov 27, 2012 – Nov 28, 2012 Staging

lore
Share & tools
lore

Shan Wei

author
#0 lore raw

PATCH v3 1/1 drivers: staging: remove last usage of NIPQUAD and NIP6 in gdm72xx

From: Shan Wei <[email protected]>

commit cf4ca4874fc45 removed the definition of NIPQUAD and NIPQUAD_FMT, and NIP6 also is out of date.

Because DEBUG_SDU is not defined in gdm_wimax.h, no error message when compiling this code. And remove constant condition judge.

---
V3:
As suggestion of greg k-h's patch email bot, recreate this patch base on greg's staging tree, v2 is on David Miller's net-next tree.

---
 drivers/staging/gdm72xx/gdm_wimax.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
drivers/staging/gdm72xx/gdm_wimax.c +1 -9
index 6cb8107..c0ec4d0 100644
@@ -166,21 +166,13 @@ static void dump_eth_packet(const char *title, u8 *data, int len)
 		get_ip_protocol_name(ip_protocol),
 		get_port_name(port));
 
-	#if 1
 	if (!(data[0] == 0xff && data[1] == 0xff)) {
 		if (protocol == ETH_P_IP) {
-			printk(KERN_DEBUG "     src=%u.%u.%u.%u\n",
-				NIPQUAD(ih->saddr));
+			printk(KERN_DEBUG "     src=%pI4\n", &ih->saddr);
 		} else if (protocol == ETH_P_IPV6) {
-			#ifdef NIP6
-			printk(KERN_DEBUG "     src=%x:%x:%x:%x:%x:%x:%x:%x\n",
-				NIP6(ih->saddr));
-			#else
 			printk(KERN_DEBUG "     src=%pI6\n", &ih->saddr);
-			#endif
 		}
 	}
-	#endif
 
 	#if (DUMP_PACKET & DUMP_SDU_ALL)
 	printk_hex(data, len);
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 9 lines · Shan Wei

From: Shan Wei <[email protected]>

commit cf4ca4874fc45 removed the definition of NIPQUAD and NIPQUAD_FMT, and NIP6 also is out of date.

Because DEBUG_SDU is not defined in gdm_wimax.h, no error message when compiling this code. And remove constant condition judge.

Quoted 5 lines

---
V3:
As suggestion of greg k-h's patch email bot, recreate this patch base on greg's staging tree, v2 is on David Miller's net-next tree.

Are you sure you got the right branch? This does not apply to my staging-next branch of the staging.git tree, what did you use?

thanks,

greg k-h

author
#2 lore raw

Greg KH said, at 2012/11/28 1:19:

Quoted 10 lines · Shan Wei
Quoted 9 lines

From: Shan Wei <[email protected]>

commit cf4ca4874fc45 removed the definition of NIPQUAD and NIPQUAD_FMT, and NIP6 also is out of date.

Because DEBUG_SDU is not defined in gdm_wimax.h, no error message when compiling this code. And remove constant condition judge.

Quoted 8 lines
Quoted 5 lines

---
V3:
As suggestion of greg k-h's patch email bot, recreate this patch base on greg's staging tree, v2 is on David Miller's net-next tree.

Are you sure you got the right branch? This does not apply to my staging-next branch of the staging.git tree, what did you use?

Just create the patch base on you master of the staging.git, not the staging-next branch. (It's different from David Miller, who has individual git tree for next development. :-( )

-------------------------------------------------------------

Quoted 1 line

From 0b48de95a28f68f6d32f25b77ecc006a9d8a94b9 Mon Sep 17 00:00:00 2001

From: Shan Wei <[email protected]>
Date: Wed, 28 Nov 2012 10:45:00 +0800
Subject: [PATCH staging-next v4] drivers: staging: use %pI4 format to print IPv4 address and remove last usage of NIP6

commit cf4ca4874fc45 removed the definition of NIPQUAD and NIPQUAD_FMT, and NIP6 also is out of date.

commit 2874762b31d8d replace deprecated NIPQUAD marco to C code, but we can use %pI4 to print IPv4 address more simply. And remove constant condition judge.

Because DEBUG_SDU is not defined in gdm_wimax.h, no error message when compiling.

---
 drivers/staging/gdm72xx/gdm_wimax.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
drivers/staging/gdm72xx/gdm_wimax.c +1 -12
index c302769..41efbee 100644
@@ -168,24 +168,13 @@ static void dump_eth_packet(const char *title, u8 *data, int len)
 		get_ip_protocol_name(ip_protocol),
 		get_port_name(port));
 
-	#if 1
 	if (!(data[0] == 0xff && data[1] == 0xff)) {
 		if (protocol == ETH_P_IP) {
-			printk(KERN_DEBUG "     src=%u.%u.%u.%u\n",
-				((unsigned char *)&(ih->saddr))[0],
-				((unsigned char *)&(ih->saddr))[1],
-				((unsigned char *)&(ih->saddr))[2],
-				((unsigned char *)&(ih->saddr))[3]);
+			printk(KERN_DEBUG "     src=%pI4\n", &ih->saddr);
 		} else if (protocol == ETH_P_IPV6) {
-			#ifdef NIP6
-			printk(KERN_DEBUG "     src=%x:%x:%x:%x:%x:%x:%x:%x\n",
-				NIP6(ih->saddr));
-			#else
 			printk(KERN_DEBUG "     src=%pI6\n", &ih->saddr);
-			#endif
 		}
 	}
-	#endif
 
 	#if (DUMP_PACKET & DUMP_SDU_ALL)
 	printk_hex(data, len);
Signature · 1 line
1.7.1