mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
powerpc/pseries/lparcfg: Fix display of Maximum Memory
[ Upstream commit f1dbc1c5c7
]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4113271807
commit
93df1b23b1
1 changed files with 2 additions and 2 deletions
|
@ -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=%ld\n", maxmem);
|
||||
seq_printf(m, "MaxMem=%lu\n", maxmem);
|
||||
}
|
||||
|
||||
static int pseries_lparcfg_data(struct seq_file *m, void *v)
|
||||
|
|
Loading…
Reference in a new issue