From: Tilman Schmidt Date: Mon, 12 Feb 2007 08:52:26 +0000 (-0800) Subject: [PATCH] drivers/isdn/gigaset: reduce kernel message spam X-Git-Tag: v2.6.21-rc1~274^2~177 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92ba0ee2770ed4954e3f8ba412ef2f37e5519477;p=linux-2.6 [PATCH] drivers/isdn/gigaset: reduce kernel message spam Reduce the number of kernel messages the Gigaset drivers produce in case of an excessively long device response, from one per character exceeding the limit to one per overlong message. Signed-off-by: Tilman Schmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c index df988eb0e3..8c0eb522da 100644 --- a/drivers/isdn/gigaset/isocdata.c +++ b/drivers/isdn/gigaset/isocdata.c @@ -921,6 +921,8 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) /* end of line */ gig_dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)", __func__, cbytes); + if (cbytes >= MAX_RESP_SIZE - 1) + dev_warn(cs->dev, "response too large\n"); cs->cbytes = cbytes; gigaset_handle_modem_response(cs); cbytes = 0; @@ -929,8 +931,6 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) /* advance in line buffer, checking for overflow */ if (cbytes < MAX_RESP_SIZE - 1) cbytes++; - else - dev_warn(cs->dev, "response too large\n"); } }