[Skiboot] [PATCH 1/6] pci: Move logging macros to pci.h

Alistair Popple alistair at popple.id.au
Mon Jul 30 16:40:04 AEST 2018


Reviewed-by: Alistair Popple <alistair at popple.id.au>

On Friday, 27 July 2018 9:47:37 AM AEST Reza Arbab wrote:
> Move the PCI{TRACE,DBG,NOTICE,ERR} logging macros from pci.c to pci.h so
> they can be used in other files.
> 
> Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
> ---
>  core/pci.c    | 21 ---------------------
>  include/pci.h | 21 +++++++++++++++++++++
>  2 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/core/pci.c b/core/pci.c
> index 109459b..6ba6eda 100644
> --- a/core/pci.c
> +++ b/core/pci.c
> @@ -29,27 +29,6 @@
>  static struct phb *phbs[MAX_PHB_ID];
>  int last_phb_id = 0;
>  
> -#define PCITRACE(_p, _bdfn, fmt, a...) \
> -	prlog(PR_TRACE, "PHB#%04x:%02x:%02x.%x " fmt,	\
> -	      (_p)->opal_id,				\
> -	      ((_bdfn) >> 8) & 0xff,			\
> -	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> -#define PCIDBG(_p, _bdfn, fmt, a...) \
> -	prlog(PR_DEBUG, "PHB#%04x:%02x:%02x.%x " fmt,	\
> -	      (_p)->opal_id,				\
> -	      ((_bdfn) >> 8) & 0xff,			\
> -	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> -#define PCINOTICE(_p, _bdfn, fmt, a...) \
> -	prlog(PR_NOTICE, "PHB#%04x:%02x:%02x.%x " fmt,	\
> -	      (_p)->opal_id,				\
> -	      ((_bdfn) >> 8) & 0xff,			\
> -	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> -#define PCIERR(_p, _bdfn, fmt, a...) \
> -	prlog(PR_ERR, "PHB#%04x:%02x:%02x.%x " fmt,	\
> -	      (_p)->opal_id,				\
> -	      ((_bdfn) >> 8) & 0xff,			\
> -	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> -
>  /*
>   * Generic PCI utilities
>   */
> diff --git a/include/pci.h b/include/pci.h
> index 253dbd8..c6aa664 100644
> --- a/include/pci.h
> +++ b/include/pci.h
> @@ -23,6 +23,27 @@
>  #include <bitmap.h>
>  #include <ccan/list/list.h>
>  
> +#define PCITRACE(_p, _bdfn, fmt, a...) \
> +	prlog(PR_TRACE, "PHB#%04x:%02x:%02x.%x " fmt,	\
> +	      (_p)->opal_id,				\
> +	      ((_bdfn) >> 8) & 0xff,			\
> +	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> +#define PCIDBG(_p, _bdfn, fmt, a...) \
> +	prlog(PR_DEBUG, "PHB#%04x:%02x:%02x.%x " fmt,	\
> +	      (_p)->opal_id,				\
> +	      ((_bdfn) >> 8) & 0xff,			\
> +	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> +#define PCINOTICE(_p, _bdfn, fmt, a...) \
> +	prlog(PR_NOTICE, "PHB#%04x:%02x:%02x.%x " fmt,	\
> +	      (_p)->opal_id,				\
> +	      ((_bdfn) >> 8) & 0xff,			\
> +	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> +#define PCIERR(_p, _bdfn, fmt, a...) \
> +	prlog(PR_ERR, "PHB#%04x:%02x:%02x.%x " fmt,	\
> +	      (_p)->opal_id,				\
> +	      ((_bdfn) >> 8) & 0xff,			\
> +	      ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a)
> +
>  struct pci_device;
>  struct pci_cfg_reg_filter;
>  
> 




More information about the Skiboot mailing list