Skip to content

Commit

Permalink
s390/mem_detect: use unsigned longs
Browse files Browse the repository at this point in the history
The memory detection code historically had to use unsigned long long
since the machine reported the true memory size (>4GB) even if the
virtual machine was running in ESA/390 mode.

Since the old code is gone use unsigned long everywhere and also get
rid of an unused ADDR2G define.

(this patch converts all long longs within sclp_info to longs)

There are many more possible conversions, however that can be done if
somebody touches the corresponding code.  Since people started to
convert unrelated long types to long longs because of the types within
struct sclp_info convert this now.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Jan 11, 2016
1 parent cb95178 commit 423d5b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions arch/s390/include/asm/sclp.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ struct sclp_info {
unsigned int mtid;
unsigned int mtid_cp;
unsigned int mtid_prev;
unsigned long long rzm;
unsigned long long rnmax;
unsigned long long hamax;
unsigned long rzm;
unsigned long rnmax;
unsigned long hamax;
unsigned int max_cores;
unsigned long hsa_size;
unsigned long long facilities;
unsigned long facilities;
};
extern struct sclp_info sclp;

Expand Down
7 changes: 2 additions & 5 deletions arch/s390/mm/mem_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include <asm/sclp.h>
#include <asm/setup.h>

#define ADDR2G (1ULL << 31)

#define CHUNK_READ_WRITE 0
#define CHUNK_READ_ONLY 1

Expand All @@ -27,15 +25,14 @@ static inline void memblock_physmem_add(phys_addr_t start, phys_addr_t size)

void __init detect_memory_memblock(void)
{
unsigned long long memsize, rnmax, rzm;
unsigned long addr, size;
unsigned long memsize, rnmax, rzm, addr, size;
int type;

rzm = sclp.rzm;
rnmax = sclp.rnmax;
memsize = rzm * rnmax;
if (!rzm)
rzm = 1ULL << 17;
rzm = 1UL << 17;
max_physmem_end = memsize;
addr = 0;
/* keep memblock lists close to the kernel */
Expand Down

0 comments on commit 423d5b3

Please sign in to comment.