From: Amerigo Wang <amwang@redhat.com>
To: "Yu, Fenghua" <fenghua.yu@intel.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
"Luck, Tony" <tony.luck@intel.com>,
"'linux-ia64@vger.kernel.org'" <linux-ia64@vger.kernel.org>,
'Neil Horman' <nhorman@redhat.com>,
"'Eric W. Biederman'" <ebiederm@xmission.com>,
"'akpm@linux-foundation.org'" <akpm@linux-foundation.org>,
'Ingo Molnar' <mingo@elte.hu>,
'Anton Vorontsov' <avorontsov@ru.mvista.com>
Subject: Re: [Patch 2/7] x86: implement crashkernel=auto
Date: Thu, 06 Aug 2009 01:56:23 +0000 [thread overview]
Message-ID: <4A7A3847.6070406@redhat.com> (raw)
In-Reply-To: <A6AD88C3F2289247BE726C37303E1EB8B38E48D7@orsmsx505.amr.corp.intel.com>
Yu, Fenghua wrote:
>> +#ifdef CONFIG_KEXEC_AUTO_RESERVE
>> + if (strncmp(ck_cmdline, "auto", 4) = 0) {
>> + unsigned long long size;
>> + char tmp[32];
>> +
>> + size = arch_default_crash_size(system_ram);
>> + if (size != 0) {
>> + *crash_size = size;
>> + *crash_base = arch_default_crash_base();
>> + size = scnprintf(tmp, sizeof(tmp), "%luM@%luM",
>> + (unsigned long)(*crash_size)>>20,
>> + (unsigned long)(*crash_base)>>20);
>> + /* size can't be <= 4. */
>> + if (likely((size - 4 + strlen(cmdline))
>> + < COMMAND_LINE_SIZE - 1)) {
>> + memmove(ck_cmdline + size, ck_cmdline + 4,
>> + strlen(cmdline) - (ck_cmdline + 4 - cmdline)
>> + 1);
>> + memcpy(ck_cmdline, tmp, size);
>> + }
>>
>
> Here the variable "size" has two different meanings. First it used for crash size. Then its meaning is changed to buffer size in ck_cmdline. And types are different too. The type for crash size is unsigned long long. But scnprintf() return int.
>
> Could you use two variables to represent the two meanings for less confusion?
>
Sure, OK, will do.
Thanks.
WARNING: multiple messages have this Message-ID (diff)
From: Amerigo Wang <amwang@redhat.com>
To: "Yu, Fenghua" <fenghua.yu@intel.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
"Luck, Tony" <tony.luck@intel.com>,
"'linux-ia64@vger.kernel.org'" <linux-ia64@vger.kernel.org>,
"'Neil Horman'" <nhorman@redhat.com>,
"'Eric W. Biederman'" <ebiederm@xmission.com>,
"'akpm@linux-foundation.org'" <akpm@linux-foundation.org>,
"'Ingo Molnar'" <mingo@elte.hu>,
"'Anton Vorontsov'" <avorontsov@ru.mvista.com>
Subject: Re: [Patch 2/7] x86: implement crashkernel=auto
Date: Thu, 06 Aug 2009 09:56:23 +0800 [thread overview]
Message-ID: <4A7A3847.6070406@redhat.com> (raw)
In-Reply-To: <A6AD88C3F2289247BE726C37303E1EB8B38E48D7@orsmsx505.amr.corp.intel.com>
Yu, Fenghua wrote:
>> +#ifdef CONFIG_KEXEC_AUTO_RESERVE
>> + if (strncmp(ck_cmdline, "auto", 4) == 0) {
>> + unsigned long long size;
>> + char tmp[32];
>> +
>> + size = arch_default_crash_size(system_ram);
>> + if (size != 0) {
>> + *crash_size = size;
>> + *crash_base = arch_default_crash_base();
>> + size = scnprintf(tmp, sizeof(tmp), "%luM@%luM",
>> + (unsigned long)(*crash_size)>>20,
>> + (unsigned long)(*crash_base)>>20);
>> + /* size can't be <= 4. */
>> + if (likely((size - 4 + strlen(cmdline))
>> + < COMMAND_LINE_SIZE - 1)) {
>> + memmove(ck_cmdline + size, ck_cmdline + 4,
>> + strlen(cmdline) - (ck_cmdline + 4 - cmdline)
>> + 1);
>> + memcpy(ck_cmdline, tmp, size);
>> + }
>>
>
> Here the variable "size" has two different meanings. First it used for crash size. Then its meaning is changed to buffer size in ck_cmdline. And types are different too. The type for crash size is unsigned long long. But scnprintf() return int.
>
> Could you use two variables to represent the two meanings for less confusion?
>
Sure, OK, will do.
Thanks.
next prev parent reply other threads:[~2009-08-06 1:56 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-05 11:19 [Patch 0/7] Implement crashkernel=auto Amerigo Wang
2009-08-05 11:19 ` Amerigo Wang
2009-08-05 11:19 ` [Patch 1/7] x86: add CONFIG_KEXEC_AUTO_RESERVE Amerigo Wang
2009-08-05 11:19 ` Amerigo Wang
2009-08-05 13:41 ` Neil Horman
2009-08-05 13:41 ` Neil Horman
2009-08-05 14:45 ` Andi Kleen
2009-08-05 14:45 ` Andi Kleen
2009-08-05 20:07 ` Eric W. Biederman
2009-08-05 20:07 ` Eric W. Biederman
2009-08-06 1:55 ` Amerigo Wang
2009-08-06 1:55 ` Amerigo Wang
2009-08-06 7:15 ` Andi Kleen
2009-08-06 7:15 ` Andi Kleen
2009-08-06 7:44 ` Amerigo Wang
2009-08-06 7:44 ` Amerigo Wang
2009-08-06 7:56 ` Amerigo Wang
2009-08-06 7:56 ` Amerigo Wang
2009-08-05 11:19 ` [Patch 2/7] x86: implement crashkernel=auto Amerigo Wang
2009-08-05 11:19 ` Amerigo Wang
2009-08-05 13:43 ` Neil Horman
2009-08-05 13:43 ` Neil Horman
2009-08-06 1:45 ` Amerigo Wang
2009-08-06 1:45 ` Amerigo Wang
2009-08-05 22:51 ` Yu, Fenghua
2009-08-05 22:51 ` Yu, Fenghua
2009-08-06 1:56 ` Amerigo Wang [this message]
2009-08-06 1:56 ` Amerigo Wang
2009-08-05 11:19 ` [Patch 3/7] ia64: add CONFIG_KEXEC_AUTO_RESERVE Amerigo Wang
2009-08-05 11:19 ` Amerigo Wang
2009-08-05 13:49 ` Neil Horman
2009-08-05 13:49 ` Neil Horman
2009-08-05 11:19 ` [Patch 4/7] ia64: implement crashkernel=auto Amerigo Wang
2009-08-05 11:19 ` Amerigo Wang
2009-08-05 13:46 ` Neil Horman
2009-08-05 13:46 ` Neil Horman
2009-08-05 11:19 ` [Patch 5/7] powerpc: add CONFIG_KEXEC_AUTO_RESERVE Amerigo Wang
2009-08-05 11:19 ` Amerigo Wang
2009-08-05 13:49 ` Neil Horman
2009-08-05 13:49 ` Neil Horman
2009-08-05 11:20 ` [Patch 6/7] powerpc: implement crashkernel=auto Amerigo Wang
2009-08-05 11:20 ` Amerigo Wang
2009-08-05 13:50 ` Neil Horman
2009-08-05 13:50 ` Neil Horman
2009-08-05 11:20 ` [Patch 7/7] doc: update the kdump document Amerigo Wang
2009-08-05 11:20 ` Amerigo Wang
2009-08-05 13:33 ` [Patch 0/7] Implement crashkernel=auto Eric W. Biederman
2009-08-05 13:33 ` Eric W. Biederman
2009-08-05 14:04 ` Neil Horman
2009-08-05 14:04 ` Neil Horman
2009-08-05 22:57 ` Eric W. Biederman
2009-08-05 22:57 ` Eric W. Biederman
2009-08-06 2:05 ` Amerigo Wang
2009-08-06 2:05 ` Amerigo Wang
2009-08-06 2:47 ` Eric W. Biederman
2009-08-06 2:47 ` Eric W. Biederman
2009-08-06 3:39 ` Amerigo Wang
2009-08-06 3:39 ` Amerigo Wang
2009-08-06 3:51 ` Eric W. Biederman
2009-08-06 3:51 ` Eric W. Biederman
2009-08-06 5:57 ` Amerigo Wang
2009-08-06 5:57 ` Amerigo Wang
2009-08-06 6:14 ` Eric W. Biederman
2009-08-06 6:14 ` Eric W. Biederman
2009-08-06 6:37 ` Amerigo Wang
2009-08-06 6:37 ` Amerigo Wang
2009-08-06 8:35 ` Eric W. Biederman
2009-08-06 8:35 ` Eric W. Biederman
2009-08-06 8:47 ` Eric W. Biederman
2009-08-06 8:47 ` Eric W. Biederman
2009-08-06 9:04 ` Amerigo Wang
2009-08-06 9:04 ` Amerigo Wang
2009-08-07 19:13 ` Bernhard Walle
2009-08-07 19:13 ` Bernhard Walle
2009-08-06 9:11 ` Amerigo Wang
2009-08-06 9:11 ` Amerigo Wang
2009-08-07 19:50 ` Eric W. Biederman
2009-08-07 19:50 ` Eric W. Biederman
2009-08-07 19:50 ` Eric W. Biederman
2009-08-07 21:03 ` Andi Kleen
2009-08-07 21:03 ` Andi Kleen
2009-08-07 21:03 ` Andi Kleen
2009-08-07 21:26 ` Bernhard Walle
2009-08-07 21:26 ` Bernhard Walle
2009-08-07 21:26 ` Bernhard Walle
2009-08-07 22:06 ` Eric W. Biederman
2009-08-07 22:06 ` Eric W. Biederman
2009-08-07 22:06 ` Eric W. Biederman
2009-08-07 21:31 ` Bernhard Walle
2009-08-07 21:31 ` Bernhard Walle
2009-08-07 21:31 ` Bernhard Walle
2009-08-07 22:16 ` Eric W. Biederman
2009-08-07 22:16 ` Eric W. Biederman
2009-08-07 22:16 ` Eric W. Biederman
2009-08-10 3:11 ` Amerigo Wang
2009-08-10 3:11 ` Amerigo Wang
2009-08-10 3:11 ` Amerigo Wang
2009-08-06 1:39 ` Amerigo Wang
2009-08-06 1:39 ` Amerigo Wang
-- strict thread matches above, loose matches on Subject: below --
2009-08-06 6:19 [Patch 0/7] V2 " Amerigo Wang
2009-08-06 6:19 ` [Patch 2/7] x86: implement crashkernel=auto Amerigo Wang
2009-08-06 6:19 ` Amerigo Wang
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=4A7A3847.6070406@redhat.com \
--to=amwang@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=avorontsov@ru.mvista.com \
--cc=ebiederm@xmission.com \
--cc=fenghua.yu@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nhorman@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.