]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
staging: net: netlogic: Remove unneeded cast
authorChristopher Diaz Riveros <chrisadr@gentoo.org>
Tue, 20 Feb 2018 16:30:33 +0000 (11:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Feb 2018 13:59:05 +0000 (14:59 +0100)
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.

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/netlogic/xlr_net.c

index 30532d8c310b344c01a329db330e47ff124bbba8..e461168313bf95c66e56afff9fba720d9b23c41a 100644 (file)
@@ -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;