Commit a7482a2e7775d163aecd8c95af7bb1b8c83890cc
Committed by
Linus Torvalds
1 parent
4247bdc600
Exists in
master
and in
7 other branches
[PATCH] synclink_cs add statistics clear
Add ability to clear statistics. Signed-off-by: Paul Fulghum <paulkf@microgate.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 11 additions and 5 deletions Side-by-side Diff
drivers/char/pcmcia/synclink_cs.c
1 | 1 | /* |
2 | 2 | * linux/drivers/char/pcmcia/synclink_cs.c |
3 | 3 | * |
4 | - * $Id: synclink_cs.c,v 4.26 2004/08/11 19:30:02 paulkf Exp $ | |
4 | + * $Id: synclink_cs.c,v 4.34 2005/09/08 13:20:54 paulkf Exp $ | |
5 | 5 | * |
6 | 6 | * Device driver for Microgate SyncLink PC Card |
7 | 7 | * multiprotocol serial adapter. |
... | ... | @@ -472,7 +472,7 @@ |
472 | 472 | MODULE_LICENSE("GPL"); |
473 | 473 | |
474 | 474 | static char *driver_name = "SyncLink PC Card driver"; |
475 | -static char *driver_version = "$Revision: 4.26 $"; | |
475 | +static char *driver_version = "$Revision: 4.34 $"; | |
476 | 476 | |
477 | 477 | static struct tty_driver *serial_driver; |
478 | 478 | |
... | ... | @@ -1457,6 +1457,8 @@ |
1457 | 1457 | |
1458 | 1458 | info->pending_bh = 0; |
1459 | 1459 | |
1460 | + memset(&info->icount, 0, sizeof(info->icount)); | |
1461 | + | |
1460 | 1462 | init_timer(&info->tx_timer); |
1461 | 1463 | info->tx_timer.data = (unsigned long)info; |
1462 | 1464 | info->tx_timer.function = tx_timeout; |
... | ... | @@ -1946,9 +1948,13 @@ |
1946 | 1948 | int err; |
1947 | 1949 | if (debug_level >= DEBUG_LEVEL_INFO) |
1948 | 1950 | printk("get_params(%s)\n", info->device_name); |
1949 | - COPY_TO_USER(err,user_icount, &info->icount, sizeof(struct mgsl_icount)); | |
1950 | - if (err) | |
1951 | - return -EFAULT; | |
1951 | + if (!user_icount) { | |
1952 | + memset(&info->icount, 0, sizeof(info->icount)); | |
1953 | + } else { | |
1954 | + COPY_TO_USER(err, user_icount, &info->icount, sizeof(struct mgsl_icount)); | |
1955 | + if (err) | |
1956 | + return -EFAULT; | |
1957 | + } | |
1952 | 1958 | return 0; |
1953 | 1959 | } |
1954 | 1960 |