From owner-svn-src-all@freebsd.org Fri May 12 05:53:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A73BAD69739; Fri, 12 May 2017 05:53:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D84FA68; Fri, 12 May 2017 05:53:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4C5rSHD056908; Fri, 12 May 2017 05:53:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4C5rSOI056907; Fri, 12 May 2017 05:53:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705120553.v4C5rSOI056907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 12 May 2017 05:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318221 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2017 05:53:29 -0000 Author: adrian Date: Fri May 12 05:53:28 2017 New Revision: 318221 URL: https://svnweb.freebsd.org/changeset/base/318221 Log: [iwm] Deduplicate code in iwm_auth() from an if condition. Obtained from: dragonflybsd.git 03c6e6970115727c9d39f9358e0500ab4f4634cd Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Fri May 12 05:51:50 2017 (r318220) +++ head/sys/dev/iwm/if_iwm.c Fri May 12 05:53:28 2017 (r318221) @@ -4152,24 +4152,6 @@ iwm_auth(struct ieee80211vap *vap, struc "%s: failed to update MAC\n", __func__); goto out; } - if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], - in->in_ni.ni_chan, 1, 1)) != 0) { - device_printf(sc->sc_dev, - "%s: failed update phy ctxt\n", __func__); - goto out; - } - iv->phy_ctxt = &sc->sc_phyctxt[0]; - - if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { - device_printf(sc->sc_dev, - "%s: binding update cmd\n", __func__); - goto out; - } - if ((error = iwm_mvm_add_sta(sc, in)) != 0) { - device_printf(sc->sc_dev, - "%s: failed to add sta\n", __func__); - goto out; - } } else { if ((error = iwm_mvm_mac_ctxt_add(sc, vap)) != 0) { device_printf(sc->sc_dev, @@ -4182,25 +4164,25 @@ iwm_auth(struct ieee80211vap *vap, struc __func__); goto out; } - if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], - in->in_ni.ni_chan, 1, 1)) != 0) { - device_printf(sc->sc_dev, - "%s: failed add phy ctxt!\n", __func__); - error = ETIMEDOUT; - goto out; - } - iv->phy_ctxt = &sc->sc_phyctxt[0]; + } - if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { - device_printf(sc->sc_dev, - "%s: binding add cmd\n", __func__); - goto out; - } - if ((error = iwm_mvm_add_sta(sc, in)) != 0) { - device_printf(sc->sc_dev, - "%s: failed to add sta\n", __func__); - goto out; - } + if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], + in->in_ni.ni_chan, 1, 1)) != 0) { + device_printf(sc->sc_dev, + "%s: failed update phy ctxt\n", __func__); + goto out; + } + iv->phy_ctxt = &sc->sc_phyctxt[0]; + + if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { + device_printf(sc->sc_dev, + "%s: binding update cmd\n", __func__); + goto out; + } + if ((error = iwm_mvm_add_sta(sc, in)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to add sta\n", __func__); + goto out; } /*