Re: [kvm-unit-tests PATCH v2 4/6] s390x: fix compile of interrupt.c

Claudio Imbrenda
2023-05-16T17:30:49Z

On Tue, 16 May 2023 15:04:54 +0200
Nico Boehr <nrb@linux.ibm.com> wrote:

> A future commit will include interrupt.h from sie.c.

can you merge this into that future commit that will require it?

>
> Since interrupt.h includes mem.h, but sie.c does not include facility.h,
> this will lead to the following compile error:
>
> In file included from lib/s390x/interrupt.c:10:
> /home/nrb/kvm-unit-tests/lib/asm/mem.h: In function ‘set_storage_key_mb’:
> /home/nrb/kvm-unit-tests/lib/asm/mem.h:42:16: error: implicit declaration of function ‘test_facility’ [-Werror=implicit-function-declaration]
> 42 | assert(test_facility(8));
> | ^~~~~~~~~~~~~
>
> Add the missing include in interrupt.h
>
> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> ---
> lib/s390x/asm/mem.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/s390x/asm/mem.h b/lib/s390x/asm/mem.h
> index 64ef59b546a4..94d58c34f53f 100644
> --- a/lib/s390x/asm/mem.h
> +++ b/lib/s390x/asm/mem.h
> @@ -8,6 +8,7 @@
> #ifndef _ASMS390X_MEM_H_
> #define _ASMS390X_MEM_H_
> #include <asm/arch_def.h>
> +#include <asm/facility.h>
>
> /* create pointer while avoiding compiler warnings */
> #define OPAQUE_PTR(x) ((void *)(((uint64_t)&lowcore) + (x)))