mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Derek Chickles <dchickles@marvell.com>
To: Wang Hai <wanghai38@huawei.com>,
	"joe@perches.com" <joe@perches.com>,
	Satananda Burla <sburla@marvell.com>,
	Felix Manlunas <fmanlunas@marvell.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH net-next] liquidio: Replace vmalloc with kmalloc in octeon_register_dispatch_fn()
Date: Thu, 30 Jul 2020 18:58:57 +0000	[thread overview]
Message-ID: <BYAPR18MB2423C7A710232C87229FF90BAC710@BYAPR18MB2423.namprd18.prod.outlook.com> (raw)

> From: Wang Hai <wanghai38@huawei.com>
> Sent: Wednesday, July 29, 2020 11:12 PM
> To: joe@perches.com; Derek Chickles <dchickles@marvell.com>; Satananda
> Burla <sburla@marvell.com>; Felix Manlunas <fmanlunas@marvell.com>;
> davem@davemloft.net; kuba@kernel.org
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [EXT] [PATCH net-next] liquidio: Replace vmalloc with kmalloc in
> octeon_register_dispatch_fn()
> 
> The size of struct octeon_dispatch is too small, it is better to use kmalloc
> instead of vmalloc.
> 
> Suggested-by: Joe Perches <joe@perches.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
>  drivers/net/ethernet/cavium/liquidio/octeon_device.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> index 934115d18488..ac32facaa427 100644
> --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.c
> @@ -1056,7 +1056,7 @@ void octeon_delete_dispatch_list(struct
> octeon_device *oct)
> 
>  	list_for_each_safe(temp, tmp2, &freelist) {
>  		list_del(temp);
> -		vfree(temp);
> +		kfree(temp);
>  	}
>  }
> 
> @@ -1152,13 +1152,10 @@ octeon_register_dispatch_fn(struct
> octeon_device *oct,
> 
>  		dev_dbg(&oct->pci_dev->dev,
>  			"Adding opcode to dispatch list linked list\n");
> -		dispatch = (struct octeon_dispatch *)
> -			   vmalloc(sizeof(struct octeon_dispatch));
> -		if (!dispatch) {
> -			dev_err(&oct->pci_dev->dev,
> -				"No memory to add dispatch function\n");
> +		dispatch = kmalloc(sizeof(*dispatch), GFP_KERNEL);
> +		if (!dispatch)
>  			return 1;
> -		}
> +
>  		dispatch->opcode = combined_opcode;
>  		dispatch->dispatch_fn = fn;
>  		dispatch->arg = fn_arg;
> --
> 2.17.1

Looks good.

Reviewed-by: Derek Chickles <dchickles@marvell.com>

             reply	other threads:[~2020-07-30 18:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 18:58 Derek Chickles [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-30  6:11 Wang Hai
2020-07-31  0:40 ` David Miller

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=BYAPR18MB2423C7A710232C87229FF90BAC710@BYAPR18MB2423.namprd18.prod.outlook.com \
    --to=dchickles@marvell.com \
    --cc=davem@davemloft.net \
    --cc=fmanlunas@marvell.com \
    --cc=joe@perches.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sburla@marvell.com \
    --cc=wanghai38@huawei.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®