summaryrefslogtreecommitdiff
path: root/tools/lib/api/debug.c
blob: 7708f0558e8c302e899685cf4ec4d3c972129fad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdarg.h>
#include "debug.h"
#include "debug-internal.h"

static int __base_pr(const char *format, ...)
{
	va_list args;
	int err;

	va_start(args, format);
	err = vfprintf(stderr, format, args);
	va_end(args);
	return err;
}

libapi_print_fn_t __pr_warn    = __base_pr;
libapi_print_fn_t __pr_info    = __base_pr;
libapi_print_fn_t __pr_debug;

void libapi_set_print(libapi_print_fn_t warn,
		      libapi_print_fn_t info,
		      libapi_print_fn_t debug)
{
	__pr_warn    = warn;
	__pr_info    = info;
	__pr_debug   = debug;
}
00 committerDavid S. Miller <davem@davemloft.net>2020-02-17 14:35:23 -0800 commitb7683155517c09c7e0f9d791eaab6dab3b4b2477 (patch) treecea3ca29b8db6619ce2b9f90695c919f0f3d1fd1 /drivers/net/ethernet/netronome/nfp parentbd706ff8ea2b6e2d3f21f0863b2fc42f860f8ba2 (diff)
sfc: only schedule asynchronous filter work if needed
Prevent excessive CPU time spent running a workitem with nothing to do. We avoid any races by keeping the same check in efx_filter_rfs_expire(). Suggested-by: Martin Habets <mhabets@solarflare.com> Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp')