alistair23-linux/include/linux/pci-ep-cfs.h
Gustavo Pimentel 32b313ce9d PCI: endpoint: Use "NULL" instead of "0" as a NULL pointer
When returning a NULL pointer, use "NULL" instead of "0".

Fixes sparse warning given by executing "make C=2 drivers/pci/":

  CHECK   drivers/pci/endpoint/pci-epc-core.c
   drivers/pci/endpoint/pci-epc-core.c: note: in included file:
   ./include/linux/pci-ep-cfs.h:22:16: warning:
   Using plain integer as NULL pointer
  CHECK   drivers/pci/endpoint/pci-epf-core.c
   drivers/pci/endpoint/pci-epf-core.c: note: in included file:
   ./include/linux/pci-ep-cfs.h:31:16: warning:
   Using plain integer as NULL pointer

Link: https://lore.kernel.org/r/80895f7465719edb3aa259e907acc4bc3217945c.1600378209.git.gustavo.pimentel@synopsys.com
Reported-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Joao Pinto <jpinto@synopsys.com>
2020-09-17 16:44:03 -05:00

39 lines
957 B
C

/* SPDX-License-Identifier: GPL-2.0+ */
/**
* PCI Endpoint ConfigFS header file
*
* Copyright (C) 2017 Texas Instruments
* Author: Kishon Vijay Abraham I <kishon@ti.com>
*/
#ifndef __LINUX_PCI_EP_CFS_H
#define __LINUX_PCI_EP_CFS_H
#include <linux/configfs.h>
#ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
struct config_group *pci_ep_cfs_add_epc_group(const char *name);
void pci_ep_cfs_remove_epc_group(struct config_group *group);
struct config_group *pci_ep_cfs_add_epf_group(const char *name);
void pci_ep_cfs_remove_epf_group(struct config_group *group);
#else
static inline struct config_group *pci_ep_cfs_add_epc_group(const char *name)
{
return NULL;
}
static inline void pci_ep_cfs_remove_epc_group(struct config_group *group)
{
}
static inline struct config_group *pci_ep_cfs_add_epf_group(const char *name)
{
return NULL;
}
static inline void pci_ep_cfs_remove_epf_group(struct config_group *group)
{
}
#endif
#endif /* __LINUX_PCI_EP_CFS_H */