aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-02-09 05:10:41 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-09 17:10:05 -0500
commit1d966d03a37f7f58abf12e87203d03f96950cfd0 (patch)
treeb8ac6df8e58fcf7b1221bb0c69135d744eec5cd2 /drivers/net
parentc4c655302c9134c75aa88f522ee33c493276f02c (diff)
net: Mellanox: Delete unnecessary checks before the function call "vunmap"
The vunmap() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Eli Cohen <eli@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/alloc.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/alloc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c
index a716c26e0d99..0c51c69f802f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
@@ -662,7 +662,7 @@ void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf)
662 buf->direct.buf, 662 buf->direct.buf,
663 buf->direct.map); 663 buf->direct.map);
664 else { 664 else {
665 if (BITS_PER_LONG == 64 && buf->direct.buf) 665 if (BITS_PER_LONG == 64)
666 vunmap(buf->direct.buf); 666 vunmap(buf->direct.buf);
667 667
668 for (i = 0; i < buf->nbufs; ++i) 668 for (i = 0; i < buf->nbufs; ++i)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
index 56779c1c7811..201ca6d76ce5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
@@ -121,7 +121,7 @@ void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf)
121 dma_free_coherent(&dev->pdev->dev, buf->size, buf->direct.buf, 121 dma_free_coherent(&dev->pdev->dev, buf->size, buf->direct.buf,
122 buf->direct.map); 122 buf->direct.map);
123 else { 123 else {
124 if (BITS_PER_LONG == 64 && buf->direct.buf) 124 if (BITS_PER_LONG == 64)
125 vunmap(buf->direct.buf); 125 vunmap(buf->direct.buf);
126 126
127 for (i = 0; i < buf->nbufs; i++) 127 for (i = 0; i < buf->nbufs; i++)