linux/drivers/net/wan/lmc/lmc_debug.h
Sebastian Andrzej Siewior c2f8c90079 net: wan/lmc: Remove lmc_trace()
lmc_trace() was first introduced in commit e7a392d5158af ("Import
2.3.99pre6-5") and was not touched ever since.

The reason for looking at this was to get rid of the in_interrupt() usage,
but while looking at it the following observations were made:

 - At least lmc_get_stats() (->ndo_get_stats()) is invoked with disabled
   preemption which is not detected by the in_interrupt() check, which
   would cause schedule() to be called from invalid context.

 - The code is hidden behind #ifdef LMC_TRACE which is not defined within
   the kernel and wasn't at the time it was introduced.

 - Three jiffies don't match 50ms. msleep() would be a better match which
   would also avoid the schedule() invocation. But why have it to begin
   with?

 - Nobody would do something like this today. Either netdev_dbg() or
   trace_printk() or a trace event would be used.  If only the functions
   related to this driver are interesting then ftrace can be used with
   filtering.

As it is obviously broken for years, simply remove it.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-09-29 14:02:54 -07:00

53 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LMC_DEBUG_H_
#define _LMC_DEBUG_H_
#ifdef DEBUG
#ifdef LMC_PACKET_LOG
#define LMC_CONSOLE_LOG(x,y,z) lmcConsoleLog((x), (y), (z))
#else
#define LMC_CONSOLE_LOG(x,y,z)
#endif
#else
#define LMC_CONSOLE_LOG(x,y,z)
#endif
/* Debug --- Event log definitions --- */
/* EVENTLOGSIZE*EVENTLOGARGS needs to be a power of 2 */
#define LMC_EVENTLOGSIZE 1024 /* number of events in eventlog */
#define LMC_EVENTLOGARGS 4 /* number of args for each event */
/* event indicators */
#define LMC_EVENT_XMT 1
#define LMC_EVENT_XMTEND 2
#define LMC_EVENT_XMTINT 3
#define LMC_EVENT_RCVINT 4
#define LMC_EVENT_RCVEND 5
#define LMC_EVENT_INT 6
#define LMC_EVENT_XMTINTTMO 7
#define LMC_EVENT_XMTPRCTMO 8
#define LMC_EVENT_INTEND 9
#define LMC_EVENT_RESET1 10
#define LMC_EVENT_RESET2 11
#define LMC_EVENT_FORCEDRESET 12
#define LMC_EVENT_WATCHDOG 13
#define LMC_EVENT_BADPKTSURGE 14
#define LMC_EVENT_TBUSY0 15
#define LMC_EVENT_TBUSY1 16
#ifdef DEBUG
extern u32 lmcEventLogIndex;
extern u32 lmcEventLogBuf[LMC_EVENTLOGSIZE * LMC_EVENTLOGARGS];
#define LMC_EVENT_LOG(x, y, z) lmcEventLog((x), (y), (z))
#else
#define LMC_EVENT_LOG(x,y,z)
#endif /* end ifdef _DBG_EVENTLOG */
void lmcConsoleLog(char *type, unsigned char *ucData, int iLen);
void lmcEventLog(u32 EventNum, u32 arg2, u32 arg3);
#endif