From: Chao Fan <fanc.fnst@cn.fujitsu.com>
To: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>, <hpa@zytor.com>,
<tglx@linutronix.de>, <mingo@redhat.com>, <bhe@redhat.com>,
<keescook@chromium.org>, <indou.takao@jp.fujitsu.com>,
<caoj.fnst@cn.fujitsu.com>
Subject: Re: [PATCH 4/4] kaslr: clean up a useless variable and some usless space
Date: Fri, 20 Oct 2017 12:10:37 +0800 [thread overview]
Message-ID: <20171020041037.GE5635@localhost.localdomain> (raw)
In-Reply-To: <ce1130c2-18fa-652b-5582-37d5dce73b95@cn.fujitsu.com>
On Fri, Oct 20, 2017 at 11:19:48AM +0800, Dou Liyang wrote:
>Hi Chao,
>
>At 10/19/2017 06:02 PM, Chao Fan wrote:
>> There are two same variable "rc" in this function. One is in the
>> circulation, the other is out of the circulation. The one out will never
>> be used, so drop it.
>>
>> Signed-off-by: Chao Fan <fanc.fnst@cn.fujitsu.com>
>> ---
>> arch/x86/boot/compressed/kaslr.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
>> index 22330cbe8515..8a33ed82fd0b 100644
>> --- a/arch/x86/boot/compressed/kaslr.c
>> +++ b/arch/x86/boot/compressed/kaslr.c
>> @@ -198,7 +198,6 @@ static int parse_immovable_mem(char *p,
>> static void mem_avoid_memmap(char *str)
>> {
>> static int i;
>> - int rc;
>>
>> if (i >= MAX_MEMMAP_REGIONS)
>> return;
Hi Dou-san,
>
>Seems it is redundant too,
Thanks for your suggestion.
Thanks,
Chao Fan
>
>Thanks,
> dou.
>
>> @@ -277,7 +276,7 @@ static int handle_mem_memmap(void)
>> return 0;
>>
>> tmp_cmdline = malloc(len + 1);
>> - if (!tmp_cmdline )
>> + if (!tmp_cmdline)
>> error("Failed to allocate space for tmp_cmdline");
>>
>> memcpy(tmp_cmdline, args, len);
>> @@ -423,7 +422,7 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size,
>> cmd_line |= boot_params->hdr.cmd_line_ptr;
>> /* Calculate size of cmd_line. */
>> ptr = (char *)(unsigned long)cmd_line;
>> - for (cmd_line_size = 0; ptr[cmd_line_size++]; )
>> + for (cmd_line_size = 0; ptr[cmd_line_size++];)
>> ;
>> mem_avoid[MEM_AVOID_CMDLINE].start = cmd_line;
>> mem_avoid[MEM_AVOID_CMDLINE].size = cmd_line_size;
>>
next prev parent reply other threads:[~2017-10-20 4:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 10:02 [PATCH 0/4] kaslr: extend movable_node to movable_node=nn[KMG]@ss[KMG] Chao Fan
2017-10-19 10:02 ` [PATCH 1/4] kaslr: parse the extended movable_node=nn[KMG]@ss[KMG] Chao Fan
2017-10-20 3:04 ` Dou Liyang
2017-10-20 3:22 ` Chao Fan
2017-10-20 3:41 ` Dou Liyang
2017-10-20 3:44 ` Chao Fan
2017-10-20 5:33 ` Dou Liyang
2017-10-20 9:34 ` Chao Fan
2017-10-19 10:02 ` [PATCH 2/4] kaslr: select the memory region in immovable node to process Chao Fan
2017-10-20 3:17 ` Dou Liyang
2017-10-20 3:41 ` Chao Fan
2017-10-20 6:05 ` Dou Liyang
2017-10-19 10:02 ` [PATCH 3/4] document: change the document for the extended movable_node Chao Fan
2017-10-19 10:02 ` [PATCH 4/4] kaslr: clean up a useless variable and some usless space Chao Fan
2017-10-20 3:19 ` Dou Liyang
2017-10-20 4:10 ` Chao Fan [this message]
2017-10-20 2:37 ` [PATCH 0/4] kaslr: extend movable_node to movable_node=nn[KMG]@ss[KMG] Dou Liyang
2017-10-20 2:53 ` Chao Fan
2017-10-20 3:37 ` Dou Liyang
2017-10-20 3:46 ` Chao Fan
2017-10-20 6:41 ` Dou Liyang
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=20171020041037.GE5635@localhost.localdomain \
--to=fanc.fnst@cn.fujitsu.com \
--cc=bhe@redhat.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=douly.fnst@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=indou.takao@jp.fujitsu.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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