diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-12-13 18:03:06 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-01-04 17:50:35 -0500 |
commit | faf26bcc4729546ef95f5edb44f3749bb1b47d1c (patch) | |
tree | 11d012500ef7cd7eda5e27b7703ae64f08daa89e /drivers/ieee1394 | |
parent | debb48063a372525c07561cc96c473ae9adefd99 (diff) |
ieee1394: eth1394: trivial sparse annotations
Mostly annotations of ether_type as a be16.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/eth1394.c | 26 | ||||
-rw-r--r-- | drivers/ieee1394/eth1394.h | 16 |
2 files changed, 21 insertions, 21 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 7ae8bce27569..a074bfd5f825 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -92,7 +92,7 @@ struct partial_datagram { | |||
92 | struct list_head list; | 92 | struct list_head list; |
93 | u16 dgl; | 93 | u16 dgl; |
94 | u16 dg_size; | 94 | u16 dg_size; |
95 | u16 ether_type; | 95 | __be16 ether_type; |
96 | struct sk_buff *skb; | 96 | struct sk_buff *skb; |
97 | char *pbuf; | 97 | char *pbuf; |
98 | struct list_head frag_info; | 98 | struct list_head frag_info; |
@@ -767,7 +767,7 @@ static int ether1394_header_parse(const struct sk_buff *skb, | |||
767 | static int ether1394_header_cache(const struct neighbour *neigh, | 767 | static int ether1394_header_cache(const struct neighbour *neigh, |
768 | struct hh_cache *hh) | 768 | struct hh_cache *hh) |
769 | { | 769 | { |
770 | unsigned short type = hh->hh_type; | 770 | __be16 type = hh->hh_type; |
771 | struct net_device *dev = neigh->dev; | 771 | struct net_device *dev = neigh->dev; |
772 | struct eth1394hdr *eth = | 772 | struct eth1394hdr *eth = |
773 | (struct eth1394hdr *)((u8 *)hh->hh_data + 16 - ETH1394_HLEN); | 773 | (struct eth1394hdr *)((u8 *)hh->hh_data + 16 - ETH1394_HLEN); |
@@ -795,7 +795,7 @@ static void ether1394_header_cache_update(struct hh_cache *hh, | |||
795 | ******************************************/ | 795 | ******************************************/ |
796 | 796 | ||
797 | /* Copied from net/ethernet/eth.c */ | 797 | /* Copied from net/ethernet/eth.c */ |
798 | static u16 ether1394_type_trans(struct sk_buff *skb, struct net_device *dev) | 798 | static __be16 ether1394_type_trans(struct sk_buff *skb, struct net_device *dev) |
799 | { | 799 | { |
800 | struct eth1394hdr *eth; | 800 | struct eth1394hdr *eth; |
801 | unsigned char *rawp; | 801 | unsigned char *rawp; |
@@ -829,17 +829,17 @@ static u16 ether1394_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
829 | 829 | ||
830 | /* Parse an encapsulated IP1394 header into an ethernet frame packet. | 830 | /* Parse an encapsulated IP1394 header into an ethernet frame packet. |
831 | * We also perform ARP translation here, if need be. */ | 831 | * We also perform ARP translation here, if need be. */ |
832 | static u16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, | 832 | static __be16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, |
833 | nodeid_t srcid, nodeid_t destid, | 833 | nodeid_t srcid, nodeid_t destid, |
834 | u16 ether_type) | 834 | __be16 ether_type) |
835 | { | 835 | { |
836 | struct eth1394_priv *priv = netdev_priv(dev); | 836 | struct eth1394_priv *priv = netdev_priv(dev); |
837 | u64 dest_hw; | 837 | __be64 dest_hw; |
838 | unsigned short ret = 0; | 838 | __be16 ret = 0; |
839 | 839 | ||
840 | /* Setup our hw addresses. We use these to build the ethernet header. */ | 840 | /* Setup our hw addresses. We use these to build the ethernet header. */ |
841 | if (destid == (LOCAL_BUS | ALL_NODES)) | 841 | if (destid == (LOCAL_BUS | ALL_NODES)) |
842 | dest_hw = ~0ULL; /* broadcast */ | 842 | dest_hw = ~cpu_to_be64(0); /* broadcast */ |
843 | else | 843 | else |
844 | dest_hw = cpu_to_be64((u64)priv->host->csr.guid_hi << 32 | | 844 | dest_hw = cpu_to_be64((u64)priv->host->csr.guid_hi << 32 | |
845 | priv->host->csr.guid_lo); | 845 | priv->host->csr.guid_lo); |
@@ -873,7 +873,7 @@ static u16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, | |||
873 | node = eth1394_find_node_guid(&priv->ip_node_list, | 873 | node = eth1394_find_node_guid(&priv->ip_node_list, |
874 | be64_to_cpu(guid)); | 874 | be64_to_cpu(guid)); |
875 | if (!node) | 875 | if (!node) |
876 | return 0; | 876 | return cpu_to_be16(0); |
877 | 877 | ||
878 | node_info = | 878 | node_info = |
879 | (struct eth1394_node_info *)node->ud->device.driver_data; | 879 | (struct eth1394_node_info *)node->ud->device.driver_data; |
@@ -1063,7 +1063,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, | |||
1063 | unsigned long flags; | 1063 | unsigned long flags; |
1064 | struct eth1394_priv *priv = netdev_priv(dev); | 1064 | struct eth1394_priv *priv = netdev_priv(dev); |
1065 | union eth1394_hdr *hdr = (union eth1394_hdr *)buf; | 1065 | union eth1394_hdr *hdr = (union eth1394_hdr *)buf; |
1066 | u16 ether_type = 0; /* initialized to clear warning */ | 1066 | __be16 ether_type = cpu_to_be16(0); /* initialized to clear warning */ |
1067 | int hdr_len; | 1067 | int hdr_len; |
1068 | struct unit_directory *ud = priv->ud_list[NODEID_TO_NODE(srcid)]; | 1068 | struct unit_directory *ud = priv->ud_list[NODEID_TO_NODE(srcid)]; |
1069 | struct eth1394_node_info *node_info; | 1069 | struct eth1394_node_info *node_info; |
@@ -1259,7 +1259,7 @@ static int ether1394_write(struct hpsb_host *host, int srcid, int destid, | |||
1259 | 1259 | ||
1260 | static void ether1394_iso(struct hpsb_iso *iso) | 1260 | static void ether1394_iso(struct hpsb_iso *iso) |
1261 | { | 1261 | { |
1262 | quadlet_t *data; | 1262 | __be32 *data; |
1263 | char *buf; | 1263 | char *buf; |
1264 | struct eth1394_host_info *hi; | 1264 | struct eth1394_host_info *hi; |
1265 | struct net_device *dev; | 1265 | struct net_device *dev; |
@@ -1283,7 +1283,7 @@ static void ether1394_iso(struct hpsb_iso *iso) | |||
1283 | for (i = 0; i < nready; i++) { | 1283 | for (i = 0; i < nready; i++) { |
1284 | struct hpsb_iso_packet_info *info = | 1284 | struct hpsb_iso_packet_info *info = |
1285 | &iso->infos[(iso->first_packet + i) % iso->buf_packets]; | 1285 | &iso->infos[(iso->first_packet + i) % iso->buf_packets]; |
1286 | data = (quadlet_t *)(iso->data_buf.kvirt + info->offset); | 1286 | data = (__be32 *)(iso->data_buf.kvirt + info->offset); |
1287 | 1287 | ||
1288 | /* skip over GASP header */ | 1288 | /* skip over GASP header */ |
1289 | buf = (char *)data + 8; | 1289 | buf = (char *)data + 8; |
@@ -1614,7 +1614,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) | |||
1614 | if (max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF]) | 1614 | if (max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF]) |
1615 | priv->bc_dgl++; | 1615 | priv->bc_dgl++; |
1616 | } else { | 1616 | } else { |
1617 | __be64 guid = get_unaligned((u64 *)hdr_buf.h_dest); | 1617 | __be64 guid = get_unaligned((__be64 *)hdr_buf.h_dest); |
1618 | 1618 | ||
1619 | node = eth1394_find_node_guid(&priv->ip_node_list, | 1619 | node = eth1394_find_node_guid(&priv->ip_node_list, |
1620 | be64_to_cpu(guid)); | 1620 | be64_to_cpu(guid)); |
diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h index 4f3e2dd46f00..e1b5ea80f623 100644 --- a/drivers/ieee1394/eth1394.h +++ b/drivers/ieee1394/eth1394.h | |||
@@ -82,7 +82,7 @@ struct eth1394_priv { | |||
82 | 82 | ||
83 | struct eth1394hdr { | 83 | struct eth1394hdr { |
84 | unsigned char h_dest[ETH1394_ALEN]; /* destination eth1394 addr */ | 84 | unsigned char h_dest[ETH1394_ALEN]; /* destination eth1394 addr */ |
85 | unsigned short h_proto; /* packet type ID field */ | 85 | __be16 h_proto; /* packet type ID field */ |
86 | } __attribute__((packed)); | 86 | } __attribute__((packed)); |
87 | 87 | ||
88 | static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb) | 88 | static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb) |
@@ -99,13 +99,13 @@ typedef enum {ETH1394_GASP, ETH1394_WRREQ} eth1394_tx_type; | |||
99 | struct eth1394_uf_hdr { | 99 | struct eth1394_uf_hdr { |
100 | u16 lf:2; | 100 | u16 lf:2; |
101 | u16 res:14; | 101 | u16 res:14; |
102 | u16 ether_type; /* Ethernet packet type */ | 102 | __be16 ether_type; /* Ethernet packet type */ |
103 | } __attribute__((packed)); | 103 | } __attribute__((packed)); |
104 | #elif defined __LITTLE_ENDIAN_BITFIELD | 104 | #elif defined __LITTLE_ENDIAN_BITFIELD |
105 | struct eth1394_uf_hdr { | 105 | struct eth1394_uf_hdr { |
106 | u16 res:14; | 106 | u16 res:14; |
107 | u16 lf:2; | 107 | u16 lf:2; |
108 | u16 ether_type; | 108 | __be16 ether_type; |
109 | } __attribute__((packed)); | 109 | } __attribute__((packed)); |
110 | #else | 110 | #else |
111 | #error Unknown bit field type | 111 | #error Unknown bit field type |
@@ -117,7 +117,7 @@ struct eth1394_ff_hdr { | |||
117 | u16 lf:2; | 117 | u16 lf:2; |
118 | u16 res1:2; | 118 | u16 res1:2; |
119 | u16 dg_size:12; /* Datagram size */ | 119 | u16 dg_size:12; /* Datagram size */ |
120 | u16 ether_type; /* Ethernet packet type */ | 120 | __be16 ether_type; /* Ethernet packet type */ |
121 | u16 dgl; /* Datagram label */ | 121 | u16 dgl; /* Datagram label */ |
122 | u16 res2; | 122 | u16 res2; |
123 | } __attribute__((packed)); | 123 | } __attribute__((packed)); |
@@ -126,7 +126,7 @@ struct eth1394_ff_hdr { | |||
126 | u16 dg_size:12; | 126 | u16 dg_size:12; |
127 | u16 res1:2; | 127 | u16 res1:2; |
128 | u16 lf:2; | 128 | u16 lf:2; |
129 | u16 ether_type; | 129 | __be16 ether_type; |
130 | u16 dgl; | 130 | u16 dgl; |
131 | u16 res2; | 131 | u16 res2; |
132 | } __attribute__((packed)); | 132 | } __attribute__((packed)); |
@@ -207,11 +207,11 @@ struct eth1394_arp { | |||
207 | u16 opcode; /* ARP Opcode */ | 207 | u16 opcode; /* ARP Opcode */ |
208 | /* Above is exactly the same format as struct arphdr */ | 208 | /* Above is exactly the same format as struct arphdr */ |
209 | 209 | ||
210 | u64 s_uniq_id; /* Sender's 64bit EUI */ | 210 | __be64 s_uniq_id; /* Sender's 64bit EUI */ |
211 | u8 max_rec; /* Sender's max packet size */ | 211 | u8 max_rec; /* Sender's max packet size */ |
212 | u8 sspd; /* Sender's max speed */ | 212 | u8 sspd; /* Sender's max speed */ |
213 | u16 fifo_hi; /* hi 16bits of sender's FIFO addr */ | 213 | __be16 fifo_hi; /* hi 16bits of sender's FIFO addr */ |
214 | u32 fifo_lo; /* lo 32bits of sender's FIFO addr */ | 214 | __be32 fifo_lo; /* lo 32bits of sender's FIFO addr */ |
215 | u32 sip; /* Sender's IP Address */ | 215 | u32 sip; /* Sender's IP Address */ |
216 | u32 tip; /* IP Address of requested hw addr */ | 216 | u32 tip; /* IP Address of requested hw addr */ |
217 | }; | 217 | }; |