Commit 9f4db79f authored by Adam Wujek's avatar Adam Wujek

remove warnings

New warnings are reported by a newer version of gcc used for RISCV
Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 0581b66d
...@@ -78,7 +78,7 @@ void minic_init() ...@@ -78,7 +78,7 @@ void minic_init()
mcr = minic_readl(MINIC_REG_MCR); mcr = minic_readl(MINIC_REG_MCR);
if (MINIC_MCR_VER_R(mcr) != MINIC_HDL_VERSION) { if (MINIC_MCR_VER_R(mcr) != MINIC_HDL_VERSION) {
pp_printf("Error: Minic HDL version %d not supported by sw\n", pp_printf("Error: Minic HDL version %d not supported by sw\n",
MINIC_MCR_VER_R(mcr)); (int) MINIC_MCR_VER_R(mcr));
ver_supported = 0; ver_supported = 0;
return; return;
} }
...@@ -223,7 +223,7 @@ int minic_rx_frame(struct wr_ethhdr *hdr, uint8_t * payload, uint32_t buf_size, ...@@ -223,7 +223,7 @@ int minic_rx_frame(struct wr_ethhdr *hdr, uint8_t * payload, uint32_t buf_size,
int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size, int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size,
struct hw_timestamp *hwts) struct hw_timestamp *hwts)
{ {
uint32_t d_hdr, mcr, pwords, hwords; uint32_t mcr, pwords, hwords;
int ts_valid; int ts_valid;
int i, hsize; int i, hsize;
uint16_t *ptr; uint16_t *ptr;
...@@ -241,8 +241,6 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size, ...@@ -241,8 +241,6 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size,
size = 60 - hsize; size = 60 - hsize;
pwords = ((size + 1) >> 1); pwords = ((size + 1) >> 1);
d_hdr = 0;
/* First we write status word (empty status for Tx) */ /* First we write status word (empty status for Tx) */
minic_txword(WRF_STATUS, 0); minic_txword(WRF_STATUS, 0);
...@@ -281,7 +279,8 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size, ...@@ -281,7 +279,8 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size,
} }
if (i == 1000) if (i == 1000)
pp_printf("Warning: tx not terminated infinite mcr=0x%x\n",mcr); pp_printf("Warning: tx not terminated infinite mcr=0x%x\n",
(unsigned int) mcr);
if (hwts) { if (hwts) {
uint32_t raw_ts; uint32_t raw_ts;
...@@ -319,6 +318,7 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size, ...@@ -319,6 +318,7 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size,
} }
EXPLODE_WR_TIMESTAMP(raw_ts, counter_r, counter_f); EXPLODE_WR_TIMESTAMP(raw_ts, counter_r, counter_f);
(void) counter_f; /* Make a compiler happy */
shw_pps_gen_get_time(&sec, &nsec); shw_pps_gen_get_time(&sec, &nsec);
if (counter_r > 3 * REF_CLOCK_FREQ_HZ / 4 && nsec < 250000000) if (counter_r > 3 * REF_CLOCK_FREQ_HZ / 4 && nsec < 250000000)
...@@ -331,7 +331,7 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size, ...@@ -331,7 +331,7 @@ int minic_tx_frame(struct wr_ethhdr_vlan *hdr, uint8_t *payload, uint32_t size,
minic.tx_count++; minic.tx_count++;
} }
return size; return size;
} }
......
...@@ -43,7 +43,7 @@ static int sfp_present(void) ...@@ -43,7 +43,7 @@ static int sfp_present(void)
static void sfp_read_i2c(int addr, uint8_t *mem, int start, int size) static void sfp_read_i2c(int addr, uint8_t *mem, int start, int size)
{ {
int i = start; int i = start;
uint8_t data, sum; uint8_t data;
bb_i2c_init( &dev_i2c_sfp ); bb_i2c_init( &dev_i2c_sfp );
...@@ -55,7 +55,6 @@ static void sfp_read_i2c(int addr, uint8_t *mem, int start, int size) ...@@ -55,7 +55,6 @@ static void sfp_read_i2c(int addr, uint8_t *mem, int start, int size)
bb_i2c_get_byte(&dev_i2c_sfp, &data, 1); bb_i2c_get_byte(&dev_i2c_sfp, &data, 1);
bb_i2c_stop(&dev_i2c_sfp); bb_i2c_stop(&dev_i2c_sfp);
*(mem + i) = data; *(mem + i) = data;
sum = data;
bb_i2c_start( &dev_i2c_sfp ); bb_i2c_start( &dev_i2c_sfp );
bb_i2c_put_byte(&dev_i2c_sfp, addr << 1 | BB_I2C_WRITE); bb_i2c_put_byte(&dev_i2c_sfp, addr << 1 | BB_I2C_WRITE);
......
...@@ -1202,8 +1202,9 @@ int storage_sdbfs_format( struct storage_device *dev, uint32_t addr, int force_b ...@@ -1202,8 +1202,9 @@ int storage_sdbfs_format( struct storage_device *dev, uint32_t addr, int force_b
} }
pp_printf("Formatting SDBFS in %s (base 0x%08x, size 0x%08x)...\n", dev->name, pp_printf("Formatting SDBFS in %s (base 0x%08x, size 0x%08x)...\n",
base_addr, (uint32_t) (SDBFS_REC * wrc_sdbfs.blocksize) ); dev->name, (unsigned int) base_addr,
(unsigned int) (SDBFS_REC * wrc_sdbfs.blocksize) );
storage_sdbfs_erase(dev, addr, force_base); storage_sdbfs_erase(dev, addr, force_base);
......
...@@ -31,8 +31,10 @@ static int cmd_faketemp(const char *args[]) ...@@ -31,8 +31,10 @@ static int cmd_faketemp(const char *args[])
const char *dot; const char *dot;
if (!args[0]) { if (!args[0]) {
pp_printf("%08x %08x %08x\n", temp_fake_data[0].t, pp_printf("%08x %08x %08x\n",
temp_fake_data[1].t, temp_fake_data[2].t); (unsigned int) temp_fake_data[0].t,
(unsigned int) temp_fake_data[1].t,
(unsigned int) temp_fake_data[2].t);
return 0; return 0;
} }
......
...@@ -92,8 +92,8 @@ extern int wrc_temp_format(char *buffer, int len) ...@@ -92,8 +92,8 @@ extern int wrc_temp_format(char *buffer, int len)
t = -(signed)t; t = -(signed)t;
l += sprintf(buffer + l, "-"); l += sprintf(buffer + l, "-");
} }
l += sprintf(buffer + l,"%d.%04d", t >> 16, l += sprintf(buffer + l,"%d.%04d", (int) (t >> 16),
((t & 0xffff) * 10 * 1000 >> 16)); (int) ((t & 0xffff) * 10 * 1000 >> 16));
} }
return l; return l;
} }
......
...@@ -73,7 +73,7 @@ static int cmd_w1(const char *args[]) ...@@ -73,7 +73,7 @@ static int cmd_w1(const char *args[])
pp_printf("device %i: %08x%08x\n", i, pp_printf("device %i: %08x%08x\n", i,
(int)(d->rom >> 32), (int)d->rom); (int)(d->rom >> 32), (int)d->rom);
temp = w1_read_temp(d, 0); temp = w1_read_temp(d, 0);
pp_printf("temp: %d.%04d\n", temp >> 16, pp_printf("temp: %d.%04d\n", (int) (temp >> 16),
(int)((temp & 0xffff) * 10 * 1000 >> 16)); (int)((temp & 0xffff) * 10 * 1000 >> 16));
} }
} }
......
...@@ -25,7 +25,7 @@ struct wrc_global { ...@@ -25,7 +25,7 @@ struct wrc_global {
int task_list_max; int task_list_max;
struct wrc_task *task_list; struct wrc_task *task_list;
int temp_group_list_max; int temp_group_list_max;
struct wrc_temp *temp_group_list; struct wrc_temp_group *temp_group_list;
volatile struct softpll_state *softpll; volatile struct softpll_state *softpll;
struct spll_fifo_log *pll_fifo; struct spll_fifo_log *pll_fifo;
struct sfp_info *sfp_info; struct sfp_info *sfp_info;
......
...@@ -47,10 +47,12 @@ static inline void queue_put( struct event_queue* buf, int c ) ...@@ -47,10 +47,12 @@ static inline void queue_put( struct event_queue* buf, int c )
static inline int queue_get( struct event_queue* buf ) static inline int queue_get( struct event_queue* buf )
{ {
int rv;
if( !buf->count ) if( !buf->count )
return -1; return -1;
int rv = buf->data[buf->tail]; rv = buf->data[buf->tail];
buf->tail++; buf->tail++;
if (buf->tail >= buf->size) if (buf->tail >= buf->size)
......
...@@ -75,8 +75,9 @@ static void ts_sub(struct wr_timestamp *t2, struct wr_timestamp *t1, ...@@ -75,8 +75,9 @@ static void ts_sub(struct wr_timestamp *t2, struct wr_timestamp *t1,
static void latency_warning(void) { static void latency_warning(void) {
if (!lat_verbose) if (!lat_verbose)
return; return;
pp_printf("lat: unexpected %i.%i after %i.%i\n", pp_printf("lat: unexpected %d.%d after %d.%d\n",
frame.sequence, frame.type, prev_sequence, prev_type); (unsigned int) frame.sequence, (unsigned int) frame.type,
(unsigned int) prev_sequence, (unsigned int) prev_type);
} }
/* report once a minute */ /* report once a minute */
...@@ -198,9 +199,9 @@ static int latency_poll_rx(void) ...@@ -198,9 +199,9 @@ static int latency_poll_rx(void)
if (lat_verbose) { if (lat_verbose) {
pp_printf("lat: %9i %6i.%03i %6i.%03i\n", pp_printf("lat: %9i %6i.%03i %6i.%03i\n",
frame.sequence, (unsigned int) frame.sequence,
lat[0].nsec, lat[0].phase, (int) lat[0].nsec, (int) lat[0].phase,
lat[1].nsec, lat[1].phase); (int) lat[1].nsec, (int) lat[1].phase);
return 1; return 1;
} else { } else {
latency_report(lat); latency_report(lat);
...@@ -254,7 +255,7 @@ static int latency_poll_tx(void) ...@@ -254,7 +255,7 @@ static int latency_poll_tx(void)
} else if (frame.ts->sec - lasts >= 10) { } else if (frame.ts->sec - lasts >= 10) {
lasts = frame.ts->sec; lasts = frame.ts->sec;
pp_printf("latency: seq %9i sent @ %9i\n", pp_printf("latency: seq %9i sent @ %9i\n",
sequence, lasts); (unsigned int) sequence, (unsigned int) lasts);
} }
return 1; return 1;
...@@ -296,8 +297,9 @@ static int cmd_ltest(const char *args[]) ...@@ -296,8 +297,9 @@ static int cmd_ltest(const char *args[])
lastt = 0; /* reset, so it fires immediately */ lastt = 0; /* reset, so it fires immediately */
} }
} }
pp_printf("%i.%03i (%s)\n", latency_period_ms / 1000, pp_printf("%i.%03i (%s)\n", (unsigned int) (latency_period_ms / 1000),
latency_period_ms % 1000, lat_verbose ? "verbose" : "quiet"); (unsigned int) (latency_period_ms % 1000),
lat_verbose ? "verbose" : "quiet");
return 0; return 0;
} }
......
...@@ -891,7 +891,6 @@ static int func_aux_diag(uint8_t *buf, uint8_t in_oid_limb_matched_len, ...@@ -891,7 +891,6 @@ static int func_aux_diag(uint8_t *buf, uint8_t in_oid_limb_matched_len,
{ {
int oid_twig_len = buf[0] - in_oid_limb_matched_len; int oid_twig_len = buf[0] - in_oid_limb_matched_len;
uint8_t *in_oid_limb_end = &buf[1 + in_oid_limb_matched_len]; uint8_t *in_oid_limb_end = &buf[1 + in_oid_limb_matched_len];
uint8_t oid_twig_matching_len;
struct snmp_oid *oid; struct snmp_oid *oid;
struct snmp_oid leaf_obj; struct snmp_oid leaf_obj;
int return_first = 0; int return_first = 0;
...@@ -924,9 +923,6 @@ static int func_aux_diag(uint8_t *buf, uint8_t in_oid_limb_matched_len, ...@@ -924,9 +923,6 @@ static int func_aux_diag(uint8_t *buf, uint8_t in_oid_limb_matched_len,
in_oid_limb_end[TABLE_ROW] = TABLE_FIRST_ROW; in_oid_limb_end[TABLE_ROW] = TABLE_FIRST_ROW;
oid_twig_len = table_size; oid_twig_len = table_size;
} }
/* Decide what is shorter the rest of the OID, or the
* matching part */
oid_twig_matching_len = min(oid_twig_len, table_size);
/* For get and set twig size has to be exact */ /* For get and set twig size has to be exact */
if (!snmp_get_next && (oid_twig_len != table_size)) { if (!snmp_get_next && (oid_twig_len != table_size)) {
...@@ -1237,8 +1233,8 @@ static int get_temp(uint8_t *buf, struct snmp_oid *obj) ...@@ -1237,8 +1233,8 @@ static int get_temp(uint8_t *buf, struct snmp_oid *obj)
t = -(signed)t; t = -(signed)t;
l += sprintf(buffer, "-"); l += sprintf(buffer, "-");
} }
sprintf(buffer, "%d.%04d", t >> 16, sprintf(buffer, "%d.%04d", (int) (t >> 16),
((t & 0xffff) * 10 * 1000 >> 16)); (int) ((t & 0xffff) * 10 * 1000 >> 16));
break; break;
} }
} }
...@@ -1920,6 +1916,9 @@ static int snmp_respond(uint8_t *buf) ...@@ -1920,6 +1916,9 @@ static int snmp_respond(uint8_t *buf)
(void) set_ptp_config; (void) set_ptp_config;
(void) set_ptp_restart; (void) set_ptp_restart;
(void) set_aux_diag; (void) set_aux_diag;
(void) set_shell_cmd;
(void) set_netconsole;
(void) set_sdb;
(void) func_aux_diag; (void) func_aux_diag;
(void) get_i32sat_pp; (void) get_i32sat_pp;
(void) oid_array_wrpcAuxRwTable; (void) oid_array_wrpcAuxRwTable;
......
...@@ -137,7 +137,7 @@ int syslog_poll(void) ...@@ -137,7 +137,7 @@ int syslog_poll(void)
len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip); len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip);
len += pp_sprintf(buf + len, "(%s) Node up " len += pp_sprintf(buf + len, "(%s) Node up "
"since %i seconds", format_mac(b, mac), "since %i seconds", format_mac(b, mac),
(tics - tics_zero) / 1000); (int) ((tics - tics_zero) / 1000));
goto send; goto send;
} }
...@@ -151,7 +151,8 @@ int syslog_poll(void) ...@@ -151,7 +151,8 @@ int syslog_poll(void)
down_tics = now - down_tics; down_tics = now - down_tics;
len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip); len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip);
len += pp_sprintf(buf + len, "Link up after %i.%03i s", len += pp_sprintf(buf + len, "Link up after %i.%03i s",
down_tics / 1000, down_tics % 1000); (unsigned int) (down_tics / 1000),
(unsigned int) (down_tics % 1000));
down_tics = 0; down_tics = 0;
goto send; goto send;
} }
...@@ -180,15 +181,17 @@ int syslog_poll(void) ...@@ -180,15 +181,17 @@ int syslog_poll(void)
if (track_ok_count == 1) { if (track_ok_count == 1) {
len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip); len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip);
len += pp_sprintf(buf + len, len += pp_sprintf(buf + len,
"Tracking after %i.%03i s", "Tracking after %i.%03i s",
prev_tics / 1000, prev_tics % 1000); (unsigned int) (prev_tics / 1000),
(unsigned int) (prev_tics % 1000));
goto send; goto send;
} }
len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip); len = syslog_header(buf, SYSLOG_DEFAULT_LEVEL, ip);
len += pp_sprintf(buf + len, len += pp_sprintf(buf + len,
"%i-th re-rtrack after %i.%03i s", "%i-th re-rtrack after %i.%03i s",
track_ok_count, track_ok_count,
prev_tics / 1000, prev_tics % 1000); (unsigned int) (prev_tics / 1000),
(unsigned int) (prev_tics % 1000));
/* Report if we didn't really loose time */ /* Report if we didn't really loose time */
if (!bad_track_lost) if (!bad_track_lost)
len += pp_sprintf(buf + len, " (max delta %i ps)", len += pp_sprintf(buf + len, " (max delta %i ps)",
......
...@@ -840,11 +840,11 @@ int wrc_log_stats(void) ...@@ -840,11 +840,11 @@ int wrc_log_stats(void)
for (i = 0; i < n_out - 1; i++) { for (i = 0; i < n_out - 1; i++) {
aux_stat = spll_get_aux_status(i); aux_stat = spll_get_aux_status(i);
pp_printf("aux%d:%08x%08x ", i, aux_stat.flags, aux_stat.phase); pp_printf("aux%d:%08x%08x ", i, (int) aux_stat.flags, (int) aux_stat.phase);
} }
/* fixme: clock is not always 125 MHz */ /* fixme: clock is not always 125 MHz */
pp_printf("sec:%d nsec:%09d ", (uint32_t) sec, nsec); pp_printf("sec:%d nsec:%09d ", (int) sec, (int) nsec);
wrh_servo = (ppi_static.protocol_extension == PPSI_EXT_WR && ppi_static.extState == PP_EXSTATE_ACTIVE) ? wrh_servo = (ppi_static.protocol_extension == PPSI_EXT_WR && ppi_static.extState == PP_EXSTATE_ACTIVE) ?
(wrh_servo_t*) ppi_static.ext_data : NULL; (wrh_servo_t*) ppi_static.ext_data : NULL;
...@@ -861,11 +861,11 @@ int wrc_log_stats(void) ...@@ -861,11 +861,11 @@ int wrc_log_stats(void)
pp_printf("dms:%Ld ", pp_time_to_picos(&s->delayMS)); pp_printf("dms:%Ld ", pp_time_to_picos(&s->delayMS));
pp_printf("dtxm:%d drxm:%d ", pp_printf("dtxm:%d drxm:%d ",
(int32_t) pp_time_to_picos(&wr_servo_ext->delta_txm), (int) pp_time_to_picos(&wr_servo_ext->delta_txm),
(int32_t) pp_time_to_picos(&wr_servo_ext->delta_rxm)); (int) pp_time_to_picos(&wr_servo_ext->delta_rxm));
pp_printf("dtxs:%d drxs:%d ", pp_printf("dtxs:%d drxs:%d ",
(int32_t) pp_time_to_picos(&wr_servo_ext->delta_txs), (int) pp_time_to_picos(&wr_servo_ext->delta_txs),
(int32_t) pp_time_to_picos(&wr_servo_ext->delta_rxs)); (int) pp_time_to_picos(&wr_servo_ext->delta_rxs));
pp_printf("asym:%Ld ", interval_to_picos(ppi_static.portDS->delayAsymmetry)); pp_printf("asym:%Ld ", interval_to_picos(ppi_static.portDS->delayAsymmetry));
crtt = wr_servo_ext->rawDelayMM; crtt = wr_servo_ext->rawDelayMM;
...@@ -877,9 +877,9 @@ int wrc_log_stats(void) ...@@ -877,9 +877,9 @@ int wrc_log_stats(void)
/* Cable RTT */ /* Cable RTT */
pp_printf("crtt:%Ld ", pp_time_to_picos(&crtt)); pp_printf("crtt:%Ld ", pp_time_to_picos(&crtt));
/* Clock offset */ /* Clock offset */
pp_printf("cko:%d ", (int32_t) pp_time_to_picos(&s->offsetFromMaster)); pp_printf("cko:%d ", (int) pp_time_to_picos(&s->offsetFromMaster));
pp_printf("setp:%d ", wrh_servo->cur_setpoint_ps); pp_printf("setp:%d ", (int) wrh_servo->cur_setpoint_ps);
pp_printf("ucnt:%d ", (int32_t) s->update_count); pp_printf("ucnt:%d ", (int) s->update_count);
pp_printf("bslide:%d ", ep_get_bitslide(&wrc_endpoint_dev)); pp_printf("bslide:%d ", ep_get_bitslide(&wrc_endpoint_dev));
} }
...@@ -890,8 +890,8 @@ int wrc_log_stats(void) ...@@ -890,8 +890,8 @@ int wrc_log_stats(void)
int32_t temp; int32_t temp;
temp = wrc_temp_get("pcb"); temp = wrc_temp_get("pcb");
pp_printf("temp:%d.%04d C", temp >> 16, pp_printf("temp:%d.%04d C", (int) (temp >> 16),
(int)((temp & 0xffff) * 10 * 1000 >> 16)); (int) ((temp & 0xffff) * 10 * 1000 >> 16));
} }
pp_printf("\n"); pp_printf("\n");
......
...@@ -46,14 +46,15 @@ static int cmd_calibration(const char *args[]) ...@@ -46,14 +46,15 @@ static int cmd_calibration(const char *args[])
int value = atoi(args[2]); int value = atoi(args[2]);
pp_printf("Setting calibration parameter %s [0x%x] to %d\n", args[1], param ,value ); pp_printf("Setting calibration parameter %s [0x%x] to %d\n",
args[1], (unsigned int) param, value);
storage_set_calibration_parameter( param, value ); storage_set_calibration_parameter( param, value );
} }
} else if (!args[0]) { } else if (!args[0]) {
if (storage_phtrans(&trans, 0) > 0) { if (storage_phtrans(&trans, 0) > 0) {
pp_printf("Found phase transition in EEPROM: %dps\n", pp_printf("Found phase transition in EEPROM: %dps\n",
trans); (unsigned int) trans);
return 0; return 0;
} else { } else {
......
...@@ -23,8 +23,9 @@ static int cmd_diag(const char *args[]) ...@@ -23,8 +23,9 @@ static int cmd_diag(const char *args[])
if (!args[0]) { if (!args[0]) {
pp_printf("Aux diagnostics info:\n"); pp_printf("Aux diagnostics info:\n");
pp_printf("id: %d.%d, r/w words: %d, r/o words: %d\n", id, ver, pp_printf("id: %d.%d, r/w words: %d, r/o words: %d\n",
nrw, nro); (unsigned int) id, (unsigned int) ver,
(unsigned int) nrw, (unsigned int) nro);
return 0; return 0;
} }
...@@ -34,12 +35,14 @@ static int cmd_diag(const char *args[]) ...@@ -34,12 +35,14 @@ static int cmd_diag(const char *args[])
for(i=0; i<nro; i++ ) for(i=0; i<nro; i++ )
{ {
ret = diag_read_word(i, DIAG_RO_BANK, &val); ret = diag_read_word(i, DIAG_RO_BANK, &val);
pp_printf("RO word %-3d = 0x%08x\n", i, val ); pp_printf("RO word %-3d = 0x%08x\n", i,
(unsigned int) val);
} }
for(i=0; i<nrw; i++ ) for(i=0; i<nrw; i++ )
{ {
ret = diag_read_word(i, DIAG_RW_BANK, &val); ret = diag_read_word(i, DIAG_RW_BANK, &val);
pp_printf("RW word %-3d = 0x%08x\n", i, val ); pp_printf("RW word %-3d = 0x%08x\n", i,
(unsigned int) val);
} }
return ret; return ret;
} }
...@@ -48,7 +51,8 @@ static int cmd_diag(const char *args[]) ...@@ -48,7 +51,8 @@ static int cmd_diag(const char *args[])
addr = atoi(args[1]); addr = atoi(args[1]);
ret = diag_read_word(addr, DIAG_RO_BANK, &val); ret = diag_read_word(addr, DIAG_RO_BANK, &val);
if (!ret) if (!ret)
pp_printf("Word %d is 0x%08x\n", addr, val); pp_printf("Word %d is 0x%08x\n",
(unsigned int) addr, (unsigned int) val);
return ret; return ret;
} }
...@@ -56,7 +60,8 @@ static int cmd_diag(const char *args[]) ...@@ -56,7 +60,8 @@ static int cmd_diag(const char *args[])
addr = atoi(args[1]); addr = atoi(args[1]);
ret = diag_read_word(addr, DIAG_RW_BANK, &val); ret = diag_read_word(addr, DIAG_RW_BANK, &val);
if (!ret) if (!ret)
pp_printf("Word %d is 0x%08x\n", addr, val); pp_printf("Word %d is 0x%08x\n",
(unsigned int) addr, (unsigned int) val);
return ret; return ret;
} }
...@@ -66,7 +71,7 @@ static int cmd_diag(const char *args[]) ...@@ -66,7 +71,7 @@ static int cmd_diag(const char *args[])
ret = diag_write_word(addr, val); ret = diag_write_word(addr, val);
if (!ret) if (!ret)
pp_printf("Value 0x%08x written to the word %d\n", pp_printf("Value 0x%08x written to the word %d\n",
val, addr); (unsigned int) val, (unsigned int) addr);
return ret; return ret;
} }
......
...@@ -29,7 +29,7 @@ static int cmd_devmem(const char *args[]) ...@@ -29,7 +29,7 @@ static int cmd_devmem(const char *args[])
fromhex(args[1], (void *)&value); fromhex(args[1], (void *)&value);
*addr = value; *addr = value;
} else { } else {
pp_printf("%08x = %08x\n", (int)addr, *addr); pp_printf("%08x = %08x\n", (int) addr, (unsigned int) *addr);
} }
return 0; return 0;
} }
...@@ -70,8 +70,8 @@ static int cmd_delays(const char *args[]) ...@@ -70,8 +70,8 @@ static int cmd_delays(const char *args[])
picos_to_pp_time(rx, &wr_servo_ext->delta_rxm); picos_to_pp_time(rx, &wr_servo_ext->delta_rxm);
picos_to_pp_time(tx, &wr_servo_ext->delta_txm); picos_to_pp_time(tx, &wr_servo_ext->delta_txm);
} else { } else {
pp_printf("tx: %i rx: %i\n", sfp_info.sfp_params.dTx, pp_printf("tx: %i rx: %i\n", (int) sfp_info.sfp_params.dTx,
sfp_info.sfp_params.dRx); (int) sfp_info.sfp_params.dRx);
} }
return 0; return 0;
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
static int cmd_pll(const char *args[]) static int cmd_pll(const char *args[])
{ {
int cur, tgt; int32_t cur, tgt;
if (!strcasecmp(args[0], "init")) { if (!strcasecmp(args[0], "init")) {
if (!args[3]) if (!args[3])
...@@ -36,7 +36,7 @@ static int cmd_pll(const char *args[]) ...@@ -36,7 +36,7 @@ static int cmd_pll(const char *args[])
if (!args[1]) if (!args[1])
return -EINVAL; return -EINVAL;
spll_get_phase_shift(atoi(args[1]), &cur, &tgt); spll_get_phase_shift(atoi(args[1]), &cur, &tgt);
pp_printf("%d %d\n", cur, tgt); pp_printf("%d %d\n", (int) cur, (int) tgt);
} else if (!strcasecmp(args[0], "start")) { } else if (!strcasecmp(args[0], "start")) {
if (!args[1]) if (!args[1])
return -EINVAL; return -EINVAL;
......
...@@ -35,7 +35,7 @@ static int cmd_ps(const char *args[]) ...@@ -35,7 +35,7 @@ static int cmd_ps(const char *args[])
if (args[1]) if (args[1])
print_task_time_threshold = atoi(args[1]); print_task_time_threshold = atoi(args[1]);
pp_printf("print_task_time_threshold %d\n", pp_printf("print_task_time_threshold %d\n",
print_task_time_threshold); (unsigned int) print_task_time_threshold);
return 0; return 0;
} }
} }
......
...@@ -33,7 +33,8 @@ static int cmd_sdb(const char *args[]) ...@@ -33,7 +33,8 @@ static int cmd_sdb(const char *args[])
storage_sdbfs_format( &wrc_storage_dev, base, 0 ); storage_sdbfs_format( &wrc_storage_dev, base, 0 );
} else { } else {
base = atoi(args[1]); base = atoi(args[1]);
pp_printf("Formatting using custom location 0x%X\n", base); pp_printf("Formatting using custom location 0x%X\n",
(unsigned int) base);
storage_sdbfs_format( &wrc_storage_dev, base, 1 ); storage_sdbfs_format( &wrc_storage_dev, base, 1 );
} }
return 0; return 0;
...@@ -44,7 +45,8 @@ static int cmd_sdb(const char *args[]) ...@@ -44,7 +45,8 @@ static int cmd_sdb(const char *args[])
storage_sdbfs_erase( &wrc_storage_dev, base, 0 ); storage_sdbfs_erase( &wrc_storage_dev, base, 0 );
} else { } else {
base = atoi(args[1]); base = atoi(args[1]);
pp_printf("Erasing using custom location 0x%X\n", base); pp_printf("Erasing using custom location 0x%X\n",
(unsigned int) base);
storage_sdbfs_erase( &wrc_storage_dev, base, 1 ); storage_sdbfs_erase( &wrc_storage_dev, base, 1 );
} }
return 0; return 0;
......
...@@ -128,8 +128,8 @@ static int cmd_sfp(const char *args[]) ...@@ -128,8 +128,8 @@ static int cmd_sfp(const char *args[])
pp_printf("%d: PN:", i + 1); pp_printf("%d: PN:", i + 1);
for (temp = 0; temp < SFP_PN_LEN; ++temp) for (temp = 0; temp < SFP_PN_LEN; ++temp)
pp_printf("%c", sfp.pn[temp]); pp_printf("%c", sfp.pn[temp]);
pp_printf(" dTx: %8d dRx: %8d alpha: %19Ld\n", sfp.dTx, pp_printf(" dTx: %8d dRx: %8d alpha: %19Ld\n",
sfp.dRx, sfp.alpha); (int) sfp.dTx, (int) sfp.dRx, sfp.alpha);
} }
return 0; return 0;
} else if (!strcasecmp(args[0], "match")) { } else if (!strcasecmp(args[0], "match")) {
...@@ -156,8 +156,9 @@ static int cmd_sfp(const char *args[]) ...@@ -156,8 +156,9 @@ static int cmd_sfp(const char *args[])
} }
/* match successful */ /* match successful */
pp_printf("SFP matched, dTx=%d dRx=%d alpha=%Ld\n", pp_printf("SFP matched, dTx=%d dRx=%d alpha=%Ld\n",
sfp_info.sfp_params.dTx, sfp_info.sfp_params.dRx, (int) sfp_info.sfp_params.dTx,
sfp_info.sfp_params.alpha); (int) sfp_info.sfp_params.dRx,
sfp_info.sfp_params.alpha);
return ret; return ret;
} else if (args[1] && !strcasecmp(args[0], "ena")) { } else if (args[1] && !strcasecmp(args[0], "ena")) {
ep_sfp_enable(&wrc_endpoint_dev, atoi(args[1])); ep_sfp_enable(&wrc_endpoint_dev, atoi(args[1]));
......
...@@ -49,12 +49,12 @@ static int cmd_time(const char *args[]) ...@@ -49,12 +49,12 @@ static int cmd_time(const char *args[])
return 0; return 0;
} }
} else if (args[0] && !strcasecmp(args[0], "raw")) { } else if (args[0] && !strcasecmp(args[0], "raw")) {
pp_printf("%d %d\n", (uint32_t) sec, nsec); pp_printf("%d %d\n", (unsigned int) sec, (unsigned int) nsec);
return 0; return 0;
} }
pp_printf("%s +%d nanoseconds.\n", pp_printf("%s +%d nanoseconds.\n",
format_time(sec, TIME_FORMAT_LEGACY), nsec); format_time(sec, TIME_FORMAT_LEGACY), (unsigned int) nsec);
/* fixme: clock freq is not always 125 MHz */ /* fixme: clock freq is not always 125 MHz */
return 0; return 0;
......
...@@ -5,7 +5,7 @@ static int cmd_uptime(const char *args[]) ...@@ -5,7 +5,7 @@ static int cmd_uptime(const char *args[])
{ {
extern uint32_t uptime_sec; extern uint32_t uptime_sec;
pp_printf("%u\n", uptime_sec); pp_printf("%u\n", (unsigned int) uptime_sec);
return 0; return 0;
} }
......
...@@ -15,7 +15,8 @@ extern void _reset_handler(void); /* user to reset again */ ...@@ -15,7 +15,8 @@ extern void _reset_handler(void); /* user to reset again */
void check_stack(void) void check_stack(void)
{ {
assert(_endram == ENDRAM_MAGIC, "Stack overflow! (%x)\n", _endram); assert(_endram == ENDRAM_MAGIC, "Stack overflow! (0x%x)\n",
(unsigned int) _endram);
} }
#ifdef CONFIG_CHECK_RESET #ifdef CONFIG_CHECK_RESET
...@@ -48,7 +49,9 @@ void check_reset(void) ...@@ -48,7 +49,9 @@ void check_reset(void)
pp_printf("\nWarning: the CPU was reset\nStack trace:\n"); pp_printf("\nWarning: the CPU was reset\nStack trace:\n");
while (p < &_fstack) { while (p < &_fstack) {
pp_printf("%08x: %08x %08x %08x %08x\n", pp_printf("%08x: %08x %08x %08x %08x\n",
(int)p, save[0], save[1], save[2], save[3]); (int)p, (unsigned int) save[0],
(unsigned int) save[1], (unsigned int) save[2],
(unsigned int) save[3]);
p += 4; p += 4;
save += 4; save += 4;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment