mlx4: make functions local and remove dead code.
PATCH 1/1 mlx4: make functions local and remove dead code.
There is a whole section of code in this driver related to vlan tables which is not accessed from any kernel code.
--- drivers/net/mlx4/cq.c | 3 + drivers/net/mlx4/en_rx.c | 3 - drivers/net/mlx4/icm.c | 28 ------------ drivers/net/mlx4/icm.h | 2 drivers/net/mlx4/mlx4_en.h | 3 - drivers/net/mlx4/port.c | 97 -------------------------------------------- include/linux/mlx4/device.h | 3 - 7 files changed, 6 insertions(+), 133 deletions(-)
drivers/net/mlx4/en_rx.c +2 -1
@@ -524,7 +524,8 @@ out_loopback:dev_kfree_skb_any (skb); } -int mlx4_en_process_rx_cq (struct net_device *dev,struct mlx4_en_cq *cq,int budget) +static int mlx4_en_process_rx_cq (struct net_device *dev, +struct mlx4_en_cq *cq,int budget) {struct mlx4_en_priv *priv =netdev_priv (dev);struct mlx4_cqe *cqe;
drivers/net/mlx4/icm.c +1 -27
@@ -210,38 +210,12 @@ static int mlx4_MAP_ICM(struct mlx4_devreturn mlx4_map_cmd (dev,MLX4_CMD_MAP_ICM , icm, virt); } -int mlx4_UNMAP_ICM (struct mlx4_dev *dev,u64 virt,u32 page_count) +static int mlx4_UNMAP_ICM (struct mlx4_dev *dev,u64 virt,u32 page_count) {return mlx4_cmd (dev, virt, page_count,0 ,MLX4_CMD_UNMAP_ICM ,MLX4_CMD_TIME_CLASS_B ); } -int mlx4_MAP_ICM_page (struct mlx4_dev *dev,u64 dma_addr,u64 virt) -{ -struct mlx4_cmd_mailbox *mailbox; -__be64 *inbox; -int err; - - mailbox =mlx4_alloc_cmd_mailbox (dev); -if (IS_ERR (mailbox)) -return PTR_ERR (mailbox); - inbox = mailbox->buf; - - inbox[0 ] =cpu_to_be64 (virt); - inbox[1 ] =cpu_to_be64 (dma_addr); - - err =mlx4_cmd (dev, mailbox->dma,1 ,0 ,MLX4_CMD_MAP_ICM , -MLX4_CMD_TIME_CLASS_B ); - -mlx4_free_cmd_mailbox (dev, mailbox); - -if (!err) -mlx4_dbg (dev,"Mapped page at %llx to %llx for ICM.\n" , - (unsigned long long ) dma_addr, (unsigned long long ) virt); - -return err; -} -int mlx4_MAP_ICM_AUX (struct mlx4_dev *dev,struct mlx4_icm *icm) {return mlx4_map_cmd (dev,MLX4_CMD_MAP_ICM_AUX , icm,-1 );
drivers/net/mlx4/icm.h +0 -2
@@ -128,8 +128,6 @@ static inline unsigned long mlx4_icm_sizreturn sg_dma_len (&iter->chunk->mem[iter->page_idx]); } -int mlx4_UNMAP_ICM (struct mlx4_dev *dev,u64 virt,u32 page_count); -int mlx4_MAP_ICM_page (struct mlx4_dev *dev,u64 dma_addr,u64 virt);int mlx4_MAP_ICM_AUX (struct mlx4_dev *dev,struct mlx4_icm *icm);int mlx4_UNMAP_ICM_AUX (struct mlx4_dev *dev);
drivers/net/mlx4/port.c +0 -97
103 lines not on this page · raw message
include/linux/mlx4/device.h +0 -3
@@ -474,9 +474,6 @@ int mlx4_multicast_detach(struct mlx4_deint mlx4_register_mac (struct mlx4_dev *dev,u8 port,u64 mac,int *index);void mlx4_unregister_mac (struct mlx4_dev *dev,u8 port,int index); -int mlx4_register_vlan (struct mlx4_dev *dev,u8 port,u16 vlan,int *index); -void mlx4_unregister_vlan (struct mlx4_dev *dev,u8 port,int index); -int mlx4_map_phys_fmr (struct mlx4_dev *dev,struct mlx4_fmr *fmr,u64 *page_list,int npages,u64 iova,u32 *lkey,u32 *rkey); int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
drivers/net/mlx4/mlx4_en.h +0 -3
@@ -518,9 +518,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4int mlx4_en_activate_rx_rings (struct mlx4_en_priv *priv);void mlx4_en_deactivate_rx_ring (struct mlx4_en_priv *priv,struct mlx4_en_rx_ring *ring); -int mlx4_en_process_rx_cq (struct net_device *dev, -struct mlx4_en_cq *cq, -int budget);int mlx4_en_poll_rx_cq (struct napi_struct *napi,int budget); void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride, int is_tx, int rss, int qpn, int cqn,
drivers/net/mlx4/cq.c +3 -0
@@ -73,6 +73,9 @@ struct mlx4_cq_context {#define MLX4_CQ_STATE_ARMED_SOL ( 6 << 8)#define MLX4_EQ_STATE_FIRED (10 << 8) +static int mlx4_ib_umem_write_mtt (struct mlx4_ib_dev *dev,struct mlx4_mtt *mtt, +struct ib_umem *umem); +void mlx4_cq_completion (struct mlx4_dev *dev,u32 cqn) {struct mlx4_cq *cq;
Quoted 6 lines
There is a whole section of code in this driver related to vlan tables which is not accessed from any kernel code.
Signed-off-by Stephen Hemminger <[email protected]>
Thanks for sending this,
There are patches under review at the moment (RDMA over Ethernet) that use this code:
http://www.spinics.net/lists/linux-rdma/msg05512.html, which will be broken if the VLAN tables code is removed.
Thanks,
Yevgeny
David Miller
maintainerFrom: Yevgeny Petrilin <[email protected]>
Date: Tue, 19 Oct 2010 09:37:44 +0200
Quoted 10 lines
Quoted 6 lines
There is a whole section of code in this driver related to vlan tables which is not accessed from any kernel code.
Signed-off-by Stephen Hemminger <[email protected]>Thanks for sending this,
There are patches under review at the moment (RDMA over Ethernet) that use this code:
http://www.spinics.net/lists/linux-rdma/msg05512.html, which will be broken if the VLAN tables code is removed.
ok.
PATCH 1/1 mlx4: make functions local and remove dead code.
Make the following function static: mlx4_UNMAP_ICM Remove the following unused function: mlx4_MAP_ICM_page
---
Leave the vlan functions alone, since patch using them is pending.
drivers/net/mlx4/icm.c | 28 +--------------------------- drivers/net/mlx4/icm.h | 2 -- 2 files changed, 1 insertion(+), 29 deletions(-)
drivers/net/mlx4/icm.c +1 -27
@@ -210,38 +210,12 @@ static int mlx4_MAP_ICM(struct mlx4_devreturn mlx4_map_cmd (dev,MLX4_CMD_MAP_ICM , icm, virt); } -int mlx4_UNMAP_ICM (struct mlx4_dev *dev,u64 virt,u32 page_count) +static int mlx4_UNMAP_ICM (struct mlx4_dev *dev,u64 virt,u32 page_count) {return mlx4_cmd (dev, virt, page_count,0 ,MLX4_CMD_UNMAP_ICM ,MLX4_CMD_TIME_CLASS_B ); } -int mlx4_MAP_ICM_page (struct mlx4_dev *dev,u64 dma_addr,u64 virt) -{ -struct mlx4_cmd_mailbox *mailbox; -__be64 *inbox; -int err; - - mailbox =mlx4_alloc_cmd_mailbox (dev); -if (IS_ERR (mailbox)) -return PTR_ERR (mailbox); - inbox = mailbox->buf; - - inbox[0 ] =cpu_to_be64 (virt); - inbox[1 ] =cpu_to_be64 (dma_addr); - - err =mlx4_cmd (dev, mailbox->dma,1 ,0 ,MLX4_CMD_MAP_ICM , -MLX4_CMD_TIME_CLASS_B ); - -mlx4_free_cmd_mailbox (dev, mailbox); - -if (!err) -mlx4_dbg (dev,"Mapped page at %llx to %llx for ICM.\n" , - (unsigned long long ) dma_addr, (unsigned long long ) virt); - -return err; -} -int mlx4_MAP_ICM_AUX (struct mlx4_dev *dev,struct mlx4_icm *icm) {return mlx4_map_cmd (dev,MLX4_CMD_MAP_ICM_AUX , icm,-1 );
drivers/net/mlx4/icm.h +0 -2
@@ -128,8 +128,6 @@ static inline unsigned long mlx4_icm_sizreturn sg_dma_len (&iter->chunk->mem[iter->page_idx]); } -int mlx4_UNMAP_ICM (struct mlx4_dev *dev,u64 virt,u32 page_count); -int mlx4_MAP_ICM_page (struct mlx4_dev *dev,u64 dma_addr,u64 virt);int mlx4_MAP_ICM_AUX (struct mlx4_dev *dev,struct mlx4_icm *icm);int mlx4_UNMAP_ICM_AUX (struct mlx4_dev *dev);
From: Stephen Hemminger <[email protected]>
Date: Thu, 21 Oct 2010 09:59:20 -0700
Quoted 4 lines
Make the following function static:
mlx4_UNMAP_ICMRemove the following unused function:mlx4_MAP_ICM_pageSigned-off-by Stephen Hemminger <[email protected]>
Applied.