s390/lgr: use simple assignment instead of memcpy
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 3 Feb 2022 09:56:07 +0000 (10:56 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Sun, 6 Feb 2022 22:31:29 +0000 (23:31 +0100)
It is quite pointless to use memcpy to copy two bytes, besides that
this construct will also partially remove type and size sanity checks.

Therefore simply use an assignment.

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

index 3b89597..6652e54 100644 (file)
@@ -88,8 +88,7 @@ static void lgr_stsi_2_2_2(struct lgr_info *lgr_info)
        if (stsi(si, 2, 2, 2))
                return;
        cpascii(lgr_info->name, si->name, sizeof(si->name));
-       memcpy(&lgr_info->lpar_number, &si->lpar_number,
-              sizeof(lgr_info->lpar_number));
+       lgr_info->lpar_number = si->lpar_number;
 }
 
 /*