lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55473C1C.7000803@huawei.com>
Date:	Mon, 4 May 2015 17:30:04 +0800
From:	"long.wanglong" <long.wanglong@...wei.com>
To:	Tony Luck <tony.luck@...el.com>
CC:	Anton Vorontsov <anton@...msg.org>,
	Colin Cross <ccross@...roid.com>,
	"Tony Luck" <tony.luck@...el.com>,
	LKML <linux-kernel@...r.kernel.org>,
	peifeiyue <peifeiyue@...wei.com>,
	Marco Stornelli <marco.stornelli@...il.com>,
	"Anton Vorontsov" <anton.vorontsov@...aro.org>,
	Mark Salyzyn <salyzyn@...roid.com>,
	Sergiu Iordache <sergiu@...omium.org>,
	Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v2] fs/pstore: Optimization function ramoops_init_przs

On 2015/3/19 4:11, Kees Cook wrote:
> On Tue, Mar 17, 2015 at 6:41 PM, Wang Long <long.wanglong@...wei.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@...wei.com>
> 
> Thanks!
> 
> Acked-by: Kees Cook <keescook@...omium.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@...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@...r.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ