]> www.infradead.org Git - users/willy/linux.git/commitdiff
scsi: qedi: Use kmalloc instead of __get_free_pages gfp-removal
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 27 Sep 2020 20:40:44 +0000 (16:40 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 28 Sep 2020 13:27:36 +0000 (09:27 -0400)
There's no need to use this low-level allocator in this driver.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
drivers/scsi/qedi/qedi_main.c

index 6f038ae5efcafc00560cb19b97f1ddab788475d1..25a0f05c745c4f4739d5503ebc97b5f2d5e80131 100644 (file)
@@ -170,10 +170,8 @@ static void __qedi_free_uio_rings(struct qedi_uio_dev *udev)
                udev->ll2_ring = NULL;
        }
 
-       if (udev->ll2_buf) {
-               free_pages((unsigned long)udev->ll2_buf, 2);
-               udev->ll2_buf = NULL;
-       }
+       kfree(udev->ll2_buf);
+       udev->ll2_buf = NULL;
 }
 
 static void __qedi_free_uio(struct qedi_uio_dev *udev)
@@ -237,8 +235,7 @@ static int __qedi_alloc_uio_rings(struct qedi_uio_dev *udev)
        /* Allocating memory for Tx/Rx pkt buffer */
        udev->ll2_buf_size = TX_RX_RING * qedi_ll2_buf_size;
        udev->ll2_buf_size = QEDI_PAGE_ALIGN(udev->ll2_buf_size);
-       udev->ll2_buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP |
-                                                __GFP_ZERO, 2);
+       udev->ll2_buf = kzalloc(PAGE_SIZE * 4, GFP_KERNEL);
        if (!udev->ll2_buf) {
                rc = -ENOMEM;
                goto exit_alloc_buf;