Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
From: Joe Perches <joe@perches.com>
To: Denis Efremov <efremov@linux.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: libcxgbi: use kvzalloc instead of opencoded kzalloc/vzalloc
Date: Fri, 31 Jul 2020 14:58:36 -0700
Message-ID: <33d943d2b83f17371df09b5962c856ea2d894954.camel@perches.com> (raw)
In-Reply-To: <20200731215524.14295-1-efremov@linux.com>

On Sat, 2020-08-01 at 00:55 +0300, Denis Efremov wrote:
> Remove cxgbi_alloc_big_mem(), cxgbi_free_big_mem() functions
> and use kvzalloc/kvfree instead.

Sensible, thanks.

> diff --git 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);

missing __GFP_NOWARN

> diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
[]
> @@ -537,22 +537,6 @@ struct cxgbi_task_data {
>  #define iscsi_task_cxgbi_data(task) \
>  	((task)->dd_data + sizeof(struct iscsi_tcp_task))
>  
> -static inline void *cxgbi_alloc_big_mem(unsigned int size,
> -					gfp_t gfp)
> -{
> -	void *p = kzalloc(size, gfp | __GFP_NOWARN);



  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 21:55 Denis Efremov
2020-07-31 21:58 ` Joe Perches [this message]
2020-07-31 22:10   ` Denis Efremov
2020-07-31 22:24     ` Joe Perches
2020-08-01  7:51       ` Denis Efremov
2020-08-01  7:58         ` Denis Efremov
2020-08-01  8:10         ` Joe Perches
2020-08-01 13:28           ` Denis Efremov
2020-08-01 13:31 ` [PATCH v2] " Denis Efremov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33d943d2b83f17371df09b5962c856ea2d894954.camel@perches.com \
    --to=joe@perches.com \
    --cc=efremov@linux.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git