netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv1] net: macb: Remove dead code
@ 2019-09-23  8:33 shubhrajyoti.datta
  2019-09-23 11:40 ` Claudiu.Beznea
  0 siblings, 1 reply; 2+ messages in thread
From: shubhrajyoti.datta @ 2019-09-23  8:33 UTC (permalink / raw)
  To: davem, netdev; +Cc: nicolas.ferre, shubhrajyoti.datta, Shubhrajyoti Datta

From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

macb_64b_desc is always called when HW_DMA_CAP_64B is defined.
So the return NULL can never be reached. Remove the dead code.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 35b59b5..8e8d557 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -165,9 +165,8 @@ static unsigned int macb_adj_dma_desc_idx(struct macb *bp, unsigned int desc_idx
 #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
 static struct macb_dma_desc_64 *macb_64b_desc(struct macb *bp, struct macb_dma_desc *desc)
 {
-	if (bp->hw_dma_cap & HW_DMA_CAP_64B)
-		return (struct macb_dma_desc_64 *)((void *)desc + sizeof(struct macb_dma_desc));
-	return NULL;
+	return (struct macb_dma_desc_64 *)((void *)desc
+		+ sizeof(struct macb_dma_desc));
 }
 #endif
 
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv1] net: macb: Remove dead code
  2019-09-23  8:33 [PATCHv1] net: macb: Remove dead code shubhrajyoti.datta
@ 2019-09-23 11:40 ` Claudiu.Beznea
  0 siblings, 0 replies; 2+ messages in thread
From: Claudiu.Beznea @ 2019-09-23 11:40 UTC (permalink / raw)
  To: shubhrajyoti.datta, davem, netdev; +Cc: Nicolas.Ferre, shubhrajyoti.datta



On 23.09.2019 11:33, shubhrajyoti.datta@gmail.com wrote:
> From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> 
> macb_64b_desc is always called when HW_DMA_CAP_64B is defined.
> So the return NULL can never be reached. Remove the dead code.
> 
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>

> ---
>  drivers/net/ethernet/cadence/macb_main.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 35b59b5..8e8d557 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -165,9 +165,8 @@ static unsigned int macb_adj_dma_desc_idx(struct macb *bp, unsigned int desc_idx
>  #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
>  static struct macb_dma_desc_64 *macb_64b_desc(struct macb *bp, struct macb_dma_desc *desc)
>  {
> -	if (bp->hw_dma_cap & HW_DMA_CAP_64B)
> -		return (struct macb_dma_desc_64 *)((void *)desc + sizeof(struct macb_dma_desc));
> -	return NULL;
> +	return (struct macb_dma_desc_64 *)((void *)desc
> +		+ sizeof(struct macb_dma_desc));
>  }
>  #endif
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-23 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23  8:33 [PATCHv1] net: macb: Remove dead code shubhrajyoti.datta
2019-09-23 11:40 ` Claudiu.Beznea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).