diff options
author | hayeswang <hayeswang@realtek.com> | 2014-01-14 21:42:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-14 21:48:54 -0500 |
commit | 9629e3c037a1ede32b70d9ae2ab131cdfb872df8 (patch) | |
tree | fa2473c77af6d774e01b7ffb62c126255f6a9fd0 /drivers/net/usb/r8152.c | |
parent | 44d942a908641e6486e66eb33e7ba9e6a969678a (diff) |
r8152: fix the warnings and a error from checkpatch.pl
Fix the following warnings and error:
- WARNING: usb_free_urb(NULL) is safe this check is probably not required
- WARNING: kfree(NULL) is safe this check is probably not required
- ERROR: do not use C99 // comments
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/r8152.c')
-rw-r--r-- | drivers/net/usb/r8152.c | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 38f3c1426eb0..eab078b6e603 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -1100,40 +1100,28 @@ static void free_all_mem(struct r8152 *tp) | |||
1100 | int i; | 1100 | int i; |
1101 | 1101 | ||
1102 | for (i = 0; i < RTL8152_MAX_RX; i++) { | 1102 | for (i = 0; i < RTL8152_MAX_RX; i++) { |
1103 | if (tp->rx_info[i].urb) { | 1103 | usb_free_urb(tp->rx_info[i].urb); |
1104 | usb_free_urb(tp->rx_info[i].urb); | 1104 | tp->rx_info[i].urb = NULL; |
1105 | tp->rx_info[i].urb = NULL; | ||
1106 | } | ||
1107 | 1105 | ||
1108 | if (tp->rx_info[i].buffer) { | 1106 | kfree(tp->rx_info[i].buffer); |
1109 | kfree(tp->rx_info[i].buffer); | 1107 | tp->rx_info[i].buffer = NULL; |
1110 | tp->rx_info[i].buffer = NULL; | 1108 | tp->rx_info[i].head = NULL; |
1111 | tp->rx_info[i].head = NULL; | ||
1112 | } | ||
1113 | } | 1109 | } |
1114 | 1110 | ||
1115 | for (i = 0; i < RTL8152_MAX_TX; i++) { | 1111 | for (i = 0; i < RTL8152_MAX_TX; i++) { |
1116 | if (tp->tx_info[i].urb) { | 1112 | usb_free_urb(tp->tx_info[i].urb); |
1117 | usb_free_urb(tp->tx_info[i].urb); | 1113 | tp->tx_info[i].urb = NULL; |
1118 | tp->tx_info[i].urb = NULL; | ||
1119 | } | ||
1120 | 1114 | ||
1121 | if (tp->tx_info[i].buffer) { | 1115 | kfree(tp->tx_info[i].buffer); |
1122 | kfree(tp->tx_info[i].buffer); | 1116 | tp->tx_info[i].buffer = NULL; |
1123 | tp->tx_info[i].buffer = NULL; | 1117 | tp->tx_info[i].head = NULL; |
1124 | tp->tx_info[i].head = NULL; | ||
1125 | } | ||
1126 | } | 1118 | } |
1127 | 1119 | ||
1128 | if (tp->intr_urb) { | 1120 | usb_free_urb(tp->intr_urb); |
1129 | usb_free_urb(tp->intr_urb); | 1121 | tp->intr_urb = NULL; |
1130 | tp->intr_urb = NULL; | ||
1131 | } | ||
1132 | 1122 | ||
1133 | if (tp->intr_buff) { | 1123 | kfree(tp->intr_buff); |
1134 | kfree(tp->intr_buff); | 1124 | tp->intr_buff = NULL; |
1135 | tp->intr_buff = NULL; | ||
1136 | } | ||
1137 | } | 1125 | } |
1138 | 1126 | ||
1139 | static int alloc_all_mem(struct r8152 *tp) | 1127 | static int alloc_all_mem(struct r8152 *tp) |
@@ -2048,7 +2036,7 @@ static void r8153_first_init(struct r8152 *tp) | |||
2048 | /* TX share fifo free credit full threshold */ | 2036 | /* TX share fifo free credit full threshold */ |
2049 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2); | 2037 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TXFIFO_CTRL, TXFIFO_THR_NORMAL2); |
2050 | 2038 | ||
2051 | // rx aggregation | 2039 | /* rx aggregation */ |
2052 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); | 2040 | ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); |
2053 | ocp_data &= ~RX_AGG_DISABLE; | 2041 | ocp_data &= ~RX_AGG_DISABLE; |
2054 | ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); | 2042 | ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); |