Commit e8c924a4 authored by Matthew Rosato's avatar Matthew Rosato Committed by Janosch Frank

KVM: s390: pci: fix plain integer as NULL pointer warnings

Fix some sparse warnings that a plain integer 0 is being used instead of
NULL.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
Link: https://lore.kernel.org/r/20220915175514.167899-1-mjrosato@linux.ibm.comSigned-off-by: default avatarChristian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
parent 521a547c
...@@ -58,7 +58,7 @@ static int zpci_setup_aipb(u8 nisc) ...@@ -58,7 +58,7 @@ static int zpci_setup_aipb(u8 nisc)
if (!zpci_aipb) if (!zpci_aipb)
return -ENOMEM; return -ENOMEM;
aift->sbv = airq_iv_create(ZPCI_NR_DEVICES, AIRQ_IV_ALLOC, 0); aift->sbv = airq_iv_create(ZPCI_NR_DEVICES, AIRQ_IV_ALLOC, NULL);
if (!aift->sbv) { if (!aift->sbv) {
rc = -ENOMEM; rc = -ENOMEM;
goto free_aipb; goto free_aipb;
...@@ -373,7 +373,7 @@ static int kvm_s390_pci_aif_disable(struct zpci_dev *zdev, bool force) ...@@ -373,7 +373,7 @@ static int kvm_s390_pci_aif_disable(struct zpci_dev *zdev, bool force)
gaite->gisc = 0; gaite->gisc = 0;
gaite->aisbo = 0; gaite->aisbo = 0;
gaite->gisa = 0; gaite->gisa = 0;
aift->kzdev[zdev->aisb] = 0; aift->kzdev[zdev->aisb] = NULL;
/* Clear zdev info */ /* Clear zdev info */
airq_iv_free_bit(aift->sbv, zdev->aisb); airq_iv_free_bit(aift->sbv, zdev->aisb);
airq_iv_release(zdev->aibv); airq_iv_release(zdev->aibv);
......
...@@ -46,9 +46,9 @@ extern struct zpci_aift *aift; ...@@ -46,9 +46,9 @@ extern struct zpci_aift *aift;
static inline struct kvm *kvm_s390_pci_si_to_kvm(struct zpci_aift *aift, static inline struct kvm *kvm_s390_pci_si_to_kvm(struct zpci_aift *aift,
unsigned long si) unsigned long si)
{ {
if (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || aift->kzdev == 0 || if (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || !aift->kzdev ||
aift->kzdev[si] == 0) !aift->kzdev[si])
return 0; return NULL;
return aift->kzdev[si]->kvm; return aift->kzdev[si]->kvm;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment