linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc
@ 2015-11-08  7:11 Ivan Safonov
  2015-11-11  9:43 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Safonov @ 2015-11-08  7:11 UTC (permalink / raw)
  To: devel
  Cc: Greg Kroah-Hartman, Vaishali Thakkar, Jakub Sitnicki, Anish Bhatt,
	Joe Perches, Ivan Safonov, Nicholas Mc Guire, Alexey Khoroshilov,
	Rémy Oudompheng, Sudip Mukherjee, Shraddha Barke,
	linux-kernel

_rtl88e_fill_dummy fills the array elemets with zeros if necessary.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
 drivers/staging/rtl8188eu/hal/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c
index 1d8930a..7f1df4d 100644
--- a/drivers/staging/rtl8188eu/hal/fw.c
+++ b/drivers/staging/rtl8188eu/hal/fw.c
@@ -189,7 +189,7 @@ int rtl88eu_download_fw(struct adapter *adapt)
 		return -EFBIG;
 	}
 
-	pfwdata = kzalloc(FW_8188E_SIZE, GFP_KERNEL);
+	pfwdata = kmalloc(FW_8188E_SIZE, GFP_KERNEL);
 	if (!pfwdata)
 		return -ENOMEM;
 
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc
  2015-11-08  7:11 [PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc Ivan Safonov
@ 2015-11-11  9:43 ` Dan Carpenter
  2015-11-11 10:17   ` Ivan Safonov
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2015-11-11  9:43 UTC (permalink / raw)
  To: Ivan Safonov
  Cc: devel, Anish Bhatt, Vaishali Thakkar, Greg Kroah-Hartman,
	linux-kernel, Nicholas Mc Guire, Joe Perches, Sudip Mukherjee,
	Alexey Khoroshilov

On Sun, Nov 08, 2015 at 02:11:08PM +0700, Ivan Safonov wrote:
> _rtl88e_fill_dummy fills the array elemets with zeros if necessary.
> 

_rtl88e_fill_dummy() fills the last sizeof(u32) or whatever so the code
is aligned but it doesn't fill up to the end of FW_8188E_SIZE.  Why do
we even allocate that much memory.  Why don't we just allocate:

	pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc
  2015-11-11  9:43 ` Dan Carpenter
@ 2015-11-11 10:17   ` Ivan Safonov
  2016-02-08  2:55     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Safonov @ 2015-11-11 10:17 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Anish Bhatt, Vaishali Thakkar, Greg Kroah-Hartman,
	linux-kernel, Nicholas Mc Guire, Joe Perches, Sudip Mukherjee,
	Alexey Khoroshilov

On 11/11/2015 04:43 PM, Dan Carpenter wrote:
> On Sun, Nov 08, 2015 at 02:11:08PM +0700, Ivan Safonov wrote:
>> _rtl88e_fill_dummy fills the array elemets with zeros if necessary.
>>
> _rtl88e_fill_dummy() fills the last sizeof(u32) or whatever so the code
> is aligned but it doesn't fill up to the end of FW_8188E_SIZE.  Why do
> we even allocate that much memory.  Why don't we just allocate:
>
> 	pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);
>
> regards,
> dan carpenter

Yes, it will save about 2 KB. I will correct it in the next patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc
  2015-11-11 10:17   ` Ivan Safonov
@ 2016-02-08  2:55     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2016-02-08  2:55 UTC (permalink / raw)
  To: Ivan Safonov
  Cc: Dan Carpenter, devel, Anish Bhatt, Vaishali Thakkar, linux-kernel,
	Nicholas Mc Guire, Joe Perches, Sudip Mukherjee,
	Alexey Khoroshilov

On Wed, Nov 11, 2015 at 05:17:50PM +0700, Ivan Safonov wrote:
> On 11/11/2015 04:43 PM, Dan Carpenter wrote:
> >On Sun, Nov 08, 2015 at 02:11:08PM +0700, Ivan Safonov wrote:
> >>_rtl88e_fill_dummy fills the array elemets with zeros if necessary.
> >>
> >_rtl88e_fill_dummy() fills the last sizeof(u32) or whatever so the code
> >is aligned but it doesn't fill up to the end of FW_8188E_SIZE.  Why do
> >we even allocate that much memory.  Why don't we just allocate:
> >
> >	pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);
> >
> >regards,
> >dan carpenter
> 
> Yes, it will save about 2 KB. I will correct it in the next patch.

Please send a v3 series with this fixed up.

Also, please properly thread your patches so they all show up grouped
together.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-08  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-08  7:11 [PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc Ivan Safonov
2015-11-11  9:43 ` Dan Carpenter
2015-11-11 10:17   ` Ivan Safonov
2016-02-08  2:55     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).