diff options
author | Denis Efremov <efremov@linux.com> | 2020-08-01 16:31:23 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-08-20 23:34:47 -0400 |
commit | ee9108fedf63c6b8cfc40767c472680d51dd1662 (patch) | |
tree | f693270c5c5d8b8559d62fff14266bf5725f6b8d /drivers/scsi/cxgbi/libcxgbi.c | |
parent | ca358af1d1bb5b9eb75f3998b20ab68f6b3ce69c (diff) |
scsi: libcxgbi: Use kvzalloc instead of opencoded kzalloc/vzalloc
Remove cxgbi_alloc_big_mem(), cxgbi_free_big_mem() functions and use
kvzalloc/kvfree instead. __GFP_NOWARN added to kvzalloc() call because we
already print a warning in case of allocation fail.
Link: https://lore.kernel.org/r/20200801133123.61834-1-efremov@linux.com
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxgbi/libcxgbi.c')
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 71aebaf533ea..13781d8c574f 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -77,9 +77,9 @@ int cxgbi_device_portmap_create(struct cxgbi_device *cdev, unsigned int base, { struct cxgbi_ports_map *pmap = &cdev->pmap; - pmap->port_csk = cxgbi_alloc_big_mem(max_conn * - sizeof(struct cxgbi_sock *), - GFP_KERNEL); + pmap->port_csk = kvzalloc(array_size(max_conn, + sizeof(struct cxgbi_sock *)), + GFP_KERNEL | __GFP_NOWARN); if (!pmap->port_csk) { pr_warn("cdev 0x%p, portmap OOM %u.\n", cdev, max_conn); return -ENOMEM; @@ -124,7 +124,7 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev) if (cdev->cdev2ppm) cxgbi_ppm_release(cdev->cdev2ppm(cdev)); if (cdev->pmap.max_connect) - cxgbi_free_big_mem(cdev->pmap.port_csk); + kvfree(cdev->pmap.port_csk); kfree(cdev); } |