Avoid warnings on x86_64 platform. Thanks to Thomas Elste.
authorFlorian Pose <fp@igh-essen.com>
Mon, 19 Oct 2009 13:12:40 +0200
changeset 1543 373cd456dc26
parent 1528 dbc617badc33
child 1544 cfcaf46c5b3f
Avoid warnings on x86_64 platform. Thanks to Thomas Elste.
master/cdev.c
master/datagram.c
master/domain.c
master/foe_request.c
master/fsm_coe.c
master/fsm_foe.c
master/fsm_master.c
master/fsm_pdo.c
master/fsm_pdo_entry.c
master/fsm_slave_scan.c
master/mailbox.c
master/master.c
master/sdo_request.c
master/slave.c
master/slave_config.c
master/voe_handler.c
--- a/master/cdev.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/cdev.c	Mon Oct 19 13:12:40 2009 +0200
@@ -586,7 +586,7 @@
 
     if (domain->data_size != data.data_size) {
         up(&master->master_sem);
-        EC_ERR("Data size mismatch %u/%u!\n",
+        EC_ERR("Data size mismatch %u/%zu!\n",
                 data.data_size, domain->data_size);
         return -EFAULT;
     }
@@ -971,7 +971,7 @@
             || data.offset + data.nwords > slave->sii_nwords) {
         up(&master->master_sem);
         EC_ERR("Invalid SII read offset/size %u/%u for slave "
-                "SII size %u!\n", data.offset,
+                "SII size %zu!\n", data.offset,
                 data.nwords, slave->sii_nwords);
         return -EINVAL;
     }
@@ -2990,7 +2990,7 @@
     data.error_code = request.req.error_code;
 
     if (master->debug_level) {
-        EC_DBG("Read %d bytes via FoE (result = 0x%x).\n",
+        EC_DBG("Read %zd bytes via FoE (result = 0x%x).\n",
                 request.req.data_size, request.req.result);
     }
 
--- a/master/datagram.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/datagram.c	Mon Oct 19 13:12:40 2009 +0200
@@ -149,7 +149,7 @@
     }
 
     if (!(datagram->data = kmalloc(size, GFP_KERNEL))) {
-        EC_ERR("Failed to allocate %u bytes of datagram memory!\n", size);
+        EC_ERR("Failed to allocate %zu bytes of datagram memory!\n", size);
         return -ENOMEM;
     }
 
@@ -516,8 +516,8 @@
         datagram->stats_output_jiffies = jiffies;
     
         if (unlikely(datagram->skip_count)) {
-            EC_WARN("Datagram %x (%s) was SKIPPED %u time%s.\n",
-                    (unsigned int) datagram, datagram->name,
+            EC_WARN("Datagram %p (%s) was SKIPPED %u time%s.\n",
+                    datagram, datagram->name,
                     datagram->skip_count,
                     datagram->skip_count == 1 ? "" : "s");
             datagram->skip_count = 0;
--- a/master/domain.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/domain.c	Mon Oct 19 13:12:40 2009 +0200
@@ -118,7 +118,7 @@
     list_add_tail(&fmmu->list, &domain->fmmu_configs);
 
     if (domain->master->debug_level)
-        EC_DBG("Domain %u: Added %u bytes, total %u.\n", domain->index,
+        EC_DBG("Domain %u: Added %u bytes, total %zu.\n", domain->index,
                 fmmu->data_size, domain->data_size);
 }
 
@@ -213,7 +213,7 @@
     if (domain->data_size && domain->data_origin == EC_ORIG_INTERNAL) {
         if (!(domain->data =
                     (uint8_t *) kmalloc(domain->data_size, GFP_KERNEL))) {
-            EC_ERR("Failed to allocate %u bytes internal memory for"
+            EC_ERR("Failed to allocate %zu bytes internal memory for"
                     " domain %u!\n", domain->data_size, domain->index);
             return -ENOMEM;
         }
@@ -267,12 +267,12 @@
         datagram_count++;
     }
 
-    EC_INFO("Domain%u: Logical address 0x%08x, %u byte, "
+    EC_INFO("Domain%u: Logical address 0x%08x, %zu byte, "
             "expected working counter %u.\n", domain->index,
             domain->logical_base_address, domain->data_size,
             domain->expected_working_counter);
     list_for_each_entry(datagram, &domain->datagrams, list) {
-        EC_INFO("  Datagram %s: Logical offset 0x%08x, %u byte, type %s.\n",
+        EC_INFO("  Datagram %s: Logical offset 0x%08x, %zu byte, type %s.\n",
                 datagram->name, EC_READ_U32(datagram->address),
                 datagram->data_size, ec_datagram_type_string(datagram));
     }
@@ -328,8 +328,8 @@
     int ret;
     
     if (domain->master->debug_level)
-        EC_DBG("ecrt_domain_reg_pdo_entry_list(domain = 0x%x, regs = 0x%x)\n",
-                (u32) domain, (u32) regs);
+        EC_DBG("ecrt_domain_reg_pdo_entry_list(domain = 0x%p, regs = 0x%p)\n",
+                domain, regs);
 
     for (reg = regs; reg->index; reg++) {
         sc = ecrt_master_slave_config_err(domain->master, reg->alias,
@@ -360,8 +360,8 @@
 void ecrt_domain_external_memory(ec_domain_t *domain, uint8_t *mem)
 {
     if (domain->master->debug_level)
-        EC_DBG("ecrt_domain_external_memory(domain = 0x%x, mem = 0x%x)\n",
-                (u32) domain, (u32) mem);
+        EC_DBG("ecrt_domain_external_memory(domain = 0x%p, mem = 0x%p)\n",
+                domain, mem);
 
     down(&domain->master->master_sem);
 
--- a/master/foe_request.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/foe_request.c	Mon Oct 19 13:12:40 2009 +0200
@@ -114,7 +114,7 @@
     ec_foe_request_clear_data(req);
 
     if (!(req->buffer = (uint8_t *) kmalloc(size, GFP_KERNEL))) {
-        EC_ERR("Failed to allocate %u bytes of FoE memory.\n", size);
+        EC_ERR("Failed to allocate %zu bytes of FoE memory.\n", size);
         return -1;
     }
 
--- a/master/fsm_coe.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/fsm_coe.c	Mon Oct 19 13:12:40 2009 +0200
@@ -446,7 +446,7 @@
     }
 
     if (rec_size < 3) {
-        EC_ERR("Received corrupted SDO dictionary response (size %u).\n",
+        EC_ERR("Received corrupted SDO dictionary response (size %zu).\n",
                 rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
@@ -480,7 +480,7 @@
     }
 
     if (rec_size < 8 || rec_size % 2) {
-        EC_ERR("Invalid data size %u!\n", rec_size);
+        EC_ERR("Invalid data size %zu!\n", rec_size);
         ec_print_data(data, rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
@@ -690,7 +690,7 @@
     }
 
     if (rec_size < 3) {
-        EC_ERR("Received corrupted SDO description response (size %u).\n",
+        EC_ERR("Received corrupted SDO description response (size %zu).\n",
                 rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
@@ -707,7 +707,7 @@
     }
 
     if (rec_size < 8) {
-        EC_ERR("Received corrupted SDO description response (size %u).\n",
+        EC_ERR("Received corrupted SDO description response (size %zu).\n",
                 rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
@@ -929,7 +929,7 @@
 
     if (rec_size < 3) {
         EC_ERR("Received corrupted SDO entry description response "
-                "(size %u).\n", rec_size);
+                "(size %zu).\n", rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
     }
@@ -946,7 +946,7 @@
 
     if (rec_size < 9) {
         EC_ERR("Received corrupted SDO entry description response "
-                "(size %u).\n", rec_size);
+                "(size %zu).\n", rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
     }
@@ -969,7 +969,7 @@
     }
 
     if (rec_size < 16) {
-        EC_ERR("Invalid data size %u!\n", rec_size);
+        EC_ERR("Invalid data size %zu!\n", rec_size);
         ec_print_data(data, rec_size);
         fsm->state = ec_fsm_coe_error;
         return;
@@ -1314,7 +1314,7 @@
 
     if (rec_size < 6) {
         fsm->state = ec_fsm_coe_error;
-        EC_ERR("Received data are too small (%u bytes):\n", rec_size);
+        EC_ERR("Received data are too small (%zu bytes):\n", rec_size);
         ec_print_data(data, rec_size);
         return;
     }
@@ -1328,7 +1328,7 @@
         } else {
             sprintf(subidxstr, ":%02X", request->subindex);
         }
-        EC_ERR("SDO download 0x%04X%s (%u bytes) aborted on slave %u.\n",
+        EC_ERR("SDO download 0x%04X%s (%zu bytes) aborted on slave %u.\n",
                 request->index, subidxstr, request->data_size,
                 slave->ring_position);
         if (rec_size < 10) {
@@ -1597,7 +1597,7 @@
 
     if (rec_size < 6) {
         fsm->state = ec_fsm_coe_error;
-        EC_ERR("Received currupted SDO upload response (%u bytes)!\n", rec_size);
+        EC_ERR("Received currupted SDO upload response (%zu bytes)!\n", rec_size);
         ec_print_data(data, rec_size);
         return;
     }
@@ -1657,7 +1657,7 @@
         if (rec_size < 6 + fsm->complete_size) {
             fsm->state = ec_fsm_coe_error;
             EC_ERR("Received currupted SDO expedited upload"
-                    " response (only %u bytes)!\n", rec_size);
+                    " response (only %zu bytes)!\n", rec_size);
             ec_print_data(data, rec_size);
             return;
         }
@@ -1670,7 +1670,7 @@
         if (rec_size < 10) {
             fsm->state = ec_fsm_coe_error;
             EC_ERR("Received currupted SDO normal upload"
-                    " response (only %u bytes)!\n", rec_size);
+                    " response (only %zu bytes)!\n", rec_size);
             ec_print_data(data, rec_size);
             return;
         }
@@ -1699,7 +1699,7 @@
 
         if (data_size < fsm->complete_size) {
             if (master->debug_level)
-                EC_DBG("SDO data incomplete (%u / %u). Segmenting...\n",
+                EC_DBG("SDO data incomplete (%zu / %u). Segmenting...\n",
                         data_size, fsm->complete_size);
 
             ec_fsm_coe_up_prepare_segment_request(fsm);
@@ -1930,7 +1930,7 @@
 
     if (request->data_size != fsm->complete_size) {
         EC_WARN("SDO upload 0x%04X:%02X on slave %u: Assembled data"
-                " size (%u) does not match complete size (%u)!\n",
+                " size (%zu) does not match complete size (%u)!\n",
                 request->index, request->subindex, slave->ring_position,
                 request->data_size, fsm->complete_size);
     }
--- a/master/fsm_foe.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/fsm_foe.c	Mon Oct 19 13:12:40 2009 +0200
@@ -849,7 +849,7 @@
         printk ("ERROR: data doesn't fit in receive buffer\n");
         printk ("       rx_buffer_size  = %d\n", fsm->rx_buffer_size);
         printk ("       rx_buffer_offset= %d\n", fsm->rx_buffer_offset);
-        printk ("       rec_size        = %d\n", rec_size);
+        printk ("       rec_size        = %zd\n", rec_size);
         printk ("       rx_mailbox_size = %d\n",
                 slave->configured_rx_mailbox_size);
         printk ("       rx_last_packet  = %d\n", fsm->rx_last_packet);
--- a/master/fsm_master.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/fsm_master.c	Mon Oct 19 13:12:40 2009 +0200
@@ -366,13 +366,13 @@
         // found pending request; process it!
         if (master->debug_level)
             EC_DBG("Processing register request for slave %u, "
-                    "offset 0x%04x, length %u...\n",
+                    "offset 0x%04x, length %zu...\n",
                     request->slave->ring_position,
                     request->offset, request->length);
 
         if (request->length > fsm->datagram->mem_size) {
-            EC_ERR("Request length (%u) exceeds maximum "
-                    "datagram size (%u)!\n", request->length,
+            EC_ERR("Request length (%zu) exceeds maximum "
+                    "datagram size (%zu)!\n", request->length,
                     fsm->datagram->mem_size);
             request->state = EC_INT_REQUEST_FAILURE;
             wake_up(&master->reg_queue);
@@ -943,7 +943,7 @@
 
     // finished writing SII
     if (master->debug_level)
-        EC_DBG("Finished writing %u words of SII data to slave %u.\n",
+        EC_DBG("Finished writing %zu words of SII data to slave %u.\n",
                 request->nwords, slave->ring_position);
 
     if (request->offset <= 4 && request->offset + request->nwords > 4) {
@@ -990,7 +990,7 @@
 
     // finished transferring FoE
     if (master->debug_level)
-        EC_DBG("Successfully transferred %u bytes of FoE data from/to"
+        EC_DBG("Successfully transferred %zu bytes of FoE data from/to"
                 " slave %u.\n", request->data_size, slave->ring_position);
 
     request->state = EC_INT_REQUEST_SUCCESS;
@@ -1096,7 +1096,7 @@
                 kfree(request->data);
             request->data = kmalloc(request->length, GFP_KERNEL);
             if (!request->data) {
-                EC_ERR("Failed to allocate %u bytes of memory for"
+                EC_ERR("Failed to allocate %zu bytes of memory for"
                         " register data.\n", request->length);
                 request->state = EC_INT_REQUEST_FAILURE;
                 wake_up(&master->reg_queue);
--- a/master/fsm_pdo.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/fsm_pdo.c	Mon Oct 19 13:12:40 2009 +0200
@@ -236,7 +236,7 @@
     }
 
     if (fsm->request.data_size != sizeof(uint8_t)) {
-        EC_ERR("Invalid data size %u returned when uploading SDO 0x%04X:%02X "
+        EC_ERR("Invalid data size %zu returned when uploading SDO 0x%04X:%02X "
                 "from slave %u.\n", fsm->request.data_size,
                 fsm->request.index, fsm->request.subindex,
                 fsm->slave->ring_position);
@@ -298,7 +298,7 @@
     }
 
     if (fsm->request.data_size != sizeof(uint16_t)) {
-        EC_ERR("Invalid data size %u returned when uploading SDO 0x%04X:%02X "
+        EC_ERR("Invalid data size %zu returned when uploading SDO 0x%04X:%02X "
                 "from slave %u.\n", fsm->request.data_size,
                 fsm->request.index, fsm->request.subindex,
                 fsm->slave->ring_position);
--- a/master/fsm_pdo_entry.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/fsm_pdo_entry.c	Mon Oct 19 13:12:40 2009 +0200
@@ -193,7 +193,7 @@
     }
 
     if (fsm->request.data_size != sizeof(uint8_t)) {
-        EC_ERR("Invalid data size %u at uploading SDO 0x%04X:%02X.\n",
+        EC_ERR("Invalid data size %zu at uploading SDO 0x%04X:%02X.\n",
                 fsm->request.data_size, fsm->request.index,
                 fsm->request.subindex);
         fsm->state = ec_fsm_pdo_entry_state_error;
@@ -248,7 +248,7 @@
     }
 
     if (fsm->request.data_size != sizeof(uint32_t)) {
-        EC_ERR("Invalid data size %u at uploading SDO 0x%04X:%02X.\n",
+        EC_ERR("Invalid data size %zu at uploading SDO 0x%04X:%02X.\n",
                 fsm->request.data_size, fsm->request.index,
                 fsm->request.subindex);
         fsm->state = ec_fsm_pdo_entry_state_error;
--- a/master/fsm_slave_scan.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/fsm_slave_scan.c	Mon Oct 19 13:12:40 2009 +0200
@@ -544,7 +544,7 @@
 
     if (!(slave->sii_words =
                 (uint16_t *) kmalloc(slave->sii_nwords * 2, GFP_KERNEL))) {
-        EC_ERR("Failed to allocate %u words of SII data for slave %u.\n",
+        EC_ERR("Failed to allocate %zu words of SII data for slave %u.\n",
                slave->sii_nwords, slave->ring_position);
         slave->sii_nwords = 0;
         slave->error_flag = 1;
--- a/master/mailbox.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/mailbox.c	Mon Oct 19 13:12:40 2009 +0200
@@ -66,7 +66,7 @@
     total_size = EC_MBOX_HEADER_SIZE + size;
 
     if (unlikely(total_size > slave->configured_rx_mailbox_size)) {
-        EC_ERR("Data size (%u) does not fit in mailbox (%u)!\n",
+        EC_ERR("Data size (%zu) does not fit in mailbox (%u)!\n",
                 total_size, slave->configured_rx_mailbox_size);
         return ERR_PTR(-EOVERFLOW);
     }
--- a/master/master.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/master.c	Mon Oct 19 13:12:40 2009 +0200
@@ -671,7 +671,7 @@
         if (queued_datagram == datagram) {
             datagram->skip_count++;
             if (master->debug_level)
-                EC_DBG("skipping datagram %x.\n", (unsigned int) datagram);
+                EC_DBG("skipping datagram %p.\n", datagram);
             datagram->state = EC_DATAGRAM_QUEUED;
             return;
         }
@@ -785,7 +785,7 @@
             EC_WRITE_U8(cur_data++, 0x00);
 
         if (unlikely(master->debug_level > 1))
-            EC_DBG("frame size: %u\n", cur_data - frame_data);
+            EC_DBG("frame size: %zu\n", cur_data - frame_data);
 
         // send frame
         ec_device_send(&master->main_device, cur_data - frame_data);
@@ -839,7 +839,7 @@
 
     if (unlikely(size < EC_FRAME_HEADER_SIZE)) {
         if (master->debug_level) {
-            EC_DBG("Corrupted frame received (size %u < %u byte):\n",
+            EC_DBG("Corrupted frame received (size %zu < %u byte):\n",
                     size, EC_FRAME_HEADER_SIZE);
             ec_print_data(frame_data, size);
         }
@@ -856,8 +856,8 @@
 
     if (unlikely(frame_size > size)) {
         if (master->debug_level) {
-            EC_DBG("Corrupted frame received (invalid frame size %u for "
-                    "received size %u):\n", frame_size, size);
+            EC_DBG("Corrupted frame received (invalid frame size %zu for "
+                    "received size %zu):\n", frame_size, size);
             ec_print_data(frame_data, size);
         }
         master->stats.corrupted++;
@@ -877,7 +877,7 @@
         if (unlikely(cur_data - frame_data
                      + data_size + EC_DATAGRAM_FOOTER_SIZE > size)) {
             if (master->debug_level) {
-                EC_DBG("Corrupted frame received (invalid data size %u):\n",
+                EC_DBG("Corrupted frame received (invalid data size %zu):\n",
                         data_size);
                 ec_print_data(frame_data, size);
             }
@@ -1587,7 +1587,7 @@
     unsigned int index;
 
     if (master->debug_level)
-        EC_DBG("ecrt_master_create_domain(master = 0x%x)\n", (u32) master);
+        EC_DBG("ecrt_master_create_domain(master = 0x%p)\n", master);
 
     if (!(domain = (ec_domain_t *) kmalloc(sizeof(ec_domain_t), GFP_KERNEL))) {
         EC_ERR("Error allocating domain memory!\n");
@@ -1633,7 +1633,7 @@
     int ret;
 
     if (master->debug_level)
-        EC_DBG("ecrt_master_activate(master = 0x%x)\n", (u32) master);
+        EC_DBG("ecrt_master_activate(master = 0x%p)\n", master);
 
     down(&master->master_sem);
 
@@ -1643,7 +1643,7 @@
         ret = ec_domain_finish(domain, domain_offset);
         if (ret < 0) {
             up(&master->master_sem);
-            EC_ERR("Failed to finish domain 0x%08X!\n", (u32) domain);
+            EC_ERR("Failed to finish domain 0x%p!\n", domain);
             return ret;
         }
         domain_offset += domain->data_size;
@@ -1663,7 +1663,7 @@
     ec_master_thread_stop(master);
 
     if (master->debug_level)
-        EC_DBG("FSM datagram is %x.\n", (unsigned int) &master->fsm_datagram);
+        EC_DBG("FSM datagram is %p.\n", &master->fsm_datagram);
 
     master->injection_seq_fsm = 0;
     master->injection_seq_rt = 0;
@@ -1751,8 +1751,8 @@
                 time_us = (unsigned int) ((master->main_device.jiffies_poll -
                             datagram->jiffies_sent) * 1000000 / HZ);
 #endif
-                EC_DBG("TIMED OUT datagram %08x, index %02X waited %u us.\n",
-                        (unsigned int) datagram, datagram->index, time_us);
+                EC_DBG("TIMED OUT datagram %p, index %02X waited %u us.\n",
+                        datagram, datagram->index, time_us);
             }
         }
     }
@@ -1788,9 +1788,9 @@
 
 
     if (master->debug_level)
-        EC_DBG("ecrt_master_slave_config(master = 0x%x, alias = %u, "
+        EC_DBG("ecrt_master_slave_config(master = 0x%p, alias = %u, "
                 "position = %u, vendor_id = 0x%08x, product_code = 0x%08x)\n",
-                (u32) master, alias, position, vendor_id, product_code);
+                master, alias, position, vendor_id, product_code);
 
     list_for_each_entry(sc, &master->configs, list) {
         if (sc->alias == alias && sc->position == position) {
@@ -1851,9 +1851,9 @@
         void (*send_cb)(void *), void (*receive_cb)(void *), void *cb_data)
 {
     if (master->debug_level)
-        EC_DBG("ecrt_master_callbacks(master = 0x%x, send_cb = 0x%x, "
-                " receive_cb = 0x%x, cb_data = 0x%x)\n", (u32) master,
-                (u32) send_cb, (u32) receive_cb, (u32) cb_data);
+        EC_DBG("ecrt_master_callbacks(master = 0x%p, send_cb = 0x%p, "
+                " receive_cb = 0x%p, cb_data = 0x%p)\n", master,
+                send_cb, receive_cb, cb_data);
 
     master->app_send_cb = send_cb;
     master->app_receive_cb = receive_cb;
--- a/master/sdo_request.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/sdo_request.c	Mon Oct 19 13:12:40 2009 +0200
@@ -145,7 +145,7 @@
     ec_sdo_request_clear_data(req);
 
     if (!(req->data = (uint8_t *) kmalloc(size, GFP_KERNEL))) {
-        EC_ERR("Failed to allocate %u bytes of SDO memory.\n", size);
+        EC_ERR("Failed to allocate %zu bytes of SDO memory.\n", size);
         return -ENOMEM;
     }
 
--- a/master/slave.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/slave.c	Mon Oct 19 13:12:40 2009 +0200
@@ -321,7 +321,7 @@
     uint8_t flags;
 
     if (data_size != 32) {
-        EC_ERR("Wrong size of general category (%u/32) in slave %u.\n",
+        EC_ERR("Wrong size of general category (%zu/32) in slave %u.\n",
                 data_size, slave->ring_position);
         return -EINVAL;
     }
@@ -376,7 +376,7 @@
 
     // one sync manager struct is 4 words long
     if (data_size % 8) {
-        EC_ERR("Invalid SII sync manager category size %u in slave %u.\n",
+        EC_ERR("Invalid SII sync manager category size %zu in slave %u.\n",
                 data_size, slave->ring_position);
         return -EINVAL;
     }
@@ -391,7 +391,7 @@
         }
         memsize = sizeof(ec_sync_t) * total_count;
         if (!(syncs = kmalloc(memsize, GFP_KERNEL))) {
-            EC_ERR("Failed to allocate %u bytes for sync managers.\n",
+            EC_ERR("Failed to allocate %zu bytes for sync managers.\n",
                     memsize);
             return -ENOMEM;
         }
--- a/master/slave_config.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/slave_config.c	Mon Oct 19 13:12:40 2009 +0200
@@ -418,9 +418,9 @@
     ec_sync_config_t *sync_config;
     
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_sync_manager(sc = 0x%x, sync_index = %u, "
+        EC_DBG("ecrt_slave_config_sync_manager(sc = 0x%p, sync_index = %u, "
                 "dir = %i, watchdog_mode = %i)\n",
-                (u32) sc, sync_index, dir, watchdog_mode);
+                 sc, sync_index, dir, watchdog_mode);
 
     if (sync_index >= EC_MAX_SYNC_MANAGERS) {
         EC_ERR("Invalid sync manager index %u!\n", sync_index);
@@ -444,8 +444,8 @@
         uint16_t divider, uint16_t intervals)
 {
     if (sc->master->debug_level)
-        EC_DBG("%s(sc = 0x%x, divider = %u, intervals = %u)\n",
-                __func__, (u32) sc, divider, intervals);
+        EC_DBG("%s(sc = 0x%p, divider = %u, intervals = %u)\n",
+                __func__, sc, divider, intervals);
 
     sc->watchdog_divider = divider;
     sc->watchdog_intervals = intervals;
@@ -459,8 +459,8 @@
     ec_pdo_t *pdo;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_pdo_assign_add(sc = 0x%x, sync_index = %u, "
-                "pdo_index = 0x%04X)\n", (u32) sc, sync_index, pdo_index);
+        EC_DBG("ecrt_slave_config_pdo_assign_add(sc = 0x%p, sync_index = %u, "
+                "pdo_index = 0x%04X)\n", sc, sync_index, pdo_index);
 
     if (sync_index >= EC_MAX_SYNC_MANAGERS) {
         EC_ERR("Invalid sync manager index %u!\n", sync_index);
@@ -488,8 +488,8 @@
         uint8_t sync_index)
 {
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_pdo_assign_clear(sc = 0x%x, "
-                "sync_index = %u)\n", (u32) sc, sync_index);
+        EC_DBG("ecrt_slave_config_pdo_assign_clear(sc = 0x%p, "
+                "sync_index = %u)\n", sc, sync_index);
 
     if (sync_index >= EC_MAX_SYNC_MANAGERS) {
         EC_ERR("Invalid sync manager index %u!\n", sync_index);
@@ -513,10 +513,10 @@
     int retval = 0;
     
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_pdo_mapping_add(sc = 0x%x, "
+        EC_DBG("ecrt_slave_config_pdo_mapping_add(sc = 0x%p, "
                 "pdo_index = 0x%04X, entry_index = 0x%04X, "
                 "entry_subindex = 0x%02X, entry_bit_length = %u)\n",
-                (u32) sc, pdo_index, entry_index, entry_subindex,
+                sc, pdo_index, entry_index, entry_subindex,
                 entry_bit_length);
 
     for (sync_index = 0; sync_index < EC_MAX_SYNC_MANAGERS; sync_index++)
@@ -549,8 +549,8 @@
     ec_pdo_t *pdo = NULL;
     
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_pdo_mapping_clear(sc = 0x%x, "
-                "pdo_index = 0x%04X)\n", (u32) sc, pdo_index);
+        EC_DBG("ecrt_slave_config_pdo_mapping_clear(sc = 0x%p, "
+                "pdo_index = 0x%04X)\n", sc, pdo_index);
 
     for (sync_index = 0; sync_index < EC_MAX_SYNC_MANAGERS; sync_index++)
         if ((pdo = ec_pdo_list_find_pdo(
@@ -579,8 +579,8 @@
     const ec_pdo_entry_info_t *entry_info;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_pdos(sc = 0x%x, n_syncs = %u, "
-                "syncs = 0x%x)\n", (u32) sc, n_syncs, (u32) syncs);
+        EC_DBG("ecrt_slave_config_pdos(sc = 0x%p, n_syncs = %u, "
+                "syncs = 0x%p)\n", sc, n_syncs, syncs);
 
     if (!syncs)
         return 0;
@@ -651,9 +651,9 @@
     int sync_offset;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_reg_pdo_entry(sc = 0x%x, index = 0x%04X, "
-                "subindex = 0x%02X, domain = 0x%x, bit_position = 0x%x)\n",
-                (u32) sc, index, subindex, (u32) domain, (u32) bit_position);
+        EC_DBG("ecrt_slave_config_reg_pdo_entry(sc = 0x%p, index = 0x%04X, "
+                "subindex = 0x%02X, domain = 0x%p, bit_position = 0x%p)\n",
+                sc, index, subindex, domain, bit_position);
 
     for (sync_index = 0; sync_index < EC_MAX_SYNC_MANAGERS; sync_index++) {
         sync_config = &sc->sync_configs[sync_index];
@@ -713,9 +713,9 @@
     int ret;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_sdo(sc = 0x%x, index = 0x%04X, "
-                "subindex = 0x%02X, data = 0x%x, size = %u)\n", (u32) sc,
-                index, subindex, (u32) data, size);
+        EC_DBG("ecrt_slave_config_sdo(sc = 0x%p, index = 0x%04X, "
+                "subindex = 0x%02X, data = 0x%p, size = %zu)\n", sc,
+                index, subindex, data, size);
 
     if (slave && !(slave->sii.mailbox_protocols & EC_MBOX_COE)) {
         EC_ERR("Slave %u does not support CoE!\n", slave->ring_position);
@@ -752,8 +752,8 @@
     uint8_t data[1];
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_sdo8(sc = 0x%x, index = 0x%04X, "
-                "subindex = 0x%02X, value = %u)\n", (u32) sc,
+        EC_DBG("ecrt_slave_config_sdo8(sc = 0x%p, index = 0x%04X, "
+                "subindex = 0x%02X, value = %u)\n", sc,
                 index, subindex, (u32) value);
 
     EC_WRITE_U8(data, value);
@@ -768,8 +768,8 @@
     uint8_t data[2];
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_sdo16(sc = 0x%x, index = 0x%04X, "
-                "subindex = 0x%02X, value = %u)\n", (u32) sc,
+        EC_DBG("ecrt_slave_config_sdo16(sc = 0x%p, index = 0x%04X, "
+                "subindex = 0x%02X, value = %u)\n", sc,
                 index, subindex, value);
 
     EC_WRITE_U16(data, value);
@@ -784,8 +784,8 @@
     uint8_t data[4];
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_sdo32(sc = 0x%x, index = 0x%04X, "
-                "subindex = 0x%02X, value = %u)\n", (u32) sc,
+        EC_DBG("ecrt_slave_config_sdo32(sc = 0x%p, index = 0x%04X, "
+                "subindex = 0x%02X, value = %u)\n", sc,
                 index, subindex, value);
 
     EC_WRITE_U32(data, value);
@@ -802,9 +802,8 @@
     int ret;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_complete_sdo(sc = 0x%x, index = 0x%04X, "
-                "data = 0x%x, size = %u)\n", (u32) sc,
-                index, (u32) data, size);
+        EC_DBG("ecrt_slave_config_complete_sdo(sc = 0x%p, index = 0x%04X, "
+                "data = 0x%p, size = %zu)\n", sc, index, data, size);
 
     if (slave && !(slave->sii.mailbox_protocols & EC_MBOX_COE)) {
         EC_ERR("Slave %u does not support CoE!\n", slave->ring_position);
@@ -846,8 +845,8 @@
     int ret;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_create_sdo_request(sc = 0x%x, "
-                "index = 0x%04X, subindex = 0x%02X, size = %u)\n", (u32) sc,
+        EC_DBG("ecrt_slave_config_create_sdo_request(sc = 0x%p, "
+                "index = 0x%04X, subindex = 0x%02X, size = %zu)\n", sc,
                 index, subindex, size);
 
     if (!(req = (ec_sdo_request_t *)
@@ -899,8 +898,8 @@
     int ret;
 
     if (sc->master->debug_level)
-        EC_DBG("ecrt_slave_config_create_voe_handler(sc = 0x%x, size = %u)\n",
-                (u32) sc, size);
+        EC_DBG("ecrt_slave_config_create_voe_handler(sc = 0x%p, size = %zu)\n",
+                sc, size);
 
     if (!(voe = (ec_voe_handler_t *)
                 kmalloc(sizeof(ec_voe_handler_t), GFP_KERNEL))) {
--- a/master/voe_handler.c	Thu Aug 13 15:18:53 2009 +0200
+++ b/master/voe_handler.c	Mon Oct 19 13:12:40 2009 +0200
@@ -212,7 +212,7 @@
     uint8_t *data;
 
     if (slave->master->debug_level) {
-        EC_DBG("Writing %u bytes of VoE data to slave %u.\n",
+        EC_DBG("Writing %zu bytes of VoE data to slave %u.\n",
                voe->data_size, slave->ring_position);
         ec_print_data(ecrt_voe_handler_data(voe), voe->data_size);
     }
@@ -419,7 +419,7 @@
     if (rec_size < EC_VOE_HEADER_SIZE) {
         voe->state = ec_voe_handler_state_error;
         voe->request_state = EC_INT_REQUEST_FAILURE;
-        EC_ERR("Received VoE header is incomplete (%u bytes)!\n", rec_size);
+        EC_ERR("Received VoE header is incomplete (%zu bytes)!\n", rec_size);
         return;
     }
 
@@ -519,7 +519,7 @@
     if (rec_size < EC_VOE_HEADER_SIZE) {
         voe->state = ec_voe_handler_state_error;
         voe->request_state = EC_INT_REQUEST_FAILURE;
-        EC_ERR("Received VoE header is incomplete (%u bytes)!\n", rec_size);
+        EC_ERR("Received VoE header is incomplete (%zu bytes)!\n", rec_size);
         return;
     }