aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJ.R. Mauro <jrm8005@gmail.com>2009-01-05 15:27:51 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 16:52:41 -0500
commita2bf2153cb2a2de341b6a87cb644870a5bde2a9d (patch)
tree3420ebe661ebfa953d0f220d0e676f312ad6270e /drivers
parent457b9a6f09f011ebcb9b52cc203a6331a6fc2de7 (diff)
Staging: android: binder: Fix gcc warnings about improper format specifiers for size_t in printk
Use the proper format specifiers for printing size_t values. Signed-off-by: J.R. Mauro <jrm8005@gmail.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Brian Swetland <swetland@google.com> Cc: Robert Love <rlove@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/android/binder.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 387625b40bb2..765048eaaf6d 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -493,7 +493,7 @@ static void binder_insert_free_buffer(
493 new_buffer_size = binder_buffer_size(proc, new_buffer); 493 new_buffer_size = binder_buffer_size(proc, new_buffer);
494 494
495 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC) 495 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC)
496 printk(KERN_INFO "binder: %d: add free buffer, size %d, " 496 printk(KERN_INFO "binder: %d: add free buffer, size %zd, "
497 "at %p\n", proc->pid, new_buffer_size, new_buffer); 497 "at %p\n", proc->pid, new_buffer_size, new_buffer);
498 498
499 while (*p) { 499 while (*p) {
@@ -679,14 +679,14 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
679 679
680 if (size < data_size || size < offsets_size) { 680 if (size < data_size || size < offsets_size) {
681 binder_user_error("binder: %d: got transaction with invalid " 681 binder_user_error("binder: %d: got transaction with invalid "
682 "size %d-%d\n", proc->pid, data_size, offsets_size); 682 "size %zd-%zd\n", proc->pid, data_size, offsets_size);
683 return NULL; 683 return NULL;
684 } 684 }
685 685
686 if (is_async && 686 if (is_async &&
687 proc->free_async_space < size + sizeof(struct binder_buffer)) { 687 proc->free_async_space < size + sizeof(struct binder_buffer)) {
688 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC) 688 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC)
689 printk(KERN_ERR "binder: %d: binder_alloc_buf size %d f" 689 printk(KERN_ERR "binder: %d: binder_alloc_buf size %zd f"
690 "ailed, no async space left\n", proc->pid, size); 690 "ailed, no async space left\n", proc->pid, size);
691 return NULL; 691 return NULL;
692 } 692 }
@@ -707,7 +707,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
707 } 707 }
708 } 708 }
709 if (best_fit == NULL) { 709 if (best_fit == NULL) {
710 printk(KERN_ERR "binder: %d: binder_alloc_buf size %d failed, " 710 printk(KERN_ERR "binder: %d: binder_alloc_buf size %zd failed, "
711 "no address space\n", proc->pid, size); 711 "no address space\n", proc->pid, size);
712 return NULL; 712 return NULL;
713 } 713 }
@@ -716,8 +716,8 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
716 buffer_size = binder_buffer_size(proc, buffer); 716 buffer_size = binder_buffer_size(proc, buffer);
717 } 717 }
718 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC) 718 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC)
719 printk(KERN_INFO "binder: %d: binder_alloc_buf size %d got buff" 719 printk(KERN_INFO "binder: %d: binder_alloc_buf size %zd got buff"
720 "er %p size %d\n", proc->pid, size, buffer, buffer_size); 720 "er %p size %zd\n", proc->pid, size, buffer, buffer_size);
721 721
722 has_page_addr = 722 has_page_addr =
723 (void *)(((size_t)buffer->data + buffer_size) & PAGE_MASK); 723 (void *)(((size_t)buffer->data + buffer_size) & PAGE_MASK);
@@ -744,7 +744,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
744 binder_insert_free_buffer(proc, new_buffer); 744 binder_insert_free_buffer(proc, new_buffer);
745 } 745 }
746 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC) 746 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC)
747 printk(KERN_INFO "binder: %d: binder_alloc_buf size %d got " 747 printk(KERN_INFO "binder: %d: binder_alloc_buf size %zd got "
748 "%p\n", proc->pid, size, buffer); 748 "%p\n", proc->pid, size, buffer);
749 buffer->data_size = data_size; 749 buffer->data_size = data_size;
750 buffer->offsets_size = offsets_size; 750 buffer->offsets_size = offsets_size;
@@ -752,8 +752,8 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
752 if (is_async) { 752 if (is_async) {
753 proc->free_async_space -= size + sizeof(struct binder_buffer); 753 proc->free_async_space -= size + sizeof(struct binder_buffer);
754 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC_ASYNC) 754 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC_ASYNC)
755 printk(KERN_INFO "binder: %d: binder_alloc_buf size %d " 755 printk(KERN_INFO "binder: %d: binder_alloc_buf size %zd "
756 "async free %d\n", proc->pid, size, 756 "async free %zd\n", proc->pid, size,
757 proc->free_async_space); 757 proc->free_async_space);
758 } 758 }
759 759
@@ -827,8 +827,8 @@ static void binder_free_buf(
827 size = ALIGN(buffer->data_size, sizeof(void *)) + 827 size = ALIGN(buffer->data_size, sizeof(void *)) +
828 ALIGN(buffer->offsets_size, sizeof(void *)); 828 ALIGN(buffer->offsets_size, sizeof(void *));
829 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC) 829 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC)
830 printk(KERN_INFO "binder: %d: binder_free_buf %p size %d buffer" 830 printk(KERN_INFO "binder: %d: binder_free_buf %p size %zd buffer"
831 "_size %d\n", proc->pid, buffer, size, buffer_size); 831 "_size %zd\n", proc->pid, buffer, size, buffer_size);
832 832
833 BUG_ON(buffer->free); 833 BUG_ON(buffer->free);
834 BUG_ON(size > buffer_size); 834 BUG_ON(size > buffer_size);
@@ -839,8 +839,8 @@ static void binder_free_buf(
839 if (buffer->async_transaction) { 839 if (buffer->async_transaction) {
840 proc->free_async_space += size + sizeof(struct binder_buffer); 840 proc->free_async_space += size + sizeof(struct binder_buffer);
841 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC_ASYNC) 841 if (binder_debug_mask & BINDER_DEBUG_BUFFER_ALLOC_ASYNC)
842 printk(KERN_INFO "binder: %d: binder_free_buf size %d " 842 printk(KERN_INFO "binder: %d: binder_free_buf size %zd "
843 "async free %d\n", proc->pid, size, 843 "async free %zd\n", proc->pid, size,
844 proc->free_async_space); 844 proc->free_async_space);
845 } 845 }
846 846
@@ -1383,14 +1383,14 @@ binder_transaction(struct binder_proc *proc, struct binder_thread *thread,
1383 if (binder_debug_mask & BINDER_DEBUG_TRANSACTION) { 1383 if (binder_debug_mask & BINDER_DEBUG_TRANSACTION) {
1384 if (reply) 1384 if (reply)
1385 printk(KERN_INFO "binder: %d:%d BC_REPLY %d -> %d:%d, " 1385 printk(KERN_INFO "binder: %d:%d BC_REPLY %d -> %d:%d, "
1386 "data %p-%p size %d-%d\n", 1386 "data %p-%p size %zd-%zd\n",
1387 proc->pid, thread->pid, t->debug_id, 1387 proc->pid, thread->pid, t->debug_id,
1388 target_proc->pid, target_thread->pid, 1388 target_proc->pid, target_thread->pid,
1389 tr->data.ptr.buffer, tr->data.ptr.offsets, 1389 tr->data.ptr.buffer, tr->data.ptr.offsets,
1390 tr->data_size, tr->offsets_size); 1390 tr->data_size, tr->offsets_size);
1391 else 1391 else
1392 printk(KERN_INFO "binder: %d:%d BC_TRANSACTION %d -> " 1392 printk(KERN_INFO "binder: %d:%d BC_TRANSACTION %d -> "
1393 "%d - node %d, data %p-%p size %d-%d\n", 1393 "%d - node %d, data %p-%p size %zd-%zd\n",
1394 proc->pid, thread->pid, t->debug_id, 1394 proc->pid, thread->pid, t->debug_id,
1395 target_proc->pid, target_node->debug_id, 1395 target_proc->pid, target_node->debug_id,
1396 tr->data.ptr.buffer, tr->data.ptr.offsets, 1396 tr->data.ptr.buffer, tr->data.ptr.offsets,
@@ -1439,7 +1439,7 @@ binder_transaction(struct binder_proc *proc, struct binder_thread *thread,
1439 struct flat_binder_object *fp; 1439 struct flat_binder_object *fp;
1440 if (*offp > t->buffer->data_size - sizeof(*fp)) { 1440 if (*offp > t->buffer->data_size - sizeof(*fp)) {
1441 binder_user_error("binder: %d:%d got transaction with " 1441 binder_user_error("binder: %d:%d got transaction with "
1442 "invalid offset, %d\n", 1442 "invalid offset, %zd\n",
1443 proc->pid, thread->pid, *offp); 1443 proc->pid, thread->pid, *offp);
1444 return_error = BR_FAILED_REPLY; 1444 return_error = BR_FAILED_REPLY;
1445 goto err_bad_offset; 1445 goto err_bad_offset;
@@ -1615,7 +1615,8 @@ err_dead_binder:
1615err_invalid_target_handle: 1615err_invalid_target_handle:
1616err_no_context_mgr_node: 1616err_no_context_mgr_node:
1617 if (binder_debug_mask & BINDER_DEBUG_FAILED_TRANSACTION) 1617 if (binder_debug_mask & BINDER_DEBUG_FAILED_TRANSACTION)
1618 printk(KERN_INFO "binder: %d:%d transaction failed %d, size %d-%d\n", 1618 printk(KERN_INFO "binder: %d:%d transaction failed %d, size"
1619 "%zd-%zd\n",
1619 proc->pid, thread->pid, return_error, 1620 proc->pid, thread->pid, return_error,
1620 tr->data_size, tr->offsets_size); 1621 tr->data_size, tr->offsets_size);
1621 1622
@@ -1640,7 +1641,7 @@ binder_transaction_buffer_release(struct binder_proc *proc, struct binder_buffer
1640 int debug_id = buffer->debug_id; 1641 int debug_id = buffer->debug_id;
1641 1642
1642 if (binder_debug_mask & BINDER_DEBUG_TRANSACTION) 1643 if (binder_debug_mask & BINDER_DEBUG_TRANSACTION)
1643 printk(KERN_INFO "binder: %d buffer release %d, size %d-%d, failed at %p\n", 1644 printk(KERN_INFO "binder: %d buffer release %d, size %zd-%zd, failed at %p\n",
1644 proc->pid, buffer->debug_id, 1645 proc->pid, buffer->debug_id,
1645 buffer->data_size, buffer->offsets_size, failed_at); 1646 buffer->data_size, buffer->offsets_size, failed_at);
1646 1647
@@ -1655,7 +1656,8 @@ binder_transaction_buffer_release(struct binder_proc *proc, struct binder_buffer
1655 for (; offp < off_end; offp++) { 1656 for (; offp < off_end; offp++) {
1656 struct flat_binder_object *fp; 1657 struct flat_binder_object *fp;
1657 if (*offp > buffer->data_size - sizeof(*fp)) { 1658 if (*offp > buffer->data_size - sizeof(*fp)) {
1658 printk(KERN_ERR "binder: transaction release %d bad offset %d, size %d\n", debug_id, *offp, buffer->data_size); 1659 printk(KERN_ERR "binder: transaction release %d bad"
1660 "offset %zd, size %zd\n", debug_id, *offp, buffer->data_size);
1659 continue; 1661 continue;
1660 } 1662 }
1661 fp = (struct flat_binder_object *)(buffer->data + *offp); 1663 fp = (struct flat_binder_object *)(buffer->data + *offp);
@@ -2350,7 +2352,8 @@ retry:
2350 2352
2351 binder_stat_br(proc, thread, cmd); 2353 binder_stat_br(proc, thread, cmd);
2352 if (binder_debug_mask & BINDER_DEBUG_TRANSACTION) 2354 if (binder_debug_mask & BINDER_DEBUG_TRANSACTION)
2353 printk(KERN_INFO "binder: %d:%d %s %d %d:%d, cmd %d size %d-%d ptr %p-%p\n", 2355 printk(KERN_INFO "binder: %d:%d %s %d %d:%d, cmd %d"
2356 "size %zd-%zd ptr %p-%p\n",
2354 proc->pid, thread->pid, 2357 proc->pid, thread->pid,
2355 (cmd == BR_TRANSACTION) ? "BR_TRANSACTION" : "BR_REPLY", 2358 (cmd == BR_TRANSACTION) ? "BR_TRANSACTION" : "BR_REPLY",
2356 t->debug_id, t->from ? t->from->proc->pid : 0, 2359 t->debug_id, t->from ? t->from->proc->pid : 0,
@@ -2929,7 +2932,7 @@ static char *print_binder_transaction(char *buf, char *end, const char *prefix,
2929 if (buf >= end) 2932 if (buf >= end)
2930 return buf; 2933 return buf;
2931 } 2934 }
2932 buf += snprintf(buf, end - buf, " size %d:%d data %p\n", 2935 buf += snprintf(buf, end - buf, " size %zd:%zd data %p\n",
2933 t->buffer->data_size, t->buffer->offsets_size, 2936 t->buffer->data_size, t->buffer->offsets_size,
2934 t->buffer->data); 2937 t->buffer->data);
2935 return buf; 2938 return buf;
@@ -2937,7 +2940,7 @@ static char *print_binder_transaction(char *buf, char *end, const char *prefix,
2937 2940
2938static char *print_binder_buffer(char *buf, char *end, const char *prefix, struct binder_buffer *buffer) 2941static char *print_binder_buffer(char *buf, char *end, const char *prefix, struct binder_buffer *buffer)
2939{ 2942{
2940 buf += snprintf(buf, end - buf, "%s %d: %p size %d:%d %s\n", 2943 buf += snprintf(buf, end - buf, "%s %d: %p size %zd:%zd %s\n",
2941 prefix, buffer->debug_id, buffer->data, 2944 prefix, buffer->debug_id, buffer->data,
2942 buffer->data_size, buffer->offsets_size, 2945 buffer->data_size, buffer->offsets_size,
2943 buffer->transaction ? "active" : "delivered"); 2946 buffer->transaction ? "active" : "delivered");
@@ -3207,7 +3210,7 @@ static char *print_binder_proc_stats(char *buf, char *end, struct binder_proc *p
3207 return buf; 3210 return buf;
3208 buf += snprintf(buf, end - buf, " requested threads: %d+%d/%d\n" 3211 buf += snprintf(buf, end - buf, " requested threads: %d+%d/%d\n"
3209 " ready threads %d\n" 3212 " ready threads %d\n"
3210 " free async space %d\n", proc->requested_threads, 3213 " free async space %zd\n", proc->requested_threads,
3211 proc->requested_threads_started, proc->max_threads, 3214 proc->requested_threads_started, proc->max_threads,
3212 proc->ready_threads, proc->free_async_space); 3215 proc->ready_threads, proc->free_async_space);
3213 if (buf >= end) 3216 if (buf >= end)