Commit b18d1c2e authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty: n_hdlc, remove FILE and LINE from pr_debug

As Joe suggests, dynamic debug can print module name and line number
along with message. So remove __FILE__ and __LINE__ from all those
pr_debug calls.

Out of curiosity, I measured the savings, 200 bytes of code are gone.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Suggested-by: default avatarJoe Perches <joe@perches.com>
Link: https://lore.kernel.org/r/20200316064910.4941-1-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5b30dee6
...@@ -226,8 +226,7 @@ static int n_hdlc_tty_open(struct tty_struct *tty) ...@@ -226,8 +226,7 @@ static int n_hdlc_tty_open(struct tty_struct *tty)
{ {
struct n_hdlc *n_hdlc = tty->disc_data; struct n_hdlc *n_hdlc = tty->disc_data;
pr_debug("%s(%d)%s() called (device=%s)\n", pr_debug("%s() called (device=%s)\n", __func__, tty->name);
__FILE__, __LINE__, __func__, tty->name);
/* There should not be an existing table for this slot. */ /* There should not be an existing table for this slot. */
if (n_hdlc) { if (n_hdlc) {
...@@ -283,8 +282,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) ...@@ -283,8 +282,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty)
tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list);
while (tbuf) { while (tbuf) {
pr_debug("%s(%d)sending frame %p, count=%d\n", pr_debug("sending frame %p, count=%d\n", tbuf, tbuf->count);
__FILE__, __LINE__, tbuf, tbuf->count);
/* Send the next block of data to device */ /* Send the next block of data to device */
set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
...@@ -301,8 +299,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) ...@@ -301,8 +299,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty)
actual = tbuf->count; actual = tbuf->count;
if (actual == tbuf->count) { if (actual == tbuf->count) {
pr_debug("%s(%d)frame %p completed\n", pr_debug("frame %p completed\n", tbuf);
__FILE__, __LINE__, tbuf);
/* free current transmit buffer */ /* free current transmit buffer */
n_hdlc_buf_put(&n_hdlc->tx_free_buf_list, tbuf); n_hdlc_buf_put(&n_hdlc->tx_free_buf_list, tbuf);
...@@ -313,8 +310,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) ...@@ -313,8 +310,7 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty)
/* get next pending transmit buffer */ /* get next pending transmit buffer */
tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list); tbuf = n_hdlc_buf_get(&n_hdlc->tx_buf_list);
} else { } else {
pr_debug("%s(%d)frame %p pending\n", pr_debug("frame %p pending\n", tbuf);
__FILE__, __LINE__, tbuf);
/* /*
* the buffer was not accepted by driver, * the buffer was not accepted by driver,
...@@ -366,19 +362,16 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data, ...@@ -366,19 +362,16 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
register struct n_hdlc *n_hdlc = tty->disc_data; register struct n_hdlc *n_hdlc = tty->disc_data;
register struct n_hdlc_buf *buf; register struct n_hdlc_buf *buf;
pr_debug("%s(%d)%s() called count=%d\n", pr_debug("%s() called count=%d\n", __func__, count);
__FILE__, __LINE__, __func__, count);
/* verify line is using HDLC discipline */ /* verify line is using HDLC discipline */
if (n_hdlc->magic != HDLC_MAGIC) { if (n_hdlc->magic != HDLC_MAGIC) {
pr_err("%s(%d) line not using HDLC discipline\n", pr_err("line not using HDLC discipline\n");
__FILE__, __LINE__);
return; return;
} }
if (count > maxframe) { if (count > maxframe) {
pr_debug("%s(%d) rx count>maxframesize, data discarded\n", pr_debug("rx count>maxframesize, data discarded\n");
__FILE__, __LINE__);
return; return;
} }
...@@ -395,8 +388,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data, ...@@ -395,8 +388,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
} }
if (!buf) { if (!buf) {
pr_debug("%s(%d) no more rx buffers, data discarded\n", pr_debug("no more rx buffers, data discarded\n");
__FILE__, __LINE__);
return; return;
} }
...@@ -509,8 +501,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, ...@@ -509,8 +501,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
struct n_hdlc_buf *tbuf; struct n_hdlc_buf *tbuf;
pr_debug("%s(%d)%s() called count=%zd\n", __FILE__, __LINE__, __func__, pr_debug("%s() called count=%zd\n", __func__, count);
count);
if (n_hdlc->magic != HDLC_MAGIC) if (n_hdlc->magic != HDLC_MAGIC)
return -EIO; return -EIO;
...@@ -578,7 +569,7 @@ static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -578,7 +569,7 @@ static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
unsigned long flags; unsigned long flags;
struct n_hdlc_buf *buf = NULL; struct n_hdlc_buf *buf = NULL;
pr_debug("%s(%d)%s() called %d\n", __FILE__, __LINE__, __func__, cmd); pr_debug("%s() called %d\n", __func__, cmd);
/* Verify the status of the device */ /* Verify the status of the device */
if (n_hdlc->magic != HDLC_MAGIC) if (n_hdlc->magic != HDLC_MAGIC)
...@@ -677,8 +668,8 @@ static void n_hdlc_alloc_buf(struct n_hdlc_buf_list *list, unsigned int count, ...@@ -677,8 +668,8 @@ static void n_hdlc_alloc_buf(struct n_hdlc_buf_list *list, unsigned int count,
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
buf = kmalloc(struct_size(buf, buf, maxframe), GFP_KERNEL); buf = kmalloc(struct_size(buf, buf, maxframe), GFP_KERNEL);
if (!buf) { if (!buf) {
pr_debug("%s(%d)%s(), kmalloc() failed for %s buffer %u\n", pr_debug("%s(), kmalloc() failed for %s buffer %u\n",
__FILE__, __LINE__, __func__, name, i); __func__, name, i);
return; return;
} }
n_hdlc_buf_put(list, buf); n_hdlc_buf_put(list, buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment