diff options
Diffstat (limited to 'net/tipc/log.c')
-rw-r--r-- | net/tipc/log.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/net/tipc/log.c b/net/tipc/log.c index 895c6e530b0..026733f2491 100644 --- a/net/tipc/log.c +++ b/net/tipc/log.c | |||
@@ -47,7 +47,6 @@ | |||
47 | * | 47 | * |
48 | * Additional user-defined print buffers are also permitted. | 48 | * Additional user-defined print buffers are also permitted. |
49 | */ | 49 | */ |
50 | |||
51 | static struct print_buf null_buf = { NULL, 0, NULL, 0 }; | 50 | static struct print_buf null_buf = { NULL, 0, NULL, 0 }; |
52 | struct print_buf *const TIPC_NULL = &null_buf; | 51 | struct print_buf *const TIPC_NULL = &null_buf; |
53 | 52 | ||
@@ -72,7 +71,6 @@ struct print_buf *const TIPC_LOG = &log_buf; | |||
72 | * on the caller to prevent simultaneous use of the print buffer(s) being | 71 | * on the caller to prevent simultaneous use of the print buffer(s) being |
73 | * manipulated. | 72 | * manipulated. |
74 | */ | 73 | */ |
75 | |||
76 | static char print_string[TIPC_PB_MAX_STR]; | 74 | static char print_string[TIPC_PB_MAX_STR]; |
77 | static DEFINE_SPINLOCK(print_lock); | 75 | static DEFINE_SPINLOCK(print_lock); |
78 | 76 | ||
@@ -97,7 +95,6 @@ static void tipc_printbuf_move(struct print_buf *pb_to, | |||
97 | * Note: If the character array is too small (or absent), the print buffer | 95 | * Note: If the character array is too small (or absent), the print buffer |
98 | * becomes a null device that discards anything written to it. | 96 | * becomes a null device that discards anything written to it. |
99 | */ | 97 | */ |
100 | |||
101 | void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size) | 98 | void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size) |
102 | { | 99 | { |
103 | pb->buf = raw; | 100 | pb->buf = raw; |
@@ -117,7 +114,6 @@ void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size) | |||
117 | * tipc_printbuf_reset - reinitialize print buffer to empty state | 114 | * tipc_printbuf_reset - reinitialize print buffer to empty state |
118 | * @pb: pointer to print buffer structure | 115 | * @pb: pointer to print buffer structure |
119 | */ | 116 | */ |
120 | |||
121 | static void tipc_printbuf_reset(struct print_buf *pb) | 117 | static void tipc_printbuf_reset(struct print_buf *pb) |
122 | { | 118 | { |
123 | if (pb->buf) { | 119 | if (pb->buf) { |
@@ -133,7 +129,6 @@ static void tipc_printbuf_reset(struct print_buf *pb) | |||
133 | * | 129 | * |
134 | * Returns non-zero if print buffer is empty. | 130 | * Returns non-zero if print buffer is empty. |
135 | */ | 131 | */ |
136 | |||
137 | static int tipc_printbuf_empty(struct print_buf *pb) | 132 | static int tipc_printbuf_empty(struct print_buf *pb) |
138 | { | 133 | { |
139 | return !pb->buf || (pb->crs == pb->buf); | 134 | return !pb->buf || (pb->crs == pb->buf); |
@@ -148,7 +143,6 @@ static int tipc_printbuf_empty(struct print_buf *pb) | |||
148 | * | 143 | * |
149 | * Returns length of print buffer data string (including trailing NUL) | 144 | * Returns length of print buffer data string (including trailing NUL) |
150 | */ | 145 | */ |
151 | |||
152 | int tipc_printbuf_validate(struct print_buf *pb) | 146 | int tipc_printbuf_validate(struct print_buf *pb) |
153 | { | 147 | { |
154 | char *err = "\n\n*** PRINT BUFFER OVERFLOW ***\n\n"; | 148 | char *err = "\n\n*** PRINT BUFFER OVERFLOW ***\n\n"; |
@@ -182,14 +176,12 @@ int tipc_printbuf_validate(struct print_buf *pb) | |||
182 | * Current contents of destination print buffer (if any) are discarded. | 176 | * Current contents of destination print buffer (if any) are discarded. |
183 | * Source print buffer becomes empty if a successful move occurs. | 177 | * Source print buffer becomes empty if a successful move occurs. |
184 | */ | 178 | */ |
185 | |||
186 | static void tipc_printbuf_move(struct print_buf *pb_to, | 179 | static void tipc_printbuf_move(struct print_buf *pb_to, |
187 | struct print_buf *pb_from) | 180 | struct print_buf *pb_from) |
188 | { | 181 | { |
189 | int len; | 182 | int len; |
190 | 183 | ||
191 | /* Handle the cases where contents can't be moved */ | 184 | /* Handle the cases where contents can't be moved */ |
192 | |||
193 | if (!pb_to->buf) | 185 | if (!pb_to->buf) |
194 | return; | 186 | return; |
195 | 187 | ||
@@ -206,7 +198,6 @@ static void tipc_printbuf_move(struct print_buf *pb_to, | |||
206 | } | 198 | } |
207 | 199 | ||
208 | /* Copy data from char after cursor to end (if used) */ | 200 | /* Copy data from char after cursor to end (if used) */ |
209 | |||
210 | len = pb_from->buf + pb_from->size - pb_from->crs - 2; | 201 | len = pb_from->buf + pb_from->size - pb_from->crs - 2; |
211 | if ((pb_from->buf[pb_from->size - 1] == 0) && (len > 0)) { | 202 | if ((pb_from->buf[pb_from->size - 1] == 0) && (len > 0)) { |
212 | strcpy(pb_to->buf, pb_from->crs + 1); | 203 | strcpy(pb_to->buf, pb_from->crs + 1); |
@@ -215,7 +206,6 @@ static void tipc_printbuf_move(struct print_buf *pb_to, | |||
215 | pb_to->crs = pb_to->buf; | 206 | pb_to->crs = pb_to->buf; |
216 | 207 | ||
217 | /* Copy data from start to cursor (always) */ | 208 | /* Copy data from start to cursor (always) */ |
218 | |||
219 | len = pb_from->crs - pb_from->buf; | 209 | len = pb_from->crs - pb_from->buf; |
220 | strcpy(pb_to->crs, pb_from->buf); | 210 | strcpy(pb_to->crs, pb_from->buf); |
221 | pb_to->crs += len; | 211 | pb_to->crs += len; |
@@ -228,7 +218,6 @@ static void tipc_printbuf_move(struct print_buf *pb_to, | |||
228 | * @pb: pointer to print buffer | 218 | * @pb: pointer to print buffer |
229 | * @fmt: formatted info to be printed | 219 | * @fmt: formatted info to be printed |
230 | */ | 220 | */ |
231 | |||
232 | void tipc_printf(struct print_buf *pb, const char *fmt, ...) | 221 | void tipc_printf(struct print_buf *pb, const char *fmt, ...) |
233 | { | 222 | { |
234 | int chars_to_add; | 223 | int chars_to_add; |
@@ -270,7 +259,6 @@ void tipc_printf(struct print_buf *pb, const char *fmt, ...) | |||
270 | * tipc_log_resize - change the size of the TIPC log buffer | 259 | * tipc_log_resize - change the size of the TIPC log buffer |
271 | * @log_size: print buffer size to use | 260 | * @log_size: print buffer size to use |
272 | */ | 261 | */ |
273 | |||
274 | int tipc_log_resize(int log_size) | 262 | int tipc_log_resize(int log_size) |
275 | { | 263 | { |
276 | int res = 0; | 264 | int res = 0; |
@@ -295,7 +283,6 @@ int tipc_log_resize(int log_size) | |||
295 | /** | 283 | /** |
296 | * tipc_log_resize_cmd - reconfigure size of TIPC log buffer | 284 | * tipc_log_resize_cmd - reconfigure size of TIPC log buffer |
297 | */ | 285 | */ |
298 | |||
299 | struct sk_buff *tipc_log_resize_cmd(const void *req_tlv_area, int req_tlv_space) | 286 | struct sk_buff *tipc_log_resize_cmd(const void *req_tlv_area, int req_tlv_space) |
300 | { | 287 | { |
301 | u32 value; | 288 | u32 value; |
@@ -316,7 +303,6 @@ struct sk_buff *tipc_log_resize_cmd(const void *req_tlv_area, int req_tlv_space) | |||
316 | /** | 303 | /** |
317 | * tipc_log_dump - capture TIPC log buffer contents in configuration message | 304 | * tipc_log_dump - capture TIPC log buffer contents in configuration message |
318 | */ | 305 | */ |
319 | |||
320 | struct sk_buff *tipc_log_dump(void) | 306 | struct sk_buff *tipc_log_dump(void) |
321 | { | 307 | { |
322 | struct sk_buff *reply; | 308 | struct sk_buff *reply; |