Skip to content

Commit de3fa84

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390/mm: fix compile for PAGE_DEFAULT_KEY != 0
The usual problem for code that is ifdef'ed out is that it doesn't compile after a while. That's also the case for the storage key initialisation code, if it would be used (set PAGE_DEFAULT_KEY to something not zero): ./arch/s390/include/asm/page.h: In function 'storage_key_init_range': ./arch/s390/include/asm/page.h:36:2: error: implicit declaration of function '__storage_key_init_range' Since the code itself has been useful for debugging purposes several times, remove the ifdefs and make sure the code gets compiler coverage. The cost for this is eight bytes. Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]>
1 parent 86d18a5 commit de3fa84

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

arch/s390/include/asm/page.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
#include <asm/setup.h>
3131
#ifndef __ASSEMBLY__
3232

33+
void __storage_key_init_range(unsigned long start, unsigned long end);
34+
3335
static inline void storage_key_init_range(unsigned long start, unsigned long end)
3436
{
35-
#if PAGE_DEFAULT_KEY
36-
__storage_key_init_range(start, end);
37-
#endif
37+
if (PAGE_DEFAULT_KEY)
38+
__storage_key_init_range(start, end);
3839
}
3940

4041
#define clear_page(page) memset((page), 0, PAGE_SIZE)

arch/s390/mm/pageattr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <asm/pgtable.h>
1111
#include <asm/page.h>
1212

13-
#if PAGE_DEFAULT_KEY
1413
static inline unsigned long sske_frame(unsigned long addr, unsigned char skey)
1514
{
1615
asm volatile(".insn rrf,0xb22b0000,%[skey],%[addr],9,0"
@@ -22,6 +21,8 @@ void __storage_key_init_range(unsigned long start, unsigned long end)
2221
{
2322
unsigned long boundary, size;
2423

24+
if (!PAGE_DEFAULT_KEY)
25+
return;
2526
while (start < end) {
2627
if (MACHINE_HAS_EDAT1) {
2728
/* set storage keys for a 1MB frame */
@@ -38,7 +39,6 @@ void __storage_key_init_range(unsigned long start, unsigned long end)
3839
start += PAGE_SIZE;
3940
}
4041
}
41-
#endif
4242

4343
#ifdef CONFIG_PROC_FS
4444
atomic_long_t direct_pages_count[PG_DIRECT_MAP_MAX];

0 commit comments

Comments
 (0)