aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-05 03:46:47 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-05 12:25:20 -0500
commit97bd7919e2c1445dabbcc2686795dbb52316b923 (patch)
tree6ecbc7331107f61e83bf7c779b2ae36810510d84 /fs
parent7e46aa5c8cb1347853de9ec86f3fa440f9dc9d77 (diff)
remove nonsense force-casts from ocfs2
endianness annotations in networking code had been in place for quite a while; in particular, sin_port and s_addr are annotated as big-endian. Code in ocfs2 had __force casts added apparently to shut the sparse warnings up; of course, these days they only serve to *produce* warnings for no reason whatsoever... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/cluster/tcp.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index d84bd155997b..ee50c9610e7f 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -72,14 +72,6 @@
72 72
73#include "tcp_internal.h" 73#include "tcp_internal.h"
74 74
75/*
76 * The linux network stack isn't sparse endian clean.. It has macros like
77 * ntohs() which perform the endian checks and structs like sockaddr_in
78 * which aren't annotated. So __force is found here to get the build
79 * clean. When they emerge from the dark ages and annotate the code
80 * we can remove these.
81 */
82
83#define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u" 75#define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u"
84#define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \ 76#define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \
85 NIPQUAD(sc->sc_node->nd_ipv4_address), \ 77 NIPQUAD(sc->sc_node->nd_ipv4_address), \
@@ -1500,7 +1492,7 @@ static void o2net_start_connect(struct work_struct *work)
1500 1492
1501 myaddr.sin_family = AF_INET; 1493 myaddr.sin_family = AF_INET;
1502 myaddr.sin_addr.s_addr = mynode->nd_ipv4_address; 1494 myaddr.sin_addr.s_addr = mynode->nd_ipv4_address;
1503 myaddr.sin_port = (__force u16)htons(0); /* any port */ 1495 myaddr.sin_port = htons(0); /* any port */
1504 1496
1505 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr, 1497 ret = sock->ops->bind(sock, (struct sockaddr *)&myaddr,
1506 sizeof(myaddr)); 1498 sizeof(myaddr));
@@ -1701,11 +1693,11 @@ static int o2net_accept_one(struct socket *sock)
1701 if (ret < 0) 1693 if (ret < 0)
1702 goto out; 1694 goto out;
1703 1695
1704 node = o2nm_get_node_by_ip((__force __be32)sin.sin_addr.s_addr); 1696 node = o2nm_get_node_by_ip(sin.sin_addr.s_addr);
1705 if (node == NULL) { 1697 if (node == NULL) {
1706 mlog(ML_NOTICE, "attempt to connect from unknown node at " 1698 mlog(ML_NOTICE, "attempt to connect from unknown node at "
1707 "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr), 1699 "%u.%u.%u.%u:%d\n", NIPQUAD(sin.sin_addr.s_addr),
1708 ntohs((__force __be16)sin.sin_port)); 1700 ntohs(sin.sin_port));
1709 ret = -EINVAL; 1701 ret = -EINVAL;
1710 goto out; 1702 goto out;
1711 } 1703 }
@@ -1714,7 +1706,7 @@ static int o2net_accept_one(struct socket *sock)
1714 mlog(ML_NOTICE, "unexpected connect attempted from a lower " 1706 mlog(ML_NOTICE, "unexpected connect attempted from a lower "
1715 "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n", 1707 "numbered node '%s' at " "%u.%u.%u.%u:%d with num %u\n",
1716 node->nd_name, NIPQUAD(sin.sin_addr.s_addr), 1708 node->nd_name, NIPQUAD(sin.sin_addr.s_addr),
1717 ntohs((__force __be16)sin.sin_port), node->nd_num); 1709 ntohs(sin.sin_port), node->nd_num);
1718 ret = -EINVAL; 1710 ret = -EINVAL;
1719 goto out; 1711 goto out;
1720 } 1712 }
@@ -1725,7 +1717,7 @@ static int o2net_accept_one(struct socket *sock)
1725 mlog(ML_CONN, "attempt to connect from node '%s' at " 1717 mlog(ML_CONN, "attempt to connect from node '%s' at "
1726 "%u.%u.%u.%u:%d but it isn't heartbeating\n", 1718 "%u.%u.%u.%u:%d but it isn't heartbeating\n",
1727 node->nd_name, NIPQUAD(sin.sin_addr.s_addr), 1719 node->nd_name, NIPQUAD(sin.sin_addr.s_addr),
1728 ntohs((__force __be16)sin.sin_port)); 1720 ntohs(sin.sin_port));
1729 ret = -EINVAL; 1721 ret = -EINVAL;
1730 goto out; 1722 goto out;
1731 } 1723 }
@@ -1742,7 +1734,7 @@ static int o2net_accept_one(struct socket *sock)
1742 mlog(ML_NOTICE, "attempt to connect from node '%s' at " 1734 mlog(ML_NOTICE, "attempt to connect from node '%s' at "
1743 "%u.%u.%u.%u:%d but it already has an open connection\n", 1735 "%u.%u.%u.%u:%d but it already has an open connection\n",
1744 node->nd_name, NIPQUAD(sin.sin_addr.s_addr), 1736 node->nd_name, NIPQUAD(sin.sin_addr.s_addr),
1745 ntohs((__force __be16)sin.sin_port)); 1737 ntohs(sin.sin_port));
1746 goto out; 1738 goto out;
1747 } 1739 }
1748 1740