From 05bb0a266ee1b40cdfa40e502f04c1b68838f838 Mon Sep 17 00:00:00 2001 From: Florian Pose <fp@igh-essen.com> Date: Thu, 20 May 2010 12:46:09 +0200 Subject: [PATCH] Fixed format specifiers. --- master/cdev.c | 9 ++++----- master/fsm_coe.c | 34 +++++++++++++++++----------------- master/fsm_master.c | 8 ++++---- master/fsm_slave_config.c | 12 ++++++------ master/fsm_soe.c | 12 ++++++------ master/slave_config.c | 4 ++-- master/voe_handler.c | 4 ++-- 7 files changed, 41 insertions(+), 42 deletions(-) diff --git a/master/cdev.c b/master/cdev.c index 2b3532af..e2eca4db 100644 --- a/master/cdev.c +++ b/master/cdev.c @@ -3514,7 +3514,7 @@ int eccdev_open(struct inode *inode, struct file *filp) filp->private_data = priv; #if DEBUG_IOCTL - EC_MASTER_DBG(cdev->master, "File opened.\n"); + EC_MASTER_DBG(cdev->master, 0, "File opened.\n"); #endif return 0; } @@ -3535,7 +3535,7 @@ int eccdev_release(struct inode *inode, struct file *filp) vfree(priv->process_data); #if DEBUG_IOCTL - EC_MASTER_DBG(master, "File closed.\n"); + EC_MASTER_DBG(master, 0, "File closed.\n"); #endif kfree(priv); @@ -3552,9 +3552,8 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ec_master_t *master = priv->cdev->master; #if DEBUG_IOCTL - EC_MASTER_DBG(master, "ioctl(filp = 0x%x, cmd = 0x%08x (0x%02x)," - " arg = 0x%x)\n", (u32) filp, (u32) cmd, (u32) _IOC_NR(cmd), - (u32) arg); + EC_MASTER_DBG(master, 0, "ioctl(filp = 0x%p, cmd = 0x%08x (0x%02x)," + " arg = 0x%lx)\n", filp, cmd, _IOC_NR(cmd), arg); #endif switch (cmd) { diff --git a/master/fsm_coe.c b/master/fsm_coe.c index 08987d5e..d1dc41e9 100644 --- a/master/fsm_coe.c +++ b/master/fsm_coe.c @@ -1225,9 +1225,9 @@ void ec_fsm_coe_down_request(ec_fsm_coe_t *fsm /**< finite state machine */) if (!datagram->working_counter) { if (diff_ms < fsm->request->response_timeout) { #if DEBUG_RETRIES - EC_SLAVE_DBG(slave, 1, "Slave did not respond to" - " SDO download request. Retrying after %u ms...\n", - (u32) diff_ms); + EC_SLAVE_DBG(slave, 1, "Slave did not respond to SDO" + " download request. Retrying after %lu ms...\n", + diff_ms); #endif // no response; send request datagram again return; @@ -1235,16 +1235,16 @@ void ec_fsm_coe_down_request(ec_fsm_coe_t *fsm /**< finite state machine */) } fsm->state = ec_fsm_coe_error; EC_SLAVE_ERR(slave, "Reception of CoE download request" - " for SDO 0x%04x:%x failed with timeout after %u ms: ", - fsm->request->index, fsm->request->subindex, (u32) diff_ms); + " for SDO 0x%04x:%x failed with timeout after %lu ms: ", + fsm->request->index, fsm->request->subindex, diff_ms); ec_datagram_print_wc_error(datagram); return; } #if DEBUG_LONG if (diff_ms > 200) { - EC_SLAVE_WARN(slave, "SDO 0x%04x:%x download took %u ms.\n", - fsm->request->index, fsm->request->subindex, (u32) diff_ms); + EC_SLAVE_WARN(slave, "SDO 0x%04x:%x download took %lu ms.\n", + fsm->request->index, fsm->request->subindex, diff_ms); } #endif @@ -1288,8 +1288,8 @@ void ec_fsm_coe_down_check(ec_fsm_coe_t *fsm /**< finite state machine */) (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= fsm->request->response_timeout) { fsm->state = ec_fsm_coe_error; - EC_SLAVE_ERR(slave, "Timeout after %u ms while waiting" - " for SDO 0x%04x:%x download response.\n", (u32) diff_ms, + EC_SLAVE_ERR(slave, "Timeout after %lu ms while waiting" + " for SDO 0x%04x:%x download response.\n", diff_ms, fsm->request->index, fsm->request->subindex); return; } @@ -1727,8 +1727,8 @@ void ec_fsm_coe_up_request(ec_fsm_coe_t *fsm /**< finite state machine */) if (diff_ms < fsm->request->response_timeout) { #if DEBUG_RETRIES EC_SLAVE_DBG(slave, 1, "Slave did not respond to" - " SDO upload request. Retrying after %u ms...\n", - (u32) diff_ms); + " SDO upload request. Retrying after %lu ms...\n", + diff_ms); #endif // no response; send request datagram again return; @@ -1736,16 +1736,16 @@ void ec_fsm_coe_up_request(ec_fsm_coe_t *fsm /**< finite state machine */) } fsm->state = ec_fsm_coe_error; EC_SLAVE_ERR(slave, "Reception of CoE upload request for" - " SDO 0x%04x:%x failed with timeout after %u ms: ", - fsm->request->index, fsm->request->subindex, (u32) diff_ms); + " SDO 0x%04x:%x failed with timeout after %lu ms: ", + fsm->request->index, fsm->request->subindex, diff_ms); ec_datagram_print_wc_error(datagram); return; } #if DEBUG_LONG if (diff_ms > 200) { - EC_SLAVE_WARN(slave, "SDO 0x%04x:%x upload took %u ms.\n", - fsm->request->index, fsm->request->subindex, (u32) diff_ms); + EC_SLAVE_WARN(slave, "SDO 0x%04x:%x upload took %lu ms.\n", + fsm->request->index, fsm->request->subindex, diff_ms); } #endif @@ -1790,8 +1790,8 @@ void ec_fsm_coe_up_check(ec_fsm_coe_t *fsm /**< finite state machine */) (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= fsm->request->response_timeout) { fsm->state = ec_fsm_coe_error; - EC_SLAVE_ERR(slave, "Timeout after %u ms while waiting for" - " SDO 0x%04x:%x upload response.\n", (u32) diff_ms, + EC_SLAVE_ERR(slave, "Timeout after %lu ms while waiting for" + " SDO 0x%04x:%x upload response.\n", diff_ms, fsm->request->index, fsm->request->subindex); return; } diff --git a/master/fsm_master.c b/master/fsm_master.c index a96a7a4c..cd0f1709 100644 --- a/master/fsm_master.c +++ b/master/fsm_master.c @@ -792,8 +792,8 @@ void ec_fsm_master_state_scan_slave( return; } - EC_MASTER_INFO(master, "Bus scanning completed in %u ms.\n", - (u32) (jiffies - fsm->scan_jiffies) * 1000 / HZ); + EC_MASTER_INFO(master, "Bus scanning completed in %lu ms.\n", + (jiffies - fsm->scan_jiffies) * 1000 / HZ); master->scan_busy = 0; wake_up_interruptible(&master->scan_queue); @@ -907,9 +907,9 @@ u64 ec_fsm_master_dc_offset32( EC_SLAVE_DBG(slave, 1, "DC system time offset calculation:" " system_time=%u (corrected with %u)," - " app_time=%u, diff=%i\n", + " app_time=%llu, diff=%i\n", system_time32, correction, - (u32) slave->master->app_time, time_diff); + slave->master->app_time, time_diff); if (EC_ABS(time_diff) > EC_SYSTEM_TIME_TOLERANCE_NS) { new_offset = time_diff + old_offset32; diff --git a/master/fsm_slave_config.c b/master/fsm_slave_config.c index d7f156cc..50f7e934 100644 --- a/master/fsm_slave_config.c +++ b/master/fsm_slave_config.c @@ -1242,11 +1242,11 @@ void ec_fsm_slave_config_state_dc_sync_check( if (abs_sync_diff > EC_DC_MAX_SYNC_DIFF_NS) { if (diff_ms >= EC_DC_SYNC_WAIT_MS) { - EC_SLAVE_WARN(slave, "Slave did not sync after %u ms.\n", - (u32) diff_ms); + EC_SLAVE_WARN(slave, "Slave did not sync after %lu ms.\n", + diff_ms); } else { - EC_SLAVE_DBG(slave, 1, "Sync after %4u ms: %10u ns\n", - (u32) diff_ms, abs_sync_diff); + EC_SLAVE_DBG(slave, 1, "Sync after %4lu ms: %10u ns\n", + diff_ms, abs_sync_diff); // check synchrony again ec_datagram_fprd(datagram, slave->station_address, 0x092c, 4); @@ -1254,8 +1254,8 @@ void ec_fsm_slave_config_state_dc_sync_check( return; } } else { - EC_SLAVE_DBG(slave, 1, "%u ns difference after %u ms.\n", - abs_sync_diff, (u32) diff_ms); + EC_SLAVE_DBG(slave, 1, "%u ns difference after %lu ms.\n", + abs_sync_diff, diff_ms); } // set DC start time diff --git a/master/fsm_soe.c b/master/fsm_soe.c index 1f400fe8..a43ba117 100644 --- a/master/fsm_soe.c +++ b/master/fsm_soe.c @@ -265,7 +265,7 @@ void ec_fsm_soe_read_request(ec_fsm_soe_t *fsm /**< finite state machine */) } fsm->state = ec_fsm_soe_error; EC_SLAVE_ERR(slave, "Reception of SoE read request" - " failed after %u ms: ", (u32) diff_ms); + " failed after %lu ms: ", diff_ms); ec_datagram_print_wc_error(datagram); ec_fsm_soe_print_error(fsm); return; @@ -311,8 +311,8 @@ void ec_fsm_soe_read_check(ec_fsm_soe_t *fsm /**< finite state machine */) (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= EC_SOE_RESPONSE_TIMEOUT) { fsm->state = ec_fsm_soe_error; - EC_SLAVE_ERR(slave, "Timeout after %u ms while waiting for" - " read response.\n", (u32) diff_ms); + EC_SLAVE_ERR(slave, "Timeout after %lu ms while waiting for" + " read response.\n", diff_ms); ec_fsm_soe_print_error(fsm); return; } @@ -563,7 +563,7 @@ void ec_fsm_soe_write_request(ec_fsm_soe_t *fsm /**< finite state machine */) } fsm->state = ec_fsm_soe_error; EC_SLAVE_ERR(slave, "Reception of SoE write request" - " failed after %u ms: ", (u32) diff_ms); + " failed after %lu ms: ", diff_ms); ec_datagram_print_wc_error(datagram); ec_fsm_soe_print_error(fsm); return; @@ -613,8 +613,8 @@ void ec_fsm_soe_write_check(ec_fsm_soe_t *fsm /**< finite state machine */) (datagram->jiffies_received - fsm->jiffies_start) * 1000 / HZ; if (diff_ms >= EC_SOE_RESPONSE_TIMEOUT) { fsm->state = ec_fsm_soe_error; - EC_SLAVE_ERR(slave, "Timeout after %u ms while waiting" - " for write response.\n", (u32) diff_ms); + EC_SLAVE_ERR(slave, "Timeout after %lu ms while waiting" + " for write response.\n", diff_ms); ec_fsm_soe_print_error(fsm); return; } diff --git a/master/slave_config.c b/master/slave_config.c index 84bed3bc..63eeb255 100644 --- a/master/slave_config.c +++ b/master/slave_config.c @@ -428,7 +428,7 @@ int ecrt_slave_config_sync_manager(ec_slave_config_t *sc, uint8_t sync_index, } if (dir != EC_DIR_OUTPUT && dir != EC_DIR_INPUT) { - EC_CONFIG_ERR(sc, "Invalid direction %u!\n", (u32) dir); + EC_CONFIG_ERR(sc, "Invalid direction %u!\n", (unsigned int) dir); return -EINVAL; } @@ -743,7 +743,7 @@ int ecrt_slave_config_sdo8(ec_slave_config_t *sc, uint16_t index, EC_CONFIG_DBG(sc, 1, "%s(sc = 0x%p, index = 0x%04X, " "subindex = 0x%02X, value = %u)\n", - __func__, sc, index, subindex, (u32) value); + __func__, sc, index, subindex, (unsigned int) value); EC_WRITE_U8(data, value); return ecrt_slave_config_sdo(sc, index, subindex, data, 1); diff --git a/master/voe_handler.c b/master/voe_handler.c index 47eccd02..f0374b92 100644 --- a/master/voe_handler.c +++ b/master/voe_handler.c @@ -267,8 +267,8 @@ void ec_voe_handler_state_write_response(ec_voe_handler_t *voe) (jiffies - voe->jiffies_start) * 1000 / HZ; if (diff_ms < EC_VOE_RESPONSE_TIMEOUT) { EC_SLAVE_DBG(slave, 1, "Slave did not respond to" - " VoE write request. Retrying after %u ms...\n", - (u32) diff_ms); + " VoE write request. Retrying after %lu ms...\n", + diff_ms); // no response; send request datagram again return; } -- GitLab