aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2005-09-28 19:05:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-29 11:46:26 -0400
commit87e0f3dbd3693bc4583474ab191cbdd5e3d9d0fa (patch)
treea5237a18e01b4a72359f869617524620c517561c /drivers/char
parent666002218d59db271e5c1ede1d80227170c51987 (diff)
[PATCH] n_r3964: drop bogus fmt casts
- print pointers with %p - casting pointer structure field to int and printing it with %d... Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/n_r3964.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index 2291a87e8ada..97d6dc24b800 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -229,8 +229,8 @@ static int __init r3964_init(void)
229 TRACE_L("line discipline %d registered", N_R3964); 229 TRACE_L("line discipline %d registered", N_R3964);
230 TRACE_L("flags=%x num=%x", tty_ldisc_N_R3964.flags, 230 TRACE_L("flags=%x num=%x", tty_ldisc_N_R3964.flags,
231 tty_ldisc_N_R3964.num); 231 tty_ldisc_N_R3964.num);
232 TRACE_L("open=%x", (int)tty_ldisc_N_R3964.open); 232 TRACE_L("open=%p", tty_ldisc_N_R3964.open);
233 TRACE_L("tty_ldisc_N_R3964 = %x", (int)&tty_ldisc_N_R3964); 233 TRACE_L("tty_ldisc_N_R3964 = %p", &tty_ldisc_N_R3964);
234 } 234 }
235 else 235 else
236 { 236 {
@@ -267,8 +267,8 @@ static void add_tx_queue(struct r3964_info *pInfo, struct r3964_block_header *pH
267 267
268 spin_unlock_irqrestore(&pInfo->lock, flags); 268 spin_unlock_irqrestore(&pInfo->lock, flags);
269 269
270 TRACE_Q("add_tx_queue %x, length %d, tx_first = %x", 270 TRACE_Q("add_tx_queue %p, length %d, tx_first = %p",
271 (int)pHeader, pHeader->length, (int)pInfo->tx_first ); 271 pHeader, pHeader->length, pInfo->tx_first );
272} 272}
273 273
274static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code) 274static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code)
@@ -285,10 +285,10 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code)
285 return; 285 return;
286 286
287#ifdef DEBUG_QUEUE 287#ifdef DEBUG_QUEUE
288 printk("r3964: remove_from_tx_queue: %x, length %d - ", 288 printk("r3964: remove_from_tx_queue: %p, length %u - ",
289 (int)pHeader, (int)pHeader->length ); 289 pHeader, pHeader->length );
290 for(pDump=pHeader;pDump;pDump=pDump->next) 290 for(pDump=pHeader;pDump;pDump=pDump->next)
291 printk("%x ", (int)pDump); 291 printk("%p ", pDump);
292 printk("\n"); 292 printk("\n");
293#endif 293#endif
294 294
@@ -319,10 +319,10 @@ static void remove_from_tx_queue(struct r3964_info *pInfo, int error_code)
319 spin_unlock_irqrestore(&pInfo->lock, flags); 319 spin_unlock_irqrestore(&pInfo->lock, flags);
320 320
321 kfree(pHeader); 321 kfree(pHeader);
322 TRACE_M("remove_from_tx_queue - kfree %x",(int)pHeader); 322 TRACE_M("remove_from_tx_queue - kfree %p",pHeader);
323 323
324 TRACE_Q("remove_from_tx_queue: tx_first = %x, tx_last = %x", 324 TRACE_Q("remove_from_tx_queue: tx_first = %p, tx_last = %p",
325 (int)pInfo->tx_first, (int)pInfo->tx_last ); 325 pInfo->tx_first, pInfo->tx_last );
326} 326}
327 327
328static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pHeader) 328static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pHeader)
@@ -346,9 +346,9 @@ static void add_rx_queue(struct r3964_info *pInfo, struct r3964_block_header *pH
346 346
347 spin_unlock_irqrestore(&pInfo->lock, flags); 347 spin_unlock_irqrestore(&pInfo->lock, flags);
348 348
349 TRACE_Q("add_rx_queue: %x, length = %d, rx_first = %x, count = %d", 349 TRACE_Q("add_rx_queue: %p, length = %d, rx_first = %p, count = %d",
350 (int)pHeader, pHeader->length, 350 pHeader, pHeader->length,
351 (int)pInfo->rx_first, pInfo->blocks_in_rx_queue); 351 pInfo->rx_first, pInfo->blocks_in_rx_queue);
352} 352}
353 353
354static void remove_from_rx_queue(struct r3964_info *pInfo, 354static void remove_from_rx_queue(struct r3964_info *pInfo,
@@ -360,10 +360,10 @@ static void remove_from_rx_queue(struct r3964_info *pInfo,
360 if(pHeader==NULL) 360 if(pHeader==NULL)
361 return; 361 return;
362 362
363 TRACE_Q("remove_from_rx_queue: rx_first = %x, rx_last = %x, count = %d", 363 TRACE_Q("remove_from_rx_queue: rx_first = %p, rx_last = %p, count = %d",
364 (int)pInfo->rx_first, (int)pInfo->rx_last, pInfo->blocks_in_rx_queue ); 364 pInfo->rx_first, pInfo->rx_last, pInfo->blocks_in_rx_queue );
365 TRACE_Q("remove_from_rx_queue: %x, length %d", 365 TRACE_Q("remove_from_rx_queue: %p, length %u",
366 (int)pHeader, (int)pHeader->length ); 366 pHeader, pHeader->length );
367 367
368 spin_lock_irqsave(&pInfo->lock, flags); 368 spin_lock_irqsave(&pInfo->lock, flags);
369 369
@@ -401,10 +401,10 @@ static void remove_from_rx_queue(struct r3964_info *pInfo,
401 spin_unlock_irqrestore(&pInfo->lock, flags); 401 spin_unlock_irqrestore(&pInfo->lock, flags);
402 402
403 kfree(pHeader); 403 kfree(pHeader);
404 TRACE_M("remove_from_rx_queue - kfree %x",(int)pHeader); 404 TRACE_M("remove_from_rx_queue - kfree %p",pHeader);
405 405
406 TRACE_Q("remove_from_rx_queue: rx_first = %x, rx_last = %x, count = %d", 406 TRACE_Q("remove_from_rx_queue: rx_first = %p, rx_last = %p, count = %d",
407 (int)pInfo->rx_first, (int)pInfo->rx_last, pInfo->blocks_in_rx_queue ); 407 pInfo->rx_first, pInfo->rx_last, pInfo->blocks_in_rx_queue );
408} 408}
409 409
410static void put_char(struct r3964_info *pInfo, unsigned char ch) 410static void put_char(struct r3964_info *pInfo, unsigned char ch)
@@ -506,8 +506,8 @@ static void transmit_block(struct r3964_info *pInfo)
506 if(tty->driver->write_room) 506 if(tty->driver->write_room)
507 room=tty->driver->write_room(tty); 507 room=tty->driver->write_room(tty);
508 508
509 TRACE_PS("transmit_block %x, room %d, length %d", 509 TRACE_PS("transmit_block %p, room %d, length %d",
510 (int)pBlock, room, pBlock->length); 510 pBlock, room, pBlock->length);
511 511
512 while(pInfo->tx_position < pBlock->length) 512 while(pInfo->tx_position < pBlock->length)
513 { 513 {
@@ -588,7 +588,7 @@ static void on_receive_block(struct r3964_info *pInfo)
588 588
589 /* prepare struct r3964_block_header: */ 589 /* prepare struct r3964_block_header: */
590 pBlock = kmalloc(length+sizeof(struct r3964_block_header), GFP_KERNEL); 590 pBlock = kmalloc(length+sizeof(struct r3964_block_header), GFP_KERNEL);
591 TRACE_M("on_receive_block - kmalloc %x",(int)pBlock); 591 TRACE_M("on_receive_block - kmalloc %p",pBlock);
592 592
593 if(pBlock==NULL) 593 if(pBlock==NULL)
594 return; 594 return;
@@ -868,11 +868,11 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg)
868 if(pMsg) 868 if(pMsg)
869 { 869 {
870 kfree(pMsg); 870 kfree(pMsg);
871 TRACE_M("enable_signals - msg kfree %x",(int)pMsg); 871 TRACE_M("enable_signals - msg kfree %p",pMsg);
872 } 872 }
873 } 873 }
874 kfree(pClient); 874 kfree(pClient);
875 TRACE_M("enable_signals - kfree %x",(int)pClient); 875 TRACE_M("enable_signals - kfree %p",pClient);
876 return 0; 876 return 0;
877 } 877 }
878 } 878 }
@@ -890,7 +890,7 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg)
890 { 890 {
891 /* add client to client list */ 891 /* add client to client list */
892 pClient=kmalloc(sizeof(struct r3964_client_info), GFP_KERNEL); 892 pClient=kmalloc(sizeof(struct r3964_client_info), GFP_KERNEL);
893 TRACE_M("enable_signals - kmalloc %x",(int)pClient); 893 TRACE_M("enable_signals - kmalloc %p",pClient);
894 if(pClient==NULL) 894 if(pClient==NULL)
895 return -ENOMEM; 895 return -ENOMEM;
896 896
@@ -954,7 +954,7 @@ static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg,
954queue_the_message: 954queue_the_message:
955 955
956 pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL); 956 pMsg = kmalloc(sizeof(struct r3964_message), GFP_KERNEL);
957 TRACE_M("add_msg - kmalloc %x",(int)pMsg); 957 TRACE_M("add_msg - kmalloc %p",pMsg);
958 if(pMsg==NULL) { 958 if(pMsg==NULL) {
959 return; 959 return;
960 } 960 }
@@ -1067,11 +1067,11 @@ static int r3964_open(struct tty_struct *tty)
1067 struct r3964_info *pInfo; 1067 struct r3964_info *pInfo;
1068 1068
1069 TRACE_L("open"); 1069 TRACE_L("open");
1070 TRACE_L("tty=%x, PID=%d, disc_data=%x", 1070 TRACE_L("tty=%p, PID=%d, disc_data=%p",
1071 (int)tty, current->pid, (int)tty->disc_data); 1071 tty, current->pid, tty->disc_data);
1072 1072
1073 pInfo=kmalloc(sizeof(struct r3964_info), GFP_KERNEL); 1073 pInfo=kmalloc(sizeof(struct r3964_info), GFP_KERNEL);
1074 TRACE_M("r3964_open - info kmalloc %x",(int)pInfo); 1074 TRACE_M("r3964_open - info kmalloc %p",pInfo);
1075 1075
1076 if(!pInfo) 1076 if(!pInfo)
1077 { 1077 {
@@ -1080,26 +1080,26 @@ static int r3964_open(struct tty_struct *tty)
1080 } 1080 }
1081 1081
1082 pInfo->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL); 1082 pInfo->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL);
1083 TRACE_M("r3964_open - rx_buf kmalloc %x",(int)pInfo->rx_buf); 1083 TRACE_M("r3964_open - rx_buf kmalloc %p",pInfo->rx_buf);
1084 1084
1085 if(!pInfo->rx_buf) 1085 if(!pInfo->rx_buf)
1086 { 1086 {
1087 printk(KERN_ERR "r3964: failed to alloc receive buffer\n"); 1087 printk(KERN_ERR "r3964: failed to alloc receive buffer\n");
1088 kfree(pInfo); 1088 kfree(pInfo);
1089 TRACE_M("r3964_open - info kfree %x",(int)pInfo); 1089 TRACE_M("r3964_open - info kfree %p",pInfo);
1090 return -ENOMEM; 1090 return -ENOMEM;
1091 } 1091 }
1092 1092
1093 pInfo->tx_buf = kmalloc(TX_BUF_SIZE, GFP_KERNEL); 1093 pInfo->tx_buf = kmalloc(TX_BUF_SIZE, GFP_KERNEL);
1094 TRACE_M("r3964_open - tx_buf kmalloc %x",(int)pInfo->tx_buf); 1094 TRACE_M("r3964_open - tx_buf kmalloc %p",pInfo->tx_buf);
1095 1095
1096 if(!pInfo->tx_buf) 1096 if(!pInfo->tx_buf)
1097 { 1097 {
1098 printk(KERN_ERR "r3964: failed to alloc transmit buffer\n"); 1098 printk(KERN_ERR "r3964: failed to alloc transmit buffer\n");
1099 kfree(pInfo->rx_buf); 1099 kfree(pInfo->rx_buf);
1100 TRACE_M("r3964_open - rx_buf kfree %x",(int)pInfo->rx_buf); 1100 TRACE_M("r3964_open - rx_buf kfree %p",pInfo->rx_buf);
1101 kfree(pInfo); 1101 kfree(pInfo);
1102 TRACE_M("r3964_open - info kfree %x",(int)pInfo); 1102 TRACE_M("r3964_open - info kfree %p",pInfo);
1103 return -ENOMEM; 1103 return -ENOMEM;
1104 } 1104 }
1105 1105
@@ -1154,11 +1154,11 @@ static void r3964_close(struct tty_struct *tty)
1154 if(pMsg) 1154 if(pMsg)
1155 { 1155 {
1156 kfree(pMsg); 1156 kfree(pMsg);
1157 TRACE_M("r3964_close - msg kfree %x",(int)pMsg); 1157 TRACE_M("r3964_close - msg kfree %p",pMsg);
1158 } 1158 }
1159 } 1159 }
1160 kfree(pClient); 1160 kfree(pClient);
1161 TRACE_M("r3964_close - client kfree %x",(int)pClient); 1161 TRACE_M("r3964_close - client kfree %p",pClient);
1162 pClient=pNext; 1162 pClient=pNext;
1163 } 1163 }
1164 /* Remove jobs from tx_queue: */ 1164 /* Remove jobs from tx_queue: */
@@ -1177,11 +1177,11 @@ static void r3964_close(struct tty_struct *tty)
1177 /* Free buffers: */ 1177 /* Free buffers: */
1178 wake_up_interruptible(&pInfo->read_wait); 1178 wake_up_interruptible(&pInfo->read_wait);
1179 kfree(pInfo->rx_buf); 1179 kfree(pInfo->rx_buf);
1180 TRACE_M("r3964_close - rx_buf kfree %x",(int)pInfo->rx_buf); 1180 TRACE_M("r3964_close - rx_buf kfree %p",pInfo->rx_buf);
1181 kfree(pInfo->tx_buf); 1181 kfree(pInfo->tx_buf);
1182 TRACE_M("r3964_close - tx_buf kfree %x",(int)pInfo->tx_buf); 1182 TRACE_M("r3964_close - tx_buf kfree %p",pInfo->tx_buf);
1183 kfree(pInfo); 1183 kfree(pInfo);
1184 TRACE_M("r3964_close - info kfree %x",(int)pInfo); 1184 TRACE_M("r3964_close - info kfree %p",pInfo);
1185} 1185}
1186 1186
1187static ssize_t r3964_read(struct tty_struct *tty, struct file *file, 1187static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
@@ -1234,7 +1234,7 @@ repeat:
1234 count = sizeof(struct r3964_client_message); 1234 count = sizeof(struct r3964_client_message);
1235 1235
1236 kfree(pMsg); 1236 kfree(pMsg);
1237 TRACE_M("r3964_read - msg kfree %x",(int)pMsg); 1237 TRACE_M("r3964_read - msg kfree %p",pMsg);
1238 1238
1239 if (copy_to_user(buf,&theMsg, count)) 1239 if (copy_to_user(buf,&theMsg, count))
1240 return -EFAULT; 1240 return -EFAULT;
@@ -1279,7 +1279,7 @@ static ssize_t r3964_write(struct tty_struct * tty, struct file * file,
1279 * Allocate a buffer for the data and copy it from the buffer with header prepended 1279 * Allocate a buffer for the data and copy it from the buffer with header prepended
1280 */ 1280 */
1281 new_data = kmalloc (count+sizeof(struct r3964_block_header), GFP_KERNEL); 1281 new_data = kmalloc (count+sizeof(struct r3964_block_header), GFP_KERNEL);
1282 TRACE_M("r3964_write - kmalloc %x",(int)new_data); 1282 TRACE_M("r3964_write - kmalloc %p",new_data);
1283 if (new_data == NULL) { 1283 if (new_data == NULL) {
1284 if (pInfo->flags & R3964_DEBUG) 1284 if (pInfo->flags & R3964_DEBUG)
1285 { 1285 {