/* Resolve the referenced port number into a port struct pointer.  */
static struct stlport* stl_getport(int brdnr, int panelnr, int portnr)
/* Resolve the referenced port number into a port struct pointer.  */
static struct stlport* stl_getport(int brdnr, int panelnr, int portnr)
{
	struct stlbrd	*brdp;
	struct stlpanel	*panelp;
	if (brdnr < 0 || brdnr >= STL_MAXBRDS)
		return NULL;
	brdp = stl_brds[brdnr];
	if (brdp == NULL)
		return NULL;
	if (panelnr < 0 || (unsigned int)panelnr >= brdp->nrpanels)
		return NULL;
	panelp = brdp->panels[panelnr];
	if (panelp == NULL)
		return NULL;
	if (portnr < 0 || (unsigned int)portnr >= panelp->nrports)
		return NULL;
	return panelp->ports[portnr];
}