s390/kexec: silence -Warray-bounds warning
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 6 Apr 2022 12:06:27 +0000 (14:06 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Apr 2022 10:36:54 +0000 (12:36 +0200)
Just use absolute_pointer() like e.g. in commit 545c272232ca ("alpha:
Silence -Warray-bounds warnings") to get rid of this warning:

arch/s390/kernel/machine_kexec.c:59:9: warning: ‘memcpy’ offset [0, 511] is out of the bounds [0, 0] [-Warray-bounds]

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/machine_kexec.c

index b2ef014..6ebf02e 100644 (file)
@@ -54,7 +54,7 @@ static void __do_machine_kdump(void *image)
         * This need to be done *after* s390_reset_system set the
         * prefix register of this CPU to zero
         */
-       memcpy((void *) __LC_FPREGS_SAVE_AREA,
+       memcpy(absolute_pointer(__LC_FPREGS_SAVE_AREA),
               (void *)(prefix + __LC_FPREGS_SAVE_AREA), 512);
 
        __load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA);