Skip to contentSkip to conversation

NTB: EPF: set pointer addr to null using NULL rather than 0

PATCH In review Colin Ian King 3 participants 3 messages Jun 23, 2022 – Aug 12, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NTB: EPF: set pointer addr to null using NULL rather than 0

The pointer addr is being set to null using 0. Use NULL instead.

Cleans up sparse warning:
warning: Using plain integer as NULL pointer

---
 drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-vntb.c +1 -1
index ebf7e243eefa..fb31c868af6a 100644
@@ -605,7 +605,7 @@ static int epf_ntb_mw_bar_init(struct epf_ntb *ntb)
 
 		ntb->epf->bar[barno].barno = barno;
 		ntb->epf->bar[barno].size = size;
-		ntb->epf->bar[barno].addr = 0;
+		ntb->epf->bar[barno].addr = NULL;
 		ntb->epf->bar[barno].phys_addr = 0;
 		ntb->epf->bar[barno].flags |= upper_32_bits(size) ?
 				PCI_BASE_ADDRESS_MEM_TYPE_64 :
Signature · 1 line
2.35.3
#1 lore raw
Quoted 4 lines · Colin Ian King

The pointer addr is being set to null using 0. Use NULL instead.

Cleans up sparse warning:
warning: Using plain integer as NULL pointer

Another one for Jon; fixes this commit:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ff32fac00d97

Quoted 21 lines
---
 drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-vntb.c +1 -1
index ebf7e243eefa..fb31c868af6a 100644
@@ -605,7 +605,7 @@ static int epf_ntb_mw_bar_init(struct epf_ntb *ntb)
 
 		ntb->epf->bar[barno].barno = barno;
 		ntb->epf->bar[barno].size = size;
-		ntb->epf->bar[barno].addr = 0;
+		ntb->epf->bar[barno].addr = NULL;
 		ntb->epf->bar[barno].phys_addr = 0;
 		ntb->epf->bar[barno].flags |= upper_32_bits(size) ?
 				PCI_BASE_ADDRESS_MEM_TYPE_64 :
Signature · 1 line
2.35.3
maintainer
#2 lore raw
Quoted 21 lines · Bjorn Helgaas
Quoted 4 lines · Colin Ian King

The pointer addr is being set to null using 0. Use NULL instead.

Cleans up sparse warning:
warning: Using plain integer as NULL pointer

Another one for Jon; fixes this commit:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ff32fac00d97

Quoted 11 lines
---
 drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-vntb.c +0 -0
index ebf7e243eefa..fb31c868af6a 100644
@@ -605,7 +605,7 @@ static int epf_ntb_mw_bar_init(struct epf_ntb *ntb)
 
Quoted 10 lines
Quoted 10 lines
drivers/pci/endpoint/functions/pci-epf-vntb.c +1 -1
 		ntb->epf->bar[barno].barno = barno;
 		ntb->epf->bar[barno].size = size;
-		ntb->epf->bar[barno].addr = 0;
+		ntb->epf->bar[barno].addr = NULL;
 		ntb->epf->bar[barno].phys_addr = 0;
 		ntb->epf->bar[barno].flags |= upper_32_bits(size) ?
 				PCI_BASE_ADDRESS_MEM_TYPE_64 :
Signature · 1 line
2.35.3

Sorry for the extremely long delay in response. This series is in my ntb branch and will be in my pull request for v5.20 which should be going out later today.

Thanks,
Jon