dpaa2-eth: code cleanup
Subsystems (3)
Ioana Ciornei
maintainercover dpaa2-eth: code cleanup
There are no functional changes in this patch set, only some cleanup changes such as: unused parameters, uninitialized variables and unnecessary Kconfig dependencies.
Ioana Ciornei (4):
dpaa2-eth: make dpaa2_eth_set_dist_key static
dpaa2-eth: fix uninitialized variable warnings
dpaa2-eth: remove unused priv parameter
dpaa2-eth: mark unused parameter in dpaa2_eth_tx_conf
Ioana Radulescu (2):
dpaa2-eth: Fix Kconfig dependencies
dpaa2-eth: remove unused FD field
drivers/net/ethernet/freescale/dpaa2/Kconfig | 1 - drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 26 +++++++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-)
Signature · 1 line
1.9.1
Ioana Ciornei
maintainerPATCH 1/6 dpaa2-eth: Fix Kconfig dependencies
From: Ioana Radulescu <[email protected]>
Both ARCH_LAYERSCAPE and COMPILE_TEST dependencies are already implied through the FSL_MC_BUS dep, so there's no need to state it explicitly.
Also, the fsl-mc bus depends on COMPILE_TEST only for some architectures (arm, arm64, ppc, x86), so it's not correct to claim build support unconditionally.
--- drivers/net/ethernet/freescale/dpaa2/Kconfig | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/Kconfig +0 -1
@@ -1,7 +1,6 @@ config FSL_DPAA2_ETH tristate "Freescale DPAA2 Ethernet" depends on FSL_MC_BUS && FSL_MC_DPIO - depends on ARCH_LAYERSCAPE || COMPILE_TEST help This is the DPAA2 Ethernet driver supporting Freescale SoCs with DPAA2 (DataPath Acceleration Architecture v2).
Signature · 1 line
1.9.1
Ioana Ciornei
maintainerPATCH 2/6 dpaa2-eth: make dpaa2_eth_set_dist_key static
In reply to Ioana CiorneiThe dpaa2_eth_set_dist_key function is only used in a single file. Make it static.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +2 -2
@@ -2172,8 +2172,8 @@ int dpaa2_eth_cls_fld_off(int prot, int field)/* Set Rx distribution (hash or flow classification) key * flags is a combination of RXH_ bits */ -int dpaa2_eth_set_dist_key (struct net_device *net_dev, -enum dpaa2_eth_rx_dist type,u64 flags) +static int dpaa2_eth_set_dist_key (struct net_device *net_dev, +enum dpaa2_eth_rx_dist type,u64 flags) {struct device *dev = net_dev->dev.parent;struct dpaa2_eth_priv *priv =netdev_priv (net_dev);
Signature · 1 line
1.9.1
Ioana Ciornei
maintainerPATCH 3/6 dpaa2-eth: fix uninitialized variable warnings
In reply to Ioana CiorneiAll 3 cases of possible uninitialized variables are false positives since they are used only as output parameters. Nonetheless, fix the warnings.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +3 -3
@@ -935,7 +935,7 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget)struct dpaa2_eth_channel *ch;struct dpaa2_eth_priv *priv;int rx_cleaned =0 , txconf_cleaned =0 ; -enum dpaa2_eth_fq_type type; +enum dpaa2_eth_fq_type type =0 ;int store_cleaned;int err;
@@ -1002,7 +1002,7 @@ static void disable_ch_napi(struct dpaa2_eth_priv *priv)static int link_state_update (struct dpaa2_eth_priv *priv) { -struct dpni_link_state state; +struct dpni_link_state state = {0 };int err; err =dpni_get_link_state (priv->mc_io,0 , priv->mc_token, &state);
@@ -1116,7 +1116,7 @@ static u32 drain_ingress_frames(struct dpaa2_eth_priv *priv)static int dpaa2_eth_stop (struct net_device *net_dev) {struct dpaa2_eth_priv *priv =netdev_priv (net_dev); -int dpni_enabled; +int dpni_enabled =0 ;int retries =10 ;u32 drained;
Signature · 1 line
1.9.1
Ioana Ciornei
maintainerPATCH 4/6 dpaa2-eth: remove unused priv parameter
In reply to Ioana CiorneiThe priv parameter is never used in the build_linear_skb and drain_channel function. Remove it from the function definitions.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +4 -6
@@ -98,8 +98,7 @@ static void free_rx_fd(struct dpaa2_eth_priv *priv, }/* Build a linear skb based on a single-buffer frame descriptor */ -static struct sk_buff *build_linear_skb (struct dpaa2_eth_priv *priv, -struct dpaa2_eth_channel *ch, +static struct sk_buff *build_linear_skb (struct dpaa2_eth_channel *ch,const struct dpaa2_fd *fd,void *fd_vaddr) {
@@ -233,7 +232,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, percpu_extras =this_cpu_ptr (priv->percpu_extras);if (fd_format == dpaa2_fd_single) { - skb =build_linear_skb (priv, ch, fd, vaddr); + skb =build_linear_skb (ch, fd, vaddr); }else if (fd_format == dpaa2_fd_sg) { skb =build_frag_skb (priv, ch, buf_data);skb_free_frag (vaddr);
@@ -1085,8 +1084,7 @@ static int dpaa2_eth_open(struct net_device *net_dev)/* The DPIO store must be empty when we call this, * at the end of every NAPI cycle. */ -static u32 drain_channel (struct dpaa2_eth_priv *priv, -struct dpaa2_eth_channel *ch) +static u32 drain_channel (struct dpaa2_eth_channel *ch) {u32 drained =0 , total =0 ;
@@ -1107,7 +1105,7 @@ static u32 drain_ingress_frames(struct dpaa2_eth_priv *priv)for (i =0 ; i < priv->num_channels; i++) { ch = priv->channel[i]; - drained +=drain_channel (priv, ch); + drained +=drain_channel (ch); }return drained;
Signature · 1 line
1.9.1
Ioana Ciornei
maintainerPATCH 5/6 dpaa2-eth: mark unused parameter in dpaa2_eth_tx_conf
In reply to Ioana CiorneiThe ch parameter is never used in the dpaa2_eth_tx_conf function but since its prototype must match the type defined in the consume field of struct dpaa2_eth_fq, just mark it as __always_unused.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +1 -1
@@ -659,7 +659,7 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)/* Tx confirmation frame processing routine */ static void dpaa2_eth_tx_conf (struct dpaa2_eth_priv *priv, -struct dpaa2_eth_channel *ch, +struct dpaa2_eth_channel *ch__always_unused ,const struct dpaa2_fd *fd,struct napi_struct *napi__always_unused ,u16 queue_id__always_unused )
Signature · 1 line
1.9.1
Ioana Ciornei
maintainerPATCH 6/6 dpaa2-eth: remove unused FD field
In reply to Ioana CiorneiFrom: Ioana Radulescu <[email protected]>
According to the hardware ArchDef, the PTV1 field in FD[CTRL] is ignored by WRIOP, so setting it for Tx FDs is pointless.
Remove all references to it from the code.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +2 -2
@@ -437,7 +437,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,dpaa2_fd_set_format (fd, dpaa2_fd_sg);dpaa2_fd_set_addr (fd, addr);dpaa2_fd_set_len (fd, skb->len); -dpaa2_fd_set_ctrl (fd,FD_CTRL_PTA |FD_CTRL_PTV1 ); +dpaa2_fd_set_ctrl (fd,FD_CTRL_PTA );if (priv->tx_tstamp &&skb_shinfo (skb)->tx_flags &SKBTX_HW_TSTAMP )enable_tx_tstamp (fd, sgt_buf);
@@ -490,7 +490,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,dpaa2_fd_set_offset (fd, (u16)(skb->data - buffer_start));dpaa2_fd_set_len (fd, skb->len);dpaa2_fd_set_format (fd, dpaa2_fd_single); -dpaa2_fd_set_ctrl (fd,FD_CTRL_PTA |FD_CTRL_PTV1 ); +dpaa2_fd_set_ctrl (fd,FD_CTRL_PTA );if (priv->tx_tstamp &&skb_shinfo (skb)->tx_flags &SKBTX_HW_TSTAMP )enable_tx_tstamp (fd, buffer_start);
Signature · 1 line
1.9.1
David Miller
maintainerFrom: Ioana Ciornei <[email protected]>
Date: Fri, 12 Oct 2018 16:27:16 +0000
Quoted 3 lines
There are no functional changes in this patch set, only some cleanup changes such as: unused parameters, uninitialized variables and unnecessary
Kconfigdependencies.
Series applied.