RE: [Patch 2/7] x86: implement crashkernel=auto
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "'Amerigo Wang'" <amwang@xxxxxxxxxx>, "'linux-kernel@xxxxxxxxxxxxxxx'" <linux-kernel@xxxxxxxxxxxxxxx>
- Subject: RE: [Patch 2/7] x86: implement crashkernel=auto
- From: "Yu, Fenghua" <fenghua.yu@xxxxxxxxx>
- Date: Wed, 5 Aug 2009 15:51:42 -0700
- Accept-language: en-US
- Acceptlanguage: en-US
- Cc: "Luck, Tony" <tony.luck@xxxxxxxxx>, "'linux-ia64@xxxxxxxxxxxxxxx'" <linux-ia64@xxxxxxxxxxxxxxx>, "'Neil Horman'" <nhorman@xxxxxxxxxx>, "'Eric W. Biederman'" <ebiederm@xxxxxxxxxxxx>, "'akpm@xxxxxxxxxxxxxxxxxxxx'" <akpm@xxxxxxxxxxxxxxxxxxxx>, "'Ingo Molnar'" <mingo@xxxxxxx>, "'Anton Vorontsov'" <avorontsov@xxxxxxxxxxxxx>
- In-reply-to: <20090805112142.6552.18373.sendpatchset@xxxxxxxxxxxxxxxxxxxxx>
- List-id: <linux-ia64.vger.kernel.org>
- References: <20090805112123.6552.73574.sendpatchset@xxxxxxxxxxxxxxxxxxxxx> <20090805112142.6552.18373.sendpatchset@xxxxxxxxxxxxxxxxxxxxx>
- Thread-index: AcoVv4rcnRYU46vGScaeZ9LdyLAKMQAXqxrQ
- Thread-topic: [Patch 2/7] x86: implement crashkernel=auto
>+#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?
Thanks.
-Fenghua
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]