misc: Fix compilation warnings

bsc_api.c:417:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat]
bsc_api.c: In function ‘handle_ass_fail’:
bsc_api.c:458:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat]

db.c: In function ‘db_sync_subscriber’:
db.c:785:3: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘time_t’ [-Wformat]

osmo_msc.c: In function ‘msc_release_connection’:
osmo_msc.c:145:20: warning: unused variable ‘trans’ [-Wunused-variable]

smpp_smsc.c: In function ‘link_accept_cb’:
smpp_smsc.c:891:24: warning: assignment from incompatible pointer type [enabled by default]

smpp_smsc.c:271:1: warning: ‘esme_by_system_id’ defined but not used [-Wunused-function]

smpp_openbsc.c: In function ‘smpp_openbsc_init’:
smpp_openbsc.c:545:2: warning: implicit declaration of function ‘smpp_vty_init’ [-Wimplicit-function-declaration]

osmo_bsc_ctrl.c: In function ‘verify_bts_loc’:
osmo_bsc_ctrl.c:340:19: warning: variable ‘height’ set but not used [-Wunused-but-set-variable

smpp_mirror.c: In function ‘main’:
smpp_mirror.c:297:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index b57a050..8a7ff90 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -781,7 +781,7 @@
 		subscriber->authorized,
 		q_tmsi,
 		subscriber->lac,
-		subscriber->expire_lu,
+		(int) subscriber->expire_lu,
 		subscriber->imsi);
 
 	free(q_tmsi);
diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c
index 511d62f..452de62 100644
--- a/openbsc/src/libmsc/osmo_msc.c
+++ b/openbsc/src/libmsc/osmo_msc.c
@@ -142,8 +142,6 @@
 /* lchan release handling */
 void msc_release_connection(struct gsm_subscriber_connection *conn)
 {
-	struct gsm_trans *trans;
-
 	/* skip when we are in release, e.g. due an error */
 	if (conn->in_release)
 		return;
diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c
index 1dc37fd..64ed200 100644
--- a/openbsc/src/libmsc/smpp_smsc.c
+++ b/openbsc/src/libmsc/smpp_smsc.c
@@ -267,18 +267,6 @@
 		esme_destroy(esme);
 }
 
-static struct osmo_esme *
-esme_by_system_id(const struct smsc *smsc, char *system_id)
-{
-	struct osmo_esme *e;
-
-	llist_for_each_entry(e, &smsc->esme_list, list) {
-		if (!strcmp(e->system_id, system_id))
-			return e;
-	}
-	return NULL;
-}
-
 /*! \brief try to find a SMPP route (ESME) for given destination */
 struct osmo_esme *
 smpp_route(const struct smsc *smsc, const struct osmo_smpp_addr *dest)
@@ -845,7 +833,7 @@
 }
 
 /* call-back of write queue once it wishes to write a message to the socket */
-static void esme_link_write_cb(struct osmo_fd *ofd, struct msgb *msg)
+static int esme_link_write_cb(struct osmo_fd *ofd, struct msgb *msg)
 {
 	struct osmo_esme *esme = ofd->data;
 	int rc;
@@ -858,8 +846,10 @@
 		smpp_esme_put(esme);
 	} else if (rc < msgb_length(msg)) {
 		LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id);
-		return;
+		return -1;
 	}
+
+	return 0;
 }
 
 /* callback for already-accepted new TCP socket */
diff --git a/openbsc/src/libmsc/smpp_smsc.h b/openbsc/src/libmsc/smpp_smsc.h
index 86fbeb5..747dc3a 100644
--- a/openbsc/src/libmsc/smpp_smsc.h
+++ b/openbsc/src/libmsc/smpp_smsc.h
@@ -124,4 +124,6 @@
 		       const struct osmo_smpp_addr *pfx);
 int smpp_route_pfx_del(struct osmo_smpp_acl *acl,
 		       const struct osmo_smpp_addr *pfx);
+
+int smpp_vty_init(void);
 #endif