[PATCH 07/14] kernel.h: Move NIPQUAD and NIPQUAD_FMT to in.h

From: Joe Perches
Date: Wed Dec 16 2009 - 03:09:50 EST


Move the #defines to where they're actually useful.
All the current uses of NIPQUAD still compile successfully.

Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
include/linux/in.h | 11 +++++++++++
include/linux/kernel.h | 11 -----------
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/in.h b/include/linux/in.h
index b615649..4e0f177 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -247,6 +247,17 @@ struct sockaddr_in {

#ifdef __KERNEL__

+/*
+ * Display an IP address in readable format.
+ */
+
+#define NIPQUAD(addr) \
+ ((unsigned char *)&addr)[0], \
+ ((unsigned char *)&addr)[1], \
+ ((unsigned char *)&addr)[2], \
+ ((unsigned char *)&addr)[3]
+#define NIPQUAD_FMT "%u.%u.%u.%u"
+
static inline bool ipv4_is_loopback(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x7f000000);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f7144b1..1764d2d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -240,17 +240,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
}

/*
- * Display an IP address in readable format.
- */
-
-#define NIPQUAD(addr) \
- ((unsigned char *)&addr)[0], \
- ((unsigned char *)&addr)[1], \
- ((unsigned char *)&addr)[2], \
- ((unsigned char *)&addr)[3]
-#define NIPQUAD_FMT "%u.%u.%u.%u"
-
-/*
* min()/max()/clamp() macros that also do
* strict type-checking.. See the
* "unnecessary" pointer comparison.
--
1.6.6.rc0.57.gad7a

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/