summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <max.suraev@fairwaves.ru>2013-12-16 16:02:46 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-31 14:06:03 +0100
commit1a35cc801d54f516a6e1c3f4dc6c62f795a78678 (patch)
tree43c9f33407837428139e039d27e8f193af0bc7f8
parent8a2e935cdb67ff93a0ec8382b41f173b216ca3b5 (diff)
cleanup some compile warnings
-rw-r--r--src/target/firmware/apps/loader/main.c15
-rw-r--r--src/target/firmware/layer1/l23_api.c1
-rw-r--r--src/target/firmware/layer1/prim_fbsb.c19
-rw-r--r--src/target/firmware/layer1/prim_freq.c4
-rw-r--r--src/target/firmware/layer1/prim_rach.c1
-rw-r--r--src/target/firmware/layer1/prim_tx_nb.c1
6 files changed, 17 insertions, 24 deletions
diff --git a/src/target/firmware/apps/loader/main.c b/src/target/firmware/apps/loader/main.c
index 39b8998e..9b7a1b59 100644
--- a/src/target/firmware/apps/loader/main.c
+++ b/src/target/firmware/apps/loader/main.c
@@ -115,7 +115,7 @@ static void loader_send_init(uint8_t dlci)
struct msgb *msg = sercomm_alloc_msgb(9);
msgb_put_u8(msg, LOADER_INIT);
msgb_put_u32(msg, 0);
- msgb_put_u32(msg, &_start);
+ msgb_put_u32(msg, (uint32_t)&_start);
sercomm_sendmsg(dlci, msg);
}
@@ -128,7 +128,7 @@ static const uint8_t phone_ack[] = { 0x1b, 0xf6, 0x02, 0x00, 0x41, 0x03, 0x42 };
int main(void)
{
/* Simulate a compal loader saying "ACK" */
- int i = 0;
+ unsigned i = 0;
for (i = 0; i < sizeof(phone_ack); i++) {
putchar_asm(phone_ack[i]);
}
@@ -171,13 +171,12 @@ int main(void)
if (flash_init(&the_flash, 0)) {
puts("Failed to initialize flash!\n");
} else {
- printf("Found flash of %d bytes at 0x%x with %d regions\n",
+ printf("Found flash of %zu bytes at 0x%p with %zu regions\n",
the_flash.f_size, the_flash.f_base,
the_flash.f_nregions);
- int i;
for (i = 0; i < the_flash.f_nregions; i++) {
- printf(" Region %d of %d pages with %d bytes each.\n",
+ printf(" Region %d of %zu pages with %zu bytes each.\n",
i,
the_flash.f_regions[i].fr_bnum,
the_flash.f_regions[i].fr_bsize);
@@ -213,7 +212,7 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
uint8_t command = msgb_pull_u8(msg);
- int res;
+ int res = 0;
flash_lock_t lock;
@@ -317,11 +316,11 @@ static void cmd_handler(uint8_t dlci, struct msgb *msg)
msgb_put_u8(reply, 1); // nchips
// chip 1
- msgb_put_u32(reply, the_flash.f_base);
+ msgb_put_u32(reply, (uint32_t)the_flash.f_base);
msgb_put_u32(reply, the_flash.f_size);
msgb_put_u8(reply, the_flash.f_nregions);
- int i;
+ unsigned i;
for (i = 0; i < the_flash.f_nregions; i++) {
msgb_put_u32(reply, the_flash.f_regions[i].fr_bnum);
msgb_put_u32(reply, the_flash.f_regions[i].fr_bsize);
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index 9a90e3aa..311ca6a2 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -317,7 +317,6 @@ static void l1ctl_rx_crypto_req(struct msgb *msg)
static void l1ctl_rx_dm_rel_req(struct msgb *msg)
{
struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data;
- struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data;
printd("L1CTL_DM_REL_REQ\n");
l1a_mftask_set(0);
diff --git a/src/target/firmware/layer1/prim_fbsb.c b/src/target/firmware/layer1/prim_fbsb.c
index 19b0e0dc..9eb56c69 100644
--- a/src/target/firmware/layer1/prim_fbsb.c
+++ b/src/target/firmware/layer1/prim_fbsb.c
@@ -25,7 +25,7 @@
#include <string.h>
#include <stdlib.h>
#include <errno.h>
-
+#include <inttypes.h>
#include <defines.h>
#include <debug.h>
#include <memory.h>
@@ -88,14 +88,14 @@ static struct mon_state *last_fb = &fbs.mon;
static void dump_mon_state(struct mon_state *fb)
{
#if 0
- printf("(%u:%u): TOA=%5u, Power=%4ddBm, Angle=%5dHz, "
+ printf("(%"PRIu32":%u): TOA=%5u, Power=%4ddBm, Angle=%5dHz, "
"SNR=%04x(%d.%u) OFFSET=%u SYNCHRO=%u\n",
fb->fnr_report, fb->attempt, fb->toa,
agc_inp_dbm8_by_pm(fb->pm)/8, ANGLE_TO_FREQ(fb->angle),
fb->snr, l1s_snr_int(fb->snr), l1s_snr_fract(fb->snr),
tpu_get_offset(), tpu_get_synchro());
#else
- printf("(%u:%u): TOA=%5u, Power=%4ddBm, Angle=%5dHz\n",
+ printf("(%"PRIu32":%u): TOA=%5u, Power=%4ddBm, Angle=%5dHz\n",
fb->fnr_report, fb->attempt, fb->toa,
agc_inp_dbm8_by_pm(fb->pm)/8, ANGLE_TO_FREQ(fb->angle));
#endif
@@ -179,8 +179,6 @@ static int l1s_sbdet_resp(__unused uint8_t p1, uint8_t attempt,
int qbits, fn_offset;
struct l1_cell_info *cinfo = &l1s.serving_cell;
int fnr_delta, bits_delta;
- struct l1ctl_sync_new_ccch_resp *l1;
- struct msgb *msg;
putchart('s');
@@ -203,7 +201,7 @@ static int l1s_sbdet_resp(__unused uint8_t p1, uint8_t attempt,
sb = dsp_api.db_r->a_sch[3] | dsp_api.db_r->a_sch[4] << 16;
fbs.mon.bsic = l1s_decode_sb(&fbs.mon.time, sb);
- printf("=> SB 0x%08x: BSIC=%u ", sb, fbs.mon.bsic);
+ printf("=> SB 0x%08"PRIx32": BSIC=%u ", sb, fbs.mon.bsic);
l1s_time_dump(&fbs.mon.time);
l1s.serving_cell.bsic = fbs.mon.bsic;
@@ -482,9 +480,9 @@ static int l1s_fbdet_resp(__unused uint8_t p1, uint8_t attempt,
int fn_offset = l1s.current_time.fn - last_fb->attempt + ntdma;
int delay = fn_offset + 11 - l1s.current_time.fn - 1;
- printf(" fn_offset=%d (fn=%u + attempt=%u + ntdma = %d)\n",
+ printf(" fn_offset=%d (fn=%"PRIu32" + attempt=%u + ntdma = %d)\n",
fn_offset, l1s.current_time.fn, last_fb->attempt, ntdma);
- printf(" delay=%d (fn_offset=%d + 11 - fn=%u - 1\n", delay,
+ printf(" delay=%d (fn_offset=%d + 11 - fn=%"PRIu32" - 1\n", delay,
fn_offset, l1s.current_time.fn);
printf(" scheduling next FB/SB detection task with delay %u\n", delay);
if (abs(last_fb->freq_diff) < fbs.req.freq_err_thresh2 &&
@@ -524,11 +522,10 @@ static const struct tdma_sched_item fb_sched_set[] = {
/* Asynchronous completion handler for FB detection */
static void l1a_fb_compl(__unused enum l1_compl c)
{
- struct l1_cell_info *cinfo = &l1s.serving_cell;
-
if (last_fb->attempt >= 13) {
/* FB detection failed, signal this via L1CTL */
- return l1ctl_fbsb_resp(255);
+ l1ctl_fbsb_resp(255);
+ return;
}
/* FIME: use l1s.neigh_cell[fbs.cinfo_idx] */
diff --git a/src/target/firmware/layer1/prim_freq.c b/src/target/firmware/layer1/prim_freq.c
index ca6dc9e4..01f39d48 100644
--- a/src/target/firmware/layer1/prim_freq.c
+++ b/src/target/firmware/layer1/prim_freq.c
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-
+#include <inttypes.h>
#include <defines.h>
#include <debug.h>
#include <memory.h>
@@ -103,7 +103,7 @@ void l1a_freq_req(uint32_t fn_sched)
fn_sched = l1s.current_time.fn + diff;
if (fn_sched >= GSM_MAX_FN)
fn_sched -= GSM_MAX_FN;
- printf("Scheduling frequency change at fn=%u, currently fn=%u\n",
+ printf("Scheduling frequency change at fn=%"PRIu32", currently fn=%"PRIu32"\n",
fn_sched, l1s.current_time.fn);
local_firq_save(flags);
diff --git a/src/target/firmware/layer1/prim_rach.c b/src/target/firmware/layer1/prim_rach.c
index 08353efb..e6ea6568 100644
--- a/src/target/firmware/layer1/prim_rach.c
+++ b/src/target/firmware/layer1/prim_rach.c
@@ -58,7 +58,6 @@ struct {
/* p1: type of operation (0: one NB, 1: one RACH burst, 2: four NB */
static int l1s_tx_rach_cmd(__unused uint8_t p1, __unused uint8_t p2, __unused uint16_t p3)
{
- int i;
uint16_t *info_ptr;
uint16_t arfcn;
uint8_t data[2];
diff --git a/src/target/firmware/layer1/prim_tx_nb.c b/src/target/firmware/layer1/prim_tx_nb.c
index 71b32eba..86e8224c 100644
--- a/src/target/firmware/layer1/prim_tx_nb.c
+++ b/src/target/firmware/layer1/prim_tx_nb.c
@@ -75,7 +75,6 @@ static int l1s_tx_cmd(uint8_t p1, uint8_t burst_id, uint16_t p3)
{
uint16_t arfcn;
uint8_t tsc, tn;
- uint8_t mf_task_id = p3 & 0xff;
uint8_t mf_task_flags = p3 >> 8;
putchart('T');