netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: qed: Remove unneeded cast from memory allocation
@ 2020-07-22  2:10 Wang Hai
  2020-07-23  0:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Hai @ 2020-07-22  2:10 UTC (permalink / raw)
  To: aelior, GR-everest-linux-l2, davem, kuba; +Cc: netdev, linux-kernel

Remove casting the values returned by memory allocation function.

Coccinelle emits WARNING: casting value returned by memory allocation
unction to (struct roce_destroy_qp_req_output_params *) is useless.

This issue was detected by using the Coccinelle software.

Signed-off-by: Wang Hai <wanghai38@huawei.com>
---
 drivers/net/ethernet/qlogic/qed/qed_roce.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c
index a1423ec0edf7..f16a157bb95a 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_roce.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c
@@ -757,8 +757,7 @@ static int qed_roce_sp_destroy_qp_requester(struct qed_hwfn *p_hwfn,
 	if (!qp->req_offloaded)
 		return 0;
 
-	p_ramrod_res = (struct roce_destroy_qp_req_output_params *)
-		       dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
+	p_ramrod_res = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
 					  sizeof(*p_ramrod_res),
 					  &ramrod_res_phys, GFP_KERNEL);
 	if (!p_ramrod_res) {
-- 
2.17.1


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

* Re: [PATCH net-next] net: qed: Remove unneeded cast from memory allocation
  2020-07-22  2:10 [PATCH net-next] net: qed: Remove unneeded cast from memory allocation Wang Hai
@ 2020-07-23  0:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-23  0:29 UTC (permalink / raw)
  To: wanghai38; +Cc: aelior, GR-everest-linux-l2, kuba, netdev, linux-kernel

From: Wang Hai <wanghai38@huawei.com>
Date: Wed, 22 Jul 2020 10:10:27 +0800

> Remove casting the values returned by memory allocation function.
> 
> Coccinelle emits WARNING: casting value returned by memory allocation
> unction to (struct roce_destroy_qp_req_output_params *) is useless.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Wang Hai <wanghai38@huawei.com>

Applied, thank you.

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

end of thread, other threads:[~2020-07-23  0:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22  2:10 [PATCH net-next] net: qed: Remove unneeded cast from memory allocation Wang Hai
2020-07-23  0:29 ` David Miller

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).