diff mbox

osmo-bsc: fix compiler warning: store struct in vty->index

Message ID 1459024511-31381-1-git-send-email-nhofmeyr@sysmocom.de
State New
Headers show

Commit Message

Neels Hofmeyr March 26, 2016, 8:35 p.m. UTC
Don't store an MSC index number in the vty->index void* value. Instead,
store the osmo_msc_data struct directly. Thus avoid warnings about
differences in int vs void* sizes, and save some index lookups.
---
 openbsc/src/osmo-bsc/osmo_bsc_vty.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Harald Welte March 27, 2016, 8:48 a.m. UTC | #1
On Sat, Mar 26, 2016 at 09:35:11PM +0100, Neels Hofmeyr wrote:
> Don't store an MSC index number in the vty->index void* value. Instead,
> store the osmo_msc_data struct directly. Thus avoid warnings about
> differences in int vs void* sizes, and save some index lookups.

thanks, merged.
diff mbox

Patch

diff --git a/openbsc/src/osmo-bsc/osmo_bsc_vty.c b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
index d871f01..e623c9c 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_vty.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_vty.c
@@ -43,7 +43,7 @@  static struct osmo_bsc_data *osmo_bsc_data(struct vty *vty)
 
 static struct osmo_msc_data *osmo_msc_data(struct vty *vty)
 {
-	return osmo_msc_data_find(bsc_gsmnet, (int) vty->index);
+	return vty->index;
 }
 
 static struct cmd_node bsc_node = {
@@ -70,7 +70,7 @@  DEFUN(cfg_net_msc, cfg_net_msc_cmd,
 		return CMD_WARNING;
 	}
 
-	vty->index = (void *) index;
+	vty->index = msc;
 	vty->node = MSC_NODE;
 	return CMD_SUCCESS;
 }