License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6/btrfs-unstable.git] / drivers / staging / rts5208 / trace.c
blobc878e75293f7b7b8c6852aced661df9e5100eda0
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/kernel.h>
3 #include <linux/string.h>
5 #include "rtsx.h"
7 #ifdef _MSG_TRACE
9 void _rtsx_trace(struct rtsx_chip *chip, const char *file, const char *func,
10 int line)
12 struct trace_msg_t *msg = &chip->trace_msg[chip->msg_idx];
14 file = kbasename(file);
15 dev_dbg(rtsx_dev(chip), "[%s][%s]:[%d]\n", file, func, line);
17 strncpy(msg->file, file, MSG_FILE_LEN - 1);
18 strncpy(msg->func, func, MSG_FUNC_LEN - 1);
19 msg->line = (u16)line;
20 get_current_time(msg->timeval_buf, TIME_VAL_LEN);
21 msg->valid = 1;
23 chip->msg_idx++;
24 if (chip->msg_idx >= TRACE_ITEM_CNT)
25 chip->msg_idx = 0;
27 #endif