staging: rtl8188eu: kzalloc replaced by kmalloc
PATCH v2 5/12 staging: rtl8188eu: kzalloc replaced by kmalloc
_rtl88e_fill_dummy fills the array elemets with zeros if necessary.
--- drivers/staging/rtl8188eu/hal/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/fw.c +1 -1
@@ -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 ;
Signature · 1 line
2.4.10
Quoted 2 lines · Ivan Safonov
_rtl88e_fill_dummyfills 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
Quoted 11 lines · Dan Carpenter
Quoted 2 lines · Ivan Safonov
_rtl88e_fill_dummyfills 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 ofFW_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.
Greg Kroah-Hartman
maintainerQuoted 8 lines · Ivan Safonov
Quoted 7 lines · Dan Carpenter
Quoted 2 lines · Ivan Safonov
_rtl88e_fill_dummyfills 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 ofFW_8188E_SIZE. Why do we even allocate that much memory. Why don't we just allocate:
Quoted 6 lines
Quoted 4 lines
pfwdata = kmalloc(round_up(fwsize, sizeof(u32)), GFP_KERNEL);regards,
dan carpenterYes, 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