projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
736bcdd
)
powerpc/pseries/lparcfg: Fix display of Maximum Memory
author
Michael Bringmann
<mwb@linux.ibm.com>
Wed, 15 Jan 2020 14:53:59 +0000
(08:53 -0600)
committer
Michael Ellerman
<mpe@ellerman.id.au>
Sat, 25 Jan 2020 13:11:37 +0000
(
00:11
+1100)
Correct overflow problem in calculation and display of Maximum Memory
value to syscfg.
Signed-off-by: Michael Bringmann <mwb@linux.ibm.com>
[mpe: Only n_lmbs needs casting to unsigned long]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link:
https://lore.kernel.org/r/5577aef8-1d5a-ca95-ff0a-9c7b5977e5bf@linux.ibm.com
arch/powerpc/platforms/pseries/lparcfg.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/platforms/pseries/lparcfg.c
b/arch/powerpc/platforms/pseries/lparcfg.c
index e33e8bc4b69bd361980da19e4ac3e8f15d299da7..38c306551f76b64e380ea8cae571d5295fc9de03 100644
(file)
--- a/
arch/powerpc/platforms/pseries/lparcfg.c
+++ b/
arch/powerpc/platforms/pseries/lparcfg.c
@@
-435,10
+435,10
@@
static void maxmem_data(struct seq_file *m)
{
unsigned long maxmem = 0;
- maxmem += drmem_info->n_lmbs * drmem_info->lmb_size;
+ maxmem +=
(unsigned long)
drmem_info->n_lmbs * drmem_info->lmb_size;
maxmem += hugetlb_total_pages() * PAGE_SIZE;
- seq_printf(m, "MaxMem=%l
d
\n", maxmem);
+ seq_printf(m, "MaxMem=%l
u
\n", maxmem);
}
static int pseries_lparcfg_data(struct seq_file *m, void *v)