From: Haowen Bai <baihaowen@meizu.com>
To: <joe@perches.com>
Cc: <aayarekar@marvell.com>, <baihaowen@meizu.com>,
<davem@davemloft.net>, <kuba@kernel.org>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<pabeni@redhat.com>, <vburru@marvell.com>
Subject: [PATCH V2] octeon_ep: Remove unnecessary cast
Date: Tue, 24 May 2022 11:28:35 +0800 [thread overview]
Message-ID: <1653362915-22831-1-git-send-email-baihaowen@meizu.com> (raw)
In-Reply-To: <53b4a92efb83d893230f47ae9988282f3875b355.camel@perches.com>
Fix the following coccicheck warning:
./drivers/net/ethernet/marvell/octeon_ep/octep_rx.c:161:18-40: WARNING:
casting value returned by memory allocation function to (struct
octep_rx_buffer *) is useless.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
V1->V2: change vzalloc to vcalloc as suggestion.
drivers/net/ethernet/marvell/octeon_ep/octep_rx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c b/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
index d9ae0937d17a..3c43f8078528 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
@@ -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 = vcalloc(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);
--
2.7.4
next prev parent reply other threads:[~2022-05-24 3:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 1:47 [PATCH] " Haowen Bai
2022-04-20 2:07 ` Joe Perches
2022-05-24 3:28 ` Haowen Bai [this message]
2022-05-24 3:48 ` [PATCH V2] " Joe Perches
2022-05-24 3:51 ` baihaowen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1653362915-22831-1-git-send-email-baihaowen@meizu.com \
--to=baihaowen@meizu.com \
--cc=aayarekar@marvell.com \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vburru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®