OSDN Git Service

KVM: s390: Pass initialized arg even if unused
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Thu, 25 Aug 2022 19:25:40 +0000 (21:25 +0200)
committerJanosch Frank <frankja@linux.ibm.com>
Wed, 21 Sep 2022 14:18:35 +0000 (16:18 +0200)
commitb3cefd6bf16e7234ffbd4209f6083060f4e35f59
tree146ea1af72f66beb80801cb6b8c0974765704c87
parente8c924a4fb6ef9a224423fb5542954acbda234b3
KVM: s390: Pass initialized arg even if unused

This silences smatch warnings reported by kbuild bot:
arch/s390/kvm/gaccess.c:859 guest_range_to_gpas() error: uninitialized symbol 'prot'.
arch/s390/kvm/gaccess.c:1064 access_guest_with_key() error: uninitialized symbol 'prot'.

This is because it cannot tell that the value is not used in this case.
The trans_exc* only examine prot if code is PGM_PROTECTION.
Pass a dummy value for other codes.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20220825192540.1560559-1-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
arch/s390/kvm/gaccess.c