if missing 24 is just mistake, then I think that you should do it different way, which is more readable:

```
string type = TypeBySysfs[ sys_type]: nil;

//detect eth subtype
if (type =="eth")
  type = GetEthTypeFromSysfs( dev);
//detect ib subtype
else if (type == "ib")
  type = GetIbTypeFromSysfs( dev);