diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-18 07:23:11 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:30 -0400 |
commit | e00f04a70fa387b3accc81b5c346200f836e2a52 (patch) | |
tree | e131541d19210a55522e61a357c2eb1d64d62843 /drivers/ieee1394/eth1394.c | |
parent | 2cd556ae61c862f4d00bb63863c6e5c67fd55bd4 (diff) |
ieee1394: eth1394: reduce excessive function inlining
Shrinks eth1394.ko by about 5%.
Many of these functions have only one caller and are therefore auto-
inlined anyway.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/eth1394.c')
-rw-r--r-- | drivers/ieee1394/eth1394.c | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 63fca140ab90..d056c5953be3 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -820,8 +820,7 @@ static int ether1394_mac_addr(struct net_device *dev, void *p) | |||
820 | ******************************************/ | 820 | ******************************************/ |
821 | 821 | ||
822 | /* Copied from net/ethernet/eth.c */ | 822 | /* Copied from net/ethernet/eth.c */ |
823 | static inline u16 ether1394_type_trans(struct sk_buff *skb, | 823 | static u16 ether1394_type_trans(struct sk_buff *skb, struct net_device *dev) |
824 | struct net_device *dev) | ||
825 | { | 824 | { |
826 | struct eth1394hdr *eth; | 825 | struct eth1394hdr *eth; |
827 | unsigned char *rawp; | 826 | unsigned char *rawp; |
@@ -855,10 +854,9 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb, | |||
855 | 854 | ||
856 | /* Parse an encapsulated IP1394 header into an ethernet frame packet. | 855 | /* Parse an encapsulated IP1394 header into an ethernet frame packet. |
857 | * We also perform ARP translation here, if need be. */ | 856 | * We also perform ARP translation here, if need be. */ |
858 | static inline u16 ether1394_parse_encap(struct sk_buff *skb, | 857 | static u16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, |
859 | struct net_device *dev, | 858 | nodeid_t srcid, nodeid_t destid, |
860 | nodeid_t srcid, nodeid_t destid, | 859 | u16 ether_type) |
861 | u16 ether_type) | ||
862 | { | 860 | { |
863 | struct eth1394_priv *priv = netdev_priv(dev); | 861 | struct eth1394_priv *priv = netdev_priv(dev); |
864 | u64 dest_hw; | 862 | u64 dest_hw; |
@@ -939,7 +937,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb, | |||
939 | return ret; | 937 | return ret; |
940 | } | 938 | } |
941 | 939 | ||
942 | static inline int fragment_overlap(struct list_head *frag_list, int offset, int len) | 940 | static int fragment_overlap(struct list_head *frag_list, int offset, int len) |
943 | { | 941 | { |
944 | struct fragment_info *fi; | 942 | struct fragment_info *fi; |
945 | 943 | ||
@@ -951,7 +949,7 @@ static inline int fragment_overlap(struct list_head *frag_list, int offset, int | |||
951 | return 0; | 949 | return 0; |
952 | } | 950 | } |
953 | 951 | ||
954 | static inline struct list_head *find_partial_datagram(struct list_head *pdgl, int dgl) | 952 | static struct list_head *find_partial_datagram(struct list_head *pdgl, int dgl) |
955 | { | 953 | { |
956 | struct partial_datagram *pd; | 954 | struct partial_datagram *pd; |
957 | 955 | ||
@@ -963,7 +961,7 @@ static inline struct list_head *find_partial_datagram(struct list_head *pdgl, in | |||
963 | } | 961 | } |
964 | 962 | ||
965 | /* Assumes that new fragment does not overlap any existing fragments */ | 963 | /* Assumes that new fragment does not overlap any existing fragments */ |
966 | static inline int new_fragment(struct list_head *frag_info, int offset, int len) | 964 | static int new_fragment(struct list_head *frag_info, int offset, int len) |
967 | { | 965 | { |
968 | struct list_head *lh; | 966 | struct list_head *lh; |
969 | struct fragment_info *fi, *fi2, *new; | 967 | struct fragment_info *fi, *fi2, *new; |
@@ -1015,10 +1013,9 @@ static inline int new_fragment(struct list_head *frag_info, int offset, int len) | |||
1015 | return 0; | 1013 | return 0; |
1016 | } | 1014 | } |
1017 | 1015 | ||
1018 | static inline int new_partial_datagram(struct net_device *dev, | 1016 | static int new_partial_datagram(struct net_device *dev, struct list_head *pdgl, |
1019 | struct list_head *pdgl, int dgl, | 1017 | int dgl, int dg_size, char *frag_buf, |
1020 | int dg_size, char *frag_buf, | 1018 | int frag_off, int frag_len) |
1021 | int frag_off, int frag_len) | ||
1022 | { | 1019 | { |
1023 | struct partial_datagram *new; | 1020 | struct partial_datagram *new; |
1024 | 1021 | ||
@@ -1055,8 +1052,8 @@ static inline int new_partial_datagram(struct net_device *dev, | |||
1055 | return 0; | 1052 | return 0; |
1056 | } | 1053 | } |
1057 | 1054 | ||
1058 | static inline int update_partial_datagram(struct list_head *pdgl, struct list_head *lh, | 1055 | static int update_partial_datagram(struct list_head *pdgl, struct list_head *lh, |
1059 | char *frag_buf, int frag_off, int frag_len) | 1056 | char *frag_buf, int frag_off, int frag_len) |
1060 | { | 1057 | { |
1061 | struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list); | 1058 | struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list); |
1062 | 1059 | ||
@@ -1073,11 +1070,13 @@ static inline int update_partial_datagram(struct list_head *pdgl, struct list_he | |||
1073 | return 0; | 1070 | return 0; |
1074 | } | 1071 | } |
1075 | 1072 | ||
1076 | static inline int is_datagram_complete(struct list_head *lh, int dg_size) | 1073 | static int is_datagram_complete(struct list_head *lh, int dg_size) |
1077 | { | 1074 | { |
1078 | struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list); | 1075 | struct partial_datagram *pd; |
1079 | struct fragment_info *fi = list_entry(pd->frag_info.next, | 1076 | struct fragment_info *fi; |
1080 | struct fragment_info, list); | 1077 | |
1078 | pd = list_entry(lh, struct partial_datagram, list); | ||
1079 | fi = list_entry(pd->frag_info.next, struct fragment_info, list); | ||
1081 | 1080 | ||
1082 | return (fi->len == dg_size); | 1081 | return (fi->len == dg_size); |
1083 | } | 1082 | } |
@@ -1359,8 +1358,8 @@ static void ether1394_iso(struct hpsb_iso *iso) | |||
1359 | * speed, and unicast FIFO address information between the sender_unique_id | 1358 | * speed, and unicast FIFO address information between the sender_unique_id |
1360 | * and the IP addresses. | 1359 | * and the IP addresses. |
1361 | */ | 1360 | */ |
1362 | static inline void ether1394_arp_to_1394arp(struct sk_buff *skb, | 1361 | static void ether1394_arp_to_1394arp(struct sk_buff *skb, |
1363 | struct net_device *dev) | 1362 | struct net_device *dev) |
1364 | { | 1363 | { |
1365 | struct eth1394_priv *priv = netdev_priv(dev); | 1364 | struct eth1394_priv *priv = netdev_priv(dev); |
1366 | 1365 | ||
@@ -1382,10 +1381,10 @@ static inline void ether1394_arp_to_1394arp(struct sk_buff *skb, | |||
1382 | 1381 | ||
1383 | /* We need to encapsulate the standard header with our own. We use the | 1382 | /* We need to encapsulate the standard header with our own. We use the |
1384 | * ethernet header's proto for our own. */ | 1383 | * ethernet header's proto for our own. */ |
1385 | static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload, | 1384 | static unsigned int ether1394_encapsulate_prep(unsigned int max_payload, |
1386 | __be16 proto, | 1385 | __be16 proto, |
1387 | union eth1394_hdr *hdr, | 1386 | union eth1394_hdr *hdr, |
1388 | u16 dg_size, u16 dgl) | 1387 | u16 dg_size, u16 dgl) |
1389 | { | 1388 | { |
1390 | unsigned int adj_max_payload = max_payload - hdr_type_len[ETH1394_HDR_LF_UF]; | 1389 | unsigned int adj_max_payload = max_payload - hdr_type_len[ETH1394_HDR_LF_UF]; |
1391 | 1390 | ||
@@ -1403,9 +1402,9 @@ static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload, | |||
1403 | return((dg_size + (adj_max_payload - 1)) / adj_max_payload); | 1402 | return((dg_size + (adj_max_payload - 1)) / adj_max_payload); |
1404 | } | 1403 | } |
1405 | 1404 | ||
1406 | static inline unsigned int ether1394_encapsulate(struct sk_buff *skb, | 1405 | static unsigned int ether1394_encapsulate(struct sk_buff *skb, |
1407 | unsigned int max_payload, | 1406 | unsigned int max_payload, |
1408 | union eth1394_hdr *hdr) | 1407 | union eth1394_hdr *hdr) |
1409 | { | 1408 | { |
1410 | union eth1394_hdr *bufhdr; | 1409 | union eth1394_hdr *bufhdr; |
1411 | int ftype = hdr->common.lf; | 1410 | int ftype = hdr->common.lf; |
@@ -1445,7 +1444,7 @@ static inline unsigned int ether1394_encapsulate(struct sk_buff *skb, | |||
1445 | return min(max_payload, skb->len); | 1444 | return min(max_payload, skb->len); |
1446 | } | 1445 | } |
1447 | 1446 | ||
1448 | static inline struct hpsb_packet *ether1394_alloc_common_packet(struct hpsb_host *host) | 1447 | static struct hpsb_packet *ether1394_alloc_common_packet(struct hpsb_host *host) |
1449 | { | 1448 | { |
1450 | struct hpsb_packet *p; | 1449 | struct hpsb_packet *p; |
1451 | 1450 | ||
@@ -1458,10 +1457,9 @@ static inline struct hpsb_packet *ether1394_alloc_common_packet(struct hpsb_host | |||
1458 | return p; | 1457 | return p; |
1459 | } | 1458 | } |
1460 | 1459 | ||
1461 | static inline int ether1394_prep_write_packet(struct hpsb_packet *p, | 1460 | static int ether1394_prep_write_packet(struct hpsb_packet *p, |
1462 | struct hpsb_host *host, | 1461 | struct hpsb_host *host, nodeid_t node, |
1463 | nodeid_t node, u64 addr, | 1462 | u64 addr, void * data, int tx_len) |
1464 | void * data, int tx_len) | ||
1465 | { | 1463 | { |
1466 | p->node_id = node; | 1464 | p->node_id = node; |
1467 | p->data = NULL; | 1465 | p->data = NULL; |
@@ -1488,9 +1486,9 @@ static inline int ether1394_prep_write_packet(struct hpsb_packet *p, | |||
1488 | return 0; | 1486 | return 0; |
1489 | } | 1487 | } |
1490 | 1488 | ||
1491 | static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p, | 1489 | static void ether1394_prep_gasp_packet(struct hpsb_packet *p, |
1492 | struct eth1394_priv *priv, | 1490 | struct eth1394_priv *priv, |
1493 | struct sk_buff *skb, int length) | 1491 | struct sk_buff *skb, int length) |
1494 | { | 1492 | { |
1495 | p->header_size = 4; | 1493 | p->header_size = 4; |
1496 | p->tcode = TCODE_STREAM_DATA; | 1494 | p->tcode = TCODE_STREAM_DATA; |
@@ -1512,7 +1510,7 @@ static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p, | |||
1512 | p->speed_code = priv->bc_sspd; | 1510 | p->speed_code = priv->bc_sspd; |
1513 | } | 1511 | } |
1514 | 1512 | ||
1515 | static inline void ether1394_free_packet(struct hpsb_packet *packet) | 1513 | static void ether1394_free_packet(struct hpsb_packet *packet) |
1516 | { | 1514 | { |
1517 | if (packet->tcode != TCODE_STREAM_DATA) | 1515 | if (packet->tcode != TCODE_STREAM_DATA) |
1518 | hpsb_free_tlabel(packet); | 1516 | hpsb_free_tlabel(packet); |
@@ -1556,7 +1554,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len) | |||
1556 | 1554 | ||
1557 | 1555 | ||
1558 | /* Task function to be run when a datagram transmission is completed */ | 1556 | /* Task function to be run when a datagram transmission is completed */ |
1559 | static inline void ether1394_dg_complete(struct packet_task *ptask, int fail) | 1557 | static void ether1394_dg_complete(struct packet_task *ptask, int fail) |
1560 | { | 1558 | { |
1561 | struct sk_buff *skb = ptask->skb; | 1559 | struct sk_buff *skb = ptask->skb; |
1562 | struct net_device *dev = skb->dev; | 1560 | struct net_device *dev = skb->dev; |