Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: yalin wang <yalin.wang2010@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Peter Hurley <peter@hurleysoftware.com>,
	Alim Akhtar <alim.akhtar@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ben Hutchings <ben@decadent.org.uk>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	asaf.vertz@tandemg.com, Tobias Klauser <tklauser@distanz.ch>,
	Jon Hunter <jonathanh@nvidia.com>,
	"James E.J. Bottomley" <JBottomley@odin.com>,
	Grant Grundler <grundler@chromium.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: change to use kmalloc
Date: Thu, 12 Nov 2015 19:27:42 +0800	[thread overview]
Message-ID: <F779CDF6-6F14-4E92-A8A8-F0ACBB2AF3C8@gmail.com> (raw)
In-Reply-To: <CAHp75VdKODX13UUiUs6i2A2phraAEC5Ok5arN3jNSYPta2-qiA@mail.gmail.com>


> On Nov 12, 2015, at 05:57, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> 
> On Wed, Nov 11, 2015 at 11:17 PM, Peter Hurley <peter@hurleysoftware.com> wrote:
>> On 11/11/2015 12:02 PM, Alim Akhtar wrote:
>>> Hi Yalin,
>>> 
>>> On Wed, Nov 11, 2015 at 9:53 AM, yalin wang <yalin.wang2010@gmail.com> wrote:
>>>> 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.
> 
yeah,  i will send a new patch ,



>> 
>> Regards,
>> Peter Hurley
>> 
>>>> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
>>>> ---
>>>> drivers/mmc/card/block.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>> 
>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>> index 23b6c8e..975cd3e 100644
>>>> --- a/drivers/mmc/card/block.c
>>>> +++ b/drivers/mmc/card/block.c
>>>> @@ -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-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 
> 
> -- 
> With Best Regards,
> Andy Shevchenko


      reply	other threads:[~2015-11-12 11:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11  4:23 [PATCH] mmc: change to use kmalloc yalin wang
2015-11-11 17:02 ` Alim Akhtar
2015-11-11 21:17   ` Peter Hurley
2015-11-11 21:57     ` Andy Shevchenko
2015-11-12 11:27       ` yalin wang [this message]

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=F779CDF6-6F14-4E92-A8A8-F0ACBB2AF3C8@gmail.com \
    --to=yalin.wang2010@gmail.com \
    --cc=JBottomley@odin.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=asaf.vertz@tandemg.com \
    --cc=ben@decadent.org.uk \
    --cc=grundler@chromium.org \
    --cc=jh80.chung@samsung.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=tklauser@distanz.ch \
    --cc=ulf.hansson@linaro.org \
    /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