Commit 9386ebcc authored by Dylan Muller's avatar Dylan Muller Committed by David S. Miller
Browse files

nfp: update nfp_X logging definitions



Previously it was not possible to determine which code path was responsible
for generating a certain message after a call to the nfp_X messaging
definitions for cases of duplicate strings. We therefore modify nfp_err,
nfp_warn, nfp_info, nfp_dbg and nfp_printk to print the corresponding file
and line number where the nfp_X definition is used.

Signed-off-by: default avatarDylan Muller <dylan.muller@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 735cb16b
Loading
Loading
Loading
Loading
+20 −6
Original line number Diff line number Diff line
@@ -13,23 +13,37 @@
#include <linux/ctype.h>
#include <linux/types.h>
#include <linux/sizes.h>
#include <linux/stringify.h>

#ifndef NFP_SUBSYS
#define NFP_SUBSYS "nfp"
#endif

#define nfp_err(cpp, fmt, args...) \
#define string_format(x) __FILE__ ":" __stringify(__LINE__) ": " x

#define __nfp_err(cpp, fmt, args...) \
	dev_err(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args)
#define nfp_warn(cpp, fmt, args...) \
#define __nfp_warn(cpp, fmt, args...) \
	dev_warn(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args)
#define nfp_info(cpp, fmt, args...) \
#define __nfp_info(cpp, fmt, args...) \
	dev_info(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args)
#define nfp_dbg(cpp, fmt, args...) \
#define __nfp_dbg(cpp, fmt, args...) \
	dev_dbg(nfp_cpp_device(cpp)->parent, NFP_SUBSYS ": " fmt, ## args)
#define nfp_printk(level, cpp, fmt, args...) \
#define __nfp_printk(level, cpp, fmt, args...) \
	dev_printk(level, nfp_cpp_device(cpp)->parent,  \
		   NFP_SUBSYS ": " fmt, ## args)

#define nfp_err(cpp, fmt, args...) \
	__nfp_err(cpp, string_format(fmt), ## args)
#define nfp_warn(cpp, fmt, args...) \
	__nfp_warn(cpp, string_format(fmt), ## args)
#define nfp_info(cpp, fmt, args...) \
	__nfp_info(cpp, string_format(fmt), ## args)
#define nfp_dbg(cpp, fmt, args...) \
	__nfp_dbg(cpp, string_format(fmt), ## args)
#define nfp_printk(level, cpp, fmt, args...) \
	__nfp_printk(level, cpp, string_format(fmt), ## args)

#define PCI_64BIT_BAR_COUNT             3

#define NFP_CPP_NUM_TARGETS             16