From 68e160886a37d3a5e8653531282c96642911a49b Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Tue, 22 Aug 2006 23:49:36 +0000 Subject: [PATCH] (media_status): Factor common code between IFM_ETHER and IFM_ATM cases. (print_media_word, print_media_word_ifconfig): Remove unnecessary goto following test for null desc. PR: bin/102354 Submitted by: Ricardo Nabinger Sanchez MFC after: 1 week --- sbin/ifconfig/ifmedia.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index 4f49bdea5a97..398f1b757fa5 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -146,6 +146,7 @@ media_status(int s) printf("\tstatus: "); switch (IFM_TYPE(ifmr.ifm_active)) { case IFM_ETHER: + case IFM_ATM: if (ifmr.ifm_status & IFM_ACTIVE) printf("active"); else @@ -160,13 +161,6 @@ media_status(int s) printf("no ring"); break; - case IFM_ATM: - if (ifmr.ifm_status & IFM_ACTIVE) - printf("active"); - else - printf("no carrier"); - break; - case IFM_IEEE80211: /* XXX: Different value for adhoc? */ if (ifmr.ifm_status & IFM_ACTIVE) @@ -692,14 +686,11 @@ print_media_word(int ifmw, int print_toptype) /* Find subtype. */ desc = get_subtype_desc(ifmw, ttos); - if (desc != NULL) - goto got_subtype; + if (desc == NULL) { + printf(""); + return; + } - /* Falling to here means unknown subtype. */ - printf(""); - return; - - got_subtype: if (print_toptype) putchar(' '); @@ -750,14 +741,11 @@ print_media_word_ifconfig(int ifmw) /* Find subtype. */ desc = get_subtype_desc(ifmw, ttos); - if (desc != NULL) - goto got_subtype; + if (desc == NULL) { + printf(""); + return; + } - /* Falling to here means unknown subtype. */ - printf(""); - return; - - got_subtype: printf("media %s", desc->ifmt_string); desc = get_mode_desc(ifmw, ttos);