Skip to contentSkip to conversation

staging: net: netlogic: Remove unneeded cast

PATCH-next Christopher Diaz Riveros 1 participant 1 message Feb 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Fix Coccinelle alert:

drivers/staging//netlogic/xlr_net.c:996:12-30: WARNING: casting value returned by memory allocation function to (struct xlr_adapter *) is useless.

This issue was detected by using the Coccinelle software.

---
 drivers/staging/netlogic/xlr_net.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/netlogic/xlr_net.c +1 -2
index 30532d8c310b..e461168313bf 100644
@@ -993,8 +993,7 @@ static int xlr_net_probe(struct platform_device *pdev)
 	/*
 	 * Allocate our adapter data structure and attach it to the device.
 	 */
-	adapter = (struct xlr_adapter *)
-		devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
+	adapter = devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
 	if (!adapter)
 		return -ENOMEM;
 
Signature · 1 line
2.16.2