Linux wireless drivers development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: John W Linville <linville@tuxdriver.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine
Date: Sun, 18 Mar 2012 19:46:37 -0700	[thread overview]
Message-ID: <1332125197.23125.41.camel@joe2Laptop> (raw)
In-Reply-To: <4f669d14.5MVnZ/K9sIFwYerB%Larry.Finger@lwfinger.net>

On Sun, 2012-03-18 at 21:42 -0500, Larry Finger wrote:
> The current version of rtlwifi for USB operations uses kmalloc to
> acquire a 32-bit buffer for reading.

trivia:

> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/usb.c
[]
> @@ -955,6 +947,13 @@ int __devinit rtl_usb_probe(struct usb_i
>  		return -ENOMEM;
>  	}
>  	rtlpriv = hw->priv;
> +	rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32),
> +				    GFP_KERNEL);
> +	if (!rtlpriv->usb_data) {
> +		RT_ASSERT(false, "USB data buffer allocation failed\n");

The RT_ASSERT isn't really necessary as kzalloc already
does a dump_stack on allocation failure.


  reply	other threads:[~2012-03-19  2:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19  2:42 [PATCH] rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine Larry Finger
2012-03-19  2:46 ` Joe Perches [this message]
2012-03-19 20:36   ` Larry Finger
2012-03-19 20:52     ` Joe Perches

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=1332125197.23125.41.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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