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>
This commit is contained in:
Stefan Richter 2007-03-18 12:23:11 +01:00
parent 2cd556ae61
commit e00f04a70f
1 changed files with 36 additions and 38 deletions

View File

@ -820,8 +820,7 @@ static int ether1394_mac_addr(struct net_device *dev, void *p)
******************************************/ ******************************************/
/* Copied from net/ethernet/eth.c */ /* Copied from net/ethernet/eth.c */
static inline u16 ether1394_type_trans(struct sk_buff *skb, static u16 ether1394_type_trans(struct sk_buff *skb, struct net_device *dev)
struct net_device *dev)
{ {
struct eth1394hdr *eth; struct eth1394hdr *eth;
unsigned char *rawp; unsigned char *rawp;
@ -855,8 +854,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
/* Parse an encapsulated IP1394 header into an ethernet frame packet. /* Parse an encapsulated IP1394 header into an ethernet frame packet.
* We also perform ARP translation here, if need be. */ * We also perform ARP translation here, if need be. */
static inline u16 ether1394_parse_encap(struct sk_buff *skb, static u16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev,
struct net_device *dev,
nodeid_t srcid, nodeid_t destid, nodeid_t srcid, nodeid_t destid,
u16 ether_type) u16 ether_type)
{ {
@ -939,7 +937,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
return ret; return ret;
} }
static inline int fragment_overlap(struct list_head *frag_list, int offset, int len) static int fragment_overlap(struct list_head *frag_list, int offset, int len)
{ {
struct fragment_info *fi; struct fragment_info *fi;
@ -951,7 +949,7 @@ static inline int fragment_overlap(struct list_head *frag_list, int offset, int
return 0; return 0;
} }
static inline struct list_head *find_partial_datagram(struct list_head *pdgl, int dgl) static struct list_head *find_partial_datagram(struct list_head *pdgl, int dgl)
{ {
struct partial_datagram *pd; struct partial_datagram *pd;
@ -963,7 +961,7 @@ static inline struct list_head *find_partial_datagram(struct list_head *pdgl, in
} }
/* Assumes that new fragment does not overlap any existing fragments */ /* Assumes that new fragment does not overlap any existing fragments */
static inline int new_fragment(struct list_head *frag_info, int offset, int len) static int new_fragment(struct list_head *frag_info, int offset, int len)
{ {
struct list_head *lh; struct list_head *lh;
struct fragment_info *fi, *fi2, *new; struct fragment_info *fi, *fi2, *new;
@ -1015,9 +1013,8 @@ static inline int new_fragment(struct list_head *frag_info, int offset, int len)
return 0; return 0;
} }
static inline int new_partial_datagram(struct net_device *dev, static int new_partial_datagram(struct net_device *dev, struct list_head *pdgl,
struct list_head *pdgl, int dgl, int dgl, int dg_size, char *frag_buf,
int dg_size, char *frag_buf,
int frag_off, int frag_len) int frag_off, int frag_len)
{ {
struct partial_datagram *new; struct partial_datagram *new;
@ -1055,7 +1052,7 @@ static inline int new_partial_datagram(struct net_device *dev,
return 0; return 0;
} }
static inline int update_partial_datagram(struct list_head *pdgl, struct list_head *lh, static int update_partial_datagram(struct list_head *pdgl, struct list_head *lh,
char *frag_buf, int frag_off, int frag_len) char *frag_buf, int frag_off, int frag_len)
{ {
struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list); struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list);
@ -1073,11 +1070,13 @@ static inline int update_partial_datagram(struct list_head *pdgl, struct list_he
return 0; return 0;
} }
static inline int is_datagram_complete(struct list_head *lh, int dg_size) static int is_datagram_complete(struct list_head *lh, int dg_size)
{ {
struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list); struct partial_datagram *pd;
struct fragment_info *fi = list_entry(pd->frag_info.next, struct fragment_info *fi;
struct fragment_info, list);
pd = list_entry(lh, struct partial_datagram, list);
fi = list_entry(pd->frag_info.next, struct fragment_info, list);
return (fi->len == dg_size); return (fi->len == dg_size);
} }
@ -1359,7 +1358,7 @@ static void ether1394_iso(struct hpsb_iso *iso)
* speed, and unicast FIFO address information between the sender_unique_id * speed, and unicast FIFO address information between the sender_unique_id
* and the IP addresses. * and the IP addresses.
*/ */
static inline void ether1394_arp_to_1394arp(struct sk_buff *skb, static void ether1394_arp_to_1394arp(struct sk_buff *skb,
struct net_device *dev) struct net_device *dev)
{ {
struct eth1394_priv *priv = netdev_priv(dev); struct eth1394_priv *priv = netdev_priv(dev);
@ -1382,7 +1381,7 @@ static inline void ether1394_arp_to_1394arp(struct sk_buff *skb,
/* We need to encapsulate the standard header with our own. We use the /* We need to encapsulate the standard header with our own. We use the
* ethernet header's proto for our own. */ * ethernet header's proto for our own. */
static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload, static unsigned int ether1394_encapsulate_prep(unsigned int max_payload,
__be16 proto, __be16 proto,
union eth1394_hdr *hdr, union eth1394_hdr *hdr,
u16 dg_size, u16 dgl) u16 dg_size, u16 dgl)
@ -1403,7 +1402,7 @@ static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload,
return((dg_size + (adj_max_payload - 1)) / adj_max_payload); return((dg_size + (adj_max_payload - 1)) / adj_max_payload);
} }
static inline unsigned int ether1394_encapsulate(struct sk_buff *skb, static unsigned int ether1394_encapsulate(struct sk_buff *skb,
unsigned int max_payload, unsigned int max_payload,
union eth1394_hdr *hdr) union eth1394_hdr *hdr)
{ {
@ -1445,7 +1444,7 @@ static inline unsigned int ether1394_encapsulate(struct sk_buff *skb,
return min(max_payload, skb->len); return min(max_payload, skb->len);
} }
static inline struct hpsb_packet *ether1394_alloc_common_packet(struct hpsb_host *host) static struct hpsb_packet *ether1394_alloc_common_packet(struct hpsb_host *host)
{ {
struct hpsb_packet *p; struct hpsb_packet *p;
@ -1458,10 +1457,9 @@ static inline struct hpsb_packet *ether1394_alloc_common_packet(struct hpsb_host
return p; return p;
} }
static inline int ether1394_prep_write_packet(struct hpsb_packet *p, static int ether1394_prep_write_packet(struct hpsb_packet *p,
struct hpsb_host *host, struct hpsb_host *host, nodeid_t node,
nodeid_t node, u64 addr, u64 addr, void * data, int tx_len)
void * data, int tx_len)
{ {
p->node_id = node; p->node_id = node;
p->data = NULL; p->data = NULL;
@ -1488,7 +1486,7 @@ static inline int ether1394_prep_write_packet(struct hpsb_packet *p,
return 0; return 0;
} }
static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p, static void ether1394_prep_gasp_packet(struct hpsb_packet *p,
struct eth1394_priv *priv, struct eth1394_priv *priv,
struct sk_buff *skb, int length) struct sk_buff *skb, int length)
{ {
@ -1512,7 +1510,7 @@ static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p,
p->speed_code = priv->bc_sspd; p->speed_code = priv->bc_sspd;
} }
static inline void ether1394_free_packet(struct hpsb_packet *packet) static void ether1394_free_packet(struct hpsb_packet *packet)
{ {
if (packet->tcode != TCODE_STREAM_DATA) if (packet->tcode != TCODE_STREAM_DATA)
hpsb_free_tlabel(packet); hpsb_free_tlabel(packet);
@ -1556,7 +1554,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
/* Task function to be run when a datagram transmission is completed */ /* Task function to be run when a datagram transmission is completed */
static inline void ether1394_dg_complete(struct packet_task *ptask, int fail) static void ether1394_dg_complete(struct packet_task *ptask, int fail)
{ {
struct sk_buff *skb = ptask->skb; struct sk_buff *skb = ptask->skb;
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;