Made send_interval variable an unsigned int; fixed format specifiers for
authorFlorian Pose <fp@igh-essen.com>
Thu, 20 May 2010 12:35:36 +0200
changeset 1930 59a50053ccc6
parent 1929 b5dab7ee6cf7
child 1931 831f2d34664c
Made send_interval variable an unsigned int; fixed format specifiers for
size_t variables.
master/fsm_slave.c
master/master.c
master/master.h
master/module.c
--- a/master/fsm_slave.c	Thu May 20 11:16:37 2010 +0200
+++ b/master/fsm_slave.c	Thu May 20 12:35:36 2010 +0200
@@ -311,7 +311,7 @@
     }
 
     // finished transferring FoE
-    EC_SLAVE_DBG(slave, 1, "Successfully transferred %u bytes of FoE"
+    EC_SLAVE_DBG(slave, 1, "Successfully transferred %zu bytes of FoE"
             " data.\n", request->data_size);
 
     request->state = EC_INT_REQUEST_SUCCESS;
--- a/master/master.c	Thu May 20 11:16:37 2010 +0200
+++ b/master/master.c	Thu May 20 12:35:36 2010 +0200
@@ -698,7 +698,7 @@
                 list_del_init(&datagram->queue);
                 datagram->state = EC_DATAGRAM_ERROR;
                 EC_MASTER_ERR(master, "External datagram %p is too large,"
-                        " size=%u, max_queue_size=%u\n",
+                        " size=%zu, max_queue_size=%zu\n",
                         datagram, datagram->data_size,
                         master->max_queue_size);
             } else {
@@ -725,8 +725,8 @@
                         ((jiffies - datagram->jiffies_sent) * 1000000 / HZ);
 #endif
                     EC_MASTER_ERR(master, "Timeout %u us: Injecting"
-                            " external datagram %p size=%u,"
-                            " max_queue_size=%u\n", time_us, datagram,
+                            " external datagram %p size=%zu,"
+                            " max_queue_size=%zu\n", time_us, datagram,
                             datagram->data_size, master->max_queue_size);
                 }
 #if DEBUG_INJECT
@@ -749,7 +749,7 @@
  */
 void ec_master_set_send_interval(
         ec_master_t *master, /**< EtherCAT master */
-        size_t send_interval /**< Send interval */
+        unsigned int send_interval /**< Send interval */
         )
 {
     master->send_interval = send_interval;
@@ -1198,8 +1198,8 @@
     // send interval in IDLE phase
     ec_master_set_send_interval(master, 1000000 / HZ); 
 
-    EC_MASTER_DBG(master, 1, "Idle thread running with send interval = %d us,"
-            " max data size=%d\n", master->send_interval,
+    EC_MASTER_DBG(master, 1, "Idle thread running with send interval = %u us,"
+            " max data size=%zu\n", master->send_interval,
             master->max_queue_size);
 
     while (!kthread_should_stop()) {
@@ -1265,7 +1265,7 @@
     int fsm_exec;
 
     EC_MASTER_DBG(master, 1, "Operation thread running"
-            " with fsm interval = %d us, max data size=%d\n",
+            " with fsm interval = %u us, max data size=%zu\n",
             master->send_interval, master->max_queue_size);
 
     while (!kthread_should_stop()) {
@@ -1989,8 +1989,8 @@
     int eoe_was_running;
 #endif
 
-    EC_MASTER_DBG(master, 1, "ecrt_master_deactivate(master = 0x%x)\n",
-            (u32) master);
+    EC_MASTER_DBG(master, 1, "ecrt_master_deactivate(master = 0x%p)\n",
+            master);
 
     if (!master->active) {
         EC_MASTER_WARN(master, "%s: Master not active.\n", __func__);
--- a/master/master.h	Thu May 20 11:16:37 2010 +0200
+++ b/master/master.h	Thu May 20 12:35:36 2010 +0200
@@ -211,7 +211,7 @@
                                       ext_datagram_queue. */
 
     struct list_head external_datagram_queue; /**< External Datagram queue. */
-    size_t send_interval; /**< Interval between calls to ecrt_master_send */
+    unsigned int send_interval; /**< Interval between calls to ecrt_master_send */
     size_t max_queue_size; /**< Maximum size of datagram queue */
     struct list_head domains; /**< List of domains. */
 
@@ -275,7 +275,7 @@
 void ec_master_inject_external_datagrams(ec_master_t *);
 
 // misc.
-void ec_master_set_send_interval(ec_master_t *,size_t);
+void ec_master_set_send_interval(ec_master_t *, unsigned int);
 void ec_master_attach_slave_configs(ec_master_t *);
 ec_slave_t *ec_master_find_slave(ec_master_t *, uint16_t, uint16_t);
 const ec_slave_t *ec_master_find_slave_const(const ec_master_t *, uint16_t,
--- a/master/module.c	Thu May 20 11:16:37 2010 +0200
+++ b/master/module.c	Thu May 20 12:35:36 2010 +0200
@@ -341,13 +341,14 @@
     EC_DBG("");
     for (i = 0; i < size; i++) {
         printk("%02X ", data[i]);
+
         if ((i + 1) % 16 == 0 && i < size - 1) {
             printk("\n");
             EC_DBG("");
         }
-        if (i+1 == 128 && size > 256)
-        {
-            printk("dropped %d bytes\n",size-128-i);
+
+        if (i + 1 == 128 && size > 256) {
+            printk("dropped %zu bytes\n", size - 128 - i);
             i = size - 128;
             EC_DBG("");
         }