public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "long.wanglong" <long.wanglong@huawei.com>
To: Tony Luck <tony.luck@intel.com>
Cc: Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>,
	"Tony Luck" <tony.luck@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	peifeiyue <peifeiyue@huawei.com>,
	Marco Stornelli <marco.stornelli@gmail.com>,
	"Anton Vorontsov" <anton.vorontsov@linaro.org>,
	Mark Salyzyn <salyzyn@android.com>,
	Sergiu Iordache <sergiu@chromium.org>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH v2] fs/pstore: Optimization function ramoops_init_przs
Date: Mon, 4 May 2015 17:30:04 +0800	[thread overview]
Message-ID: <55473C1C.7000803@huawei.com> (raw)
In-Reply-To: <CAGXu5jJre6wSee2_94EJPt7ffGaKRJXfKsM=f_s96JVX4YT0FA@mail.gmail.com>

On 2015/3/19 4:11, Kees Cook wrote:
> On Tue, Mar 17, 2015 at 6:41 PM, Wang Long <long.wanglong@huawei.com> wrote:
>> The value of cxt->record_size does not change in the loop,
>> so this patch optimize the assign statement by dropping
>> sz entirely and using cxt->record_size in its place.
>>
>> Signed-off-by: Wang Long <long.wanglong@huawei.com>
> 
> Thanks!
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> 
> -Kees
> 
>> ---
>>  fs/pstore/ram.c | 8 +++-----
>>  1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
>> index 44a549b..f29373d 100644
>> --- a/fs/pstore/ram.c
>> +++ b/fs/pstore/ram.c
>> @@ -394,18 +394,16 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
>>         }
>>
>>         for (i = 0; i < cxt->max_dump_cnt; i++) {
>> -               size_t sz = cxt->record_size;
>> -
>> -               cxt->przs[i] = persistent_ram_new(*paddr, sz, 0,
>> +               cxt->przs[i] = persistent_ram_new(*paddr, cxt->record_size, 0,
>>                                                   &cxt->ecc_info,
>>                                                   cxt->memtype);
>>                 if (IS_ERR(cxt->przs[i])) {
>>                         err = PTR_ERR(cxt->przs[i]);
>>                         dev_err(dev, "failed to request mem region (0x%zx@0x%llx): %d\n",
>> -                               sz, (unsigned long long)*paddr, err);
>> +                               cxt->record_size, (unsigned long long)*paddr, err);
>>                         goto fail_prz;
>>                 }
>> -               *paddr += sz;
>> +               *paddr += cxt->record_size;
>>         }
>>
>>         return 0;
>> --
>> 1.8.3.4
>>
>> --
>> 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/
> 
> 
> 

Hi Tony Luck,

Could you please help to commit this patch?

Thank you.

Best Regards
Wang Long


      reply	other threads:[~2015-05-04 10:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  1:41 [PATCH v2] fs/pstore: Optimization function ramoops_init_przs Wang Long
2015-03-18 20:11 ` Kees Cook
2015-05-04  9:30   ` long.wanglong [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=55473C1C.7000803@huawei.com \
    --to=long.wanglong@huawei.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=peifeiyue@huawei.com \
    --cc=salyzyn@android.com \
    --cc=sergiu@chromium.org \
    --cc=tony.luck@intel.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