Skip to content

Commit e8c924a

Browse files
rosatomjfrankjaa
authored andcommitted
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: kernel test robot <[email protected]> Signed-off-by: Matthew Rosato <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Borntraeger <[email protected]> Signed-off-by: Janosch Frank <[email protected]>
1 parent 521a547 commit e8c924a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/s390/kvm/pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int zpci_setup_aipb(u8 nisc)
5858
if (!zpci_aipb)
5959
return -ENOMEM;
6060

61-
aift->sbv = airq_iv_create(ZPCI_NR_DEVICES, AIRQ_IV_ALLOC, 0);
61+
aift->sbv = airq_iv_create(ZPCI_NR_DEVICES, AIRQ_IV_ALLOC, NULL);
6262
if (!aift->sbv) {
6363
rc = -ENOMEM;
6464
goto free_aipb;
@@ -373,7 +373,7 @@ static int kvm_s390_pci_aif_disable(struct zpci_dev *zdev, bool force)
373373
gaite->gisc = 0;
374374
gaite->aisbo = 0;
375375
gaite->gisa = 0;
376-
aift->kzdev[zdev->aisb] = 0;
376+
aift->kzdev[zdev->aisb] = NULL;
377377
/* Clear zdev info */
378378
airq_iv_free_bit(aift->sbv, zdev->aisb);
379379
airq_iv_release(zdev->aibv);

arch/s390/kvm/pci.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ extern struct zpci_aift *aift;
4646
static inline struct kvm *kvm_s390_pci_si_to_kvm(struct zpci_aift *aift,
4747
unsigned long si)
4848
{
49-
if (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || aift->kzdev == 0 ||
50-
aift->kzdev[si] == 0)
51-
return 0;
49+
if (!IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM) || !aift->kzdev ||
50+
!aift->kzdev[si])
51+
return NULL;
5252
return aift->kzdev[si]->kvm;
5353
};
5454

0 commit comments

Comments
 (0)