Skip to content

Commit

Permalink
octeon_ep: Remove useless casting value returned by vzalloc to structure
Browse files Browse the repository at this point in the history
coccinelle reports a warning

WARNING: casting value returned by memory allocation
function to (struct octep_rx_buffer *) is useless.

To fix this the useless cast is removed.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/Yx+sr9o0uylXVcOl@playground
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jules Irenge authored and Jakub Kicinski committed Sep 20, 2022
1 parent 8bb7c4f commit ed48cfe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ static int octep_setup_oq(struct octep_device *oct, int q_no)
goto desc_dma_alloc_err;
}

oq->buff_info = (struct octep_rx_buffer *)
vzalloc(oq->max_count * OCTEP_OQ_RECVBUF_SIZE);
oq->buff_info = vzalloc(oq->max_count * OCTEP_OQ_RECVBUF_SIZE);
if (unlikely(!oq->buff_info)) {
dev_err(&oct->pdev->dev,
"Failed to allocate buffer info for OQ-%d\n", q_no);
Expand Down

0 comments on commit ed48cfe

Please sign in to comment.