[GPRS] fix numerous compiler warnings

This commit is contained in:
Harald Welte 2010-05-18 17:20:49 +02:00
parent 6463c0799c
commit cd4dd4d7ff
4 changed files with 13 additions and 15 deletions

View File

@ -162,9 +162,9 @@ struct sgsn_ggsn_ctx {
struct in_addr remote_addr;
struct gsn_t *gsn;
};
struct ggsn_ctx *ggsn_ctx_alloc(uint32_t id);
struct ggsn_ctx *ggsn_ctx_by_id(uint32_t id);
struct ggsn_ctx *ggsn_ctx_find_alloc(uint32_t id);
struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id);
struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id);
struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id);
struct apn_ctx {
struct llist_head list;

View File

@ -54,7 +54,7 @@
#include <pdp.h>
extern struct sgsn_instance *sgsn;
extern struct ggsn_ctx *dummy_ggsn;
extern struct sgsn_ggsn_ctx *dummy_ggsn;
/* Protocol related stuff, should go into libosmocore */
@ -201,7 +201,7 @@ static int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm)
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
struct gsm48_attach_ack *aa;
char *ptsig, *mid;
uint8_t *ptsig, *mid;
DEBUGP(DMM, "<- GPRS ATTACH ACCEPT\n");
@ -268,7 +268,7 @@ static int gsm48_tx_gmm_att_rej(struct sgsn_mm_ctx *mm,
}
/* Chapter 9.4.6.2 Detach accept */
static gsm48_tx_gmm_det_ack(struct sgsn_mm_ctx *mm, uint8_t force_stby)
static int gsm48_tx_gmm_det_ack(struct sgsn_mm_ctx *mm, uint8_t force_stby)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
@ -326,7 +326,6 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg)
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg);
uint8_t mi_type = gh->data[1] & GSM_MI_TYPE_MASK;
char mi_string[GSM48_MI_SIZE];
struct gprs_ra_id ra_id;
gsm48_mi_to_string(mi_string, sizeof(mi_string), &gh->data[1], gh->data[0]);
DEBUGP(DMM, "-> GMM IDENTITY RESPONSE: mi_type=0x%02x MI(%s) ",
@ -691,7 +690,6 @@ static void msgb_put_pdp_addr_ppp(struct msgb *msg)
int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_act_pdp_ctx_ack *act_ack;
struct gsm48_hdr *gh;
uint8_t transaction_id = pdp->ti ^ 0x8; /* flip */
@ -736,7 +734,6 @@ int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid,
uint8_t cause, uint8_t pco_len, uint8_t *pco_v)
{
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_act_pdp_ctx_ack *act_ack;
struct gsm48_hdr *gh;
uint8_t transaction_id = tid ^ 0x8; /* flip */
@ -761,7 +758,6 @@ int gsm48_tx_gsm_deact_pdp_acc(struct sgsn_pdp_ctx *pdp)
struct msgb *msg = gsm48_msgb_alloc();
struct gsm48_hdr *gh;
uint8_t transaction_id = pdp->ti ^ 0x8; /* flip */
int rc;
DEBUGP(DMM, "<- DEACTIVATE PDP CONTEXT ACK\n");
@ -780,7 +776,6 @@ static int gsm48_rx_gsm_act_pdp_req(struct sgsn_mm_ctx *mmctx,
{
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg);
struct gsm48_act_pdp_ctx_req *act_req = (struct gsm48_act_pdp_ctx_req *) gh->data;
uint8_t *pdp_addr_lv = act_req->data;
uint8_t req_qos_len, req_pdpa_len;
uint8_t *req_qos, *req_pdpa;
struct tlv_parsed tp;

View File

@ -96,7 +96,7 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
{
struct sgsn_pdp_ctx *pctx;
struct pdp_t *pdp;
uint64_t imsi_ui64;
uint64_t imsi_ui64 = 0;
int rc;
LOGP(DGPRS, LOGL_ERROR, "Create PDP Context\n");
@ -374,6 +374,9 @@ static int sgsn_gtp_fd_cb(struct bsc_fd *fd, unsigned int what)
case 2:
rc = gtp_decaps1u(sgi->gsn);
break;
default:
rc = -EINVAL;
break;
}
return rc;
}
@ -395,7 +398,7 @@ static int timeval_diff(struct timeval *diff,
timeval_normalize(b);
if (b->tv_sec > a->tv_sec ||
b->tv_sec == a->tv_sec && b->tv_usec > a->tv_usec) {
(b->tv_sec == a->tv_sec && b->tv_usec > a->tv_usec)) {
b->tv_sec = b->tv_usec = 0;
return -ERANGE;
}
@ -413,7 +416,7 @@ static int timeval_diff(struct timeval *diff,
static void sgsn_gtp_tmr_start(struct sgsn_instance *sgi)
{
struct timeval now, next, diff;
struct timeval now, next, diff = { 0, 0 };
/* Retrieve next retransmission as struct timeval */
gtp_retranstimeout(sgi->gsn, &next);

View File

@ -26,6 +26,7 @@
#include <osmocore/talloc.h>
#include <osmocore/utils.h>
#include <osmocore/rate_ctr.h>
#include <openbsc/debug.h>
#include <openbsc/sgsn.h>
@ -136,7 +137,6 @@ DEFUN(cfg_ggsn_gtp_version, cfg_ggsn_gtp_version_cmd,
{
uint32_t id = atoi(argv[0]);
struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id);
uint16_t port = atoi(argv[1]);
if (atoi(argv[1]))
ggc->gtp_version = 1;