mmc: change to use kmalloc
PATCH 1/1 mmc: change to use kmalloc
Use kmalloc instead of kzalloc, zero the memory is not needed.
--- drivers/mmc/card/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/card/block.c +1 -1
@@ -365,7 +365,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(if (!idata->buf_bytes)return idata; - idata->buf =kzalloc (idata->buf_bytes,GFP_KERNEL ); + idata->buf =kmalloc (idata->buf_bytes,GFP_KERNEL );if (!idata->buf) { err = -ENOMEM ; goto idata_err;
Signature · 1 line
1.9.1
Hi Yalin,
Quoted 2 lines · yalin wang
Use kmalloc instead of kzalloc, zero the memory is not needed.
why you want to do this? what problem you faces, and how this resolves the same?
Quoted 25 lines
Signed-off-by yalin wang <[email protected]>--- drivers/mmc/card/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/card/block.c +1
-2@@ -365,7 +365,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(if (!idata->buf_bytes)return idata; - idata->buf =kzalloc (idata->buf_bytes,GFP_KERNEL ); + idata->buf =kmalloc (idata->buf_bytes,GFP_KERNEL );if (!idata->buf) { err = -ENOMEM ; goto idata_err; --1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Regards, Alim
Quoted 6 lines · Alim Akhtar
Hi Yalin,
Quoted 2 lines · yalin wang
Use kmalloc instead of kzalloc, zero the memory is not needed.
why you want to do this? what problem you faces, and how this resolves the same?
The patch fixes an inefficiency: explicitly zeroing memory that is then immediately overwritten 6 lines below is wasteful.
Regards,
Peter Hurley
Quoted 20 lines
Quoted 20 lines
Signed-off-by yalin wang <[email protected]>--- drivers/mmc/card/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/card/block.c +1
-2@@ -365,7 +365,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(if (!idata->buf_bytes)return idata; - idata->buf =kzalloc (idata->buf_bytes,GFP_KERNEL ); + idata->buf =kmalloc (idata->buf_bytes,GFP_KERNEL );if (!idata->buf) { err = -ENOMEM ; goto idata_err; --1.9.1
Quoted 10 lines · Peter Hurley
Quoted 6 lines · Alim Akhtar
Hi Yalin,
Quoted 2 lines · yalin wang
Use kmalloc instead of kzalloc, zero the memory is not needed.
why you want to do this? what problem you faces, and how this resolves the same?
The patch fixes an inefficiency: explicitly zeroing memory that is then immediately overwritten 6 lines below is wasteful.
It might fix previous kzalloc as well, though better not to do since it's error prone.
Quoted 30 lines
Regards,
Peter HurleyQuoted 13 lines
Quoted 13 lines
Signed-off-by yalin wang <[email protected]>--- drivers/mmc/card/block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/card/block.c +0
-0@@ -365,7 +365,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(if (!idata->buf_bytes)return idata;Quoted 7 lines
Quoted 7 lines
drivers/mmc/card/block.c +1
-2- idata->buf =kzalloc (idata->buf_bytes,GFP_KERNEL ); + idata->buf =kmalloc (idata->buf_bytes,GFP_KERNEL );if (!idata->buf) { err = -ENOMEM ; goto idata_err; --1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Peter Hurley
Quoted 5 lines · Alim Akhtar
Hi Yalin,
Quoted 2 lines · yalin wang
Use kmalloc instead of kzalloc, zero the memory is not needed.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
why you want to do this? what problem you faces, and how this resolves the same?
The patch fixes an inefficiency: explicitly zeroing memory that is then immediately overwritten 6 lines below is wasteful.
It might fix previous kzalloc as well, though better not to do since it's error prone.
yeah, i will send a new patch ,
Quoted 36 lines
Quoted 30 lines
Regards,
Peter HurleyQuoted 13 lines
Quoted 13 lines
Signed-off-by yalin wang <[email protected]>---
drivers/mmc/card/block.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/card/block.c +0
-0@@ -365,7 +365,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(if (!idata->buf_bytes)return idata;Quoted 7 lines
Quoted 7 lines
drivers/mmc/card/block.c +1
-2- idata->buf =kzalloc (idata->buf_bytes,GFP_KERNEL ); + idata->buf =kmalloc (idata->buf_bytes,GFP_KERNEL );if (!idata->buf) { err = -ENOMEM ; goto idata_err; --1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/Signature · 2 lines
With Best Regards, Andy Shevchenko