pata_macio: Delete an error message for a failed memory allocation in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 16 Feb 2018 12:01:45 +0000 (13:01 +0100)
committerTejun Heo <tj@kernel.org>
Sun, 18 Feb 2018 13:24:16 +0000 (05:24 -0800)
Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/pata_macio.c

index 0adcb40d2794ec5efe4a21407aade6728b8b2bd0..9588e685d994cf267b1fb4f491749b717274aa0f 100644 (file)
@@ -1131,11 +1131,9 @@ static int pata_macio_attach(struct macio_dev *mdev,
        /* Allocate and init private data structure */
        priv = devm_kzalloc(&mdev->ofdev.dev,
                            sizeof(struct pata_macio_priv), GFP_KERNEL);
-       if (priv == NULL) {
-               dev_err(&mdev->ofdev.dev,
-                       "Failed to allocate private memory\n");
+       if (!priv)
                return -ENOMEM;
-       }
+
        priv->node = of_node_get(mdev->ofdev.dev.of_node);
        priv->mdev = mdev;
        priv->dev = &mdev->ofdev.dev;
@@ -1277,11 +1275,9 @@ static int pata_macio_pci_attach(struct pci_dev *pdev,
        /* Allocate and init private data structure */
        priv = devm_kzalloc(&pdev->dev,
                            sizeof(struct pata_macio_priv), GFP_KERNEL);
-       if (priv == NULL) {
-               dev_err(&pdev->dev,
-                       "Failed to allocate private memory\n");
+       if (!priv)
                return -ENOMEM;
-       }
+
        priv->node = of_node_get(np);
        priv->pdev = pdev;
        priv->dev = &pdev->dev;