Author: avos
Date: Fri Apr 29 22:14:11 2016
New Revision: 298818
URL: https://svnweb.freebsd.org/changeset/base/298818

Log:
  net80211 + drivers: hide size of 'bands' array behind a macro.
  
  Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.
  No functional changes.

Modified:
  head/sys/dev/bwi/if_bwi.c
  head/sys/dev/if_ndis/if_ndis.c
  head/sys/dev/iwi/if_iwi.c
  head/sys/dev/malo/if_malo.c
  head/sys/dev/otus/if_otus.c
  head/sys/dev/ral/rt2560.c
  head/sys/dev/ral/rt2661.c
  head/sys/dev/ral/rt2860.c
  head/sys/dev/rtwn/if_rtwn.c
  head/sys/dev/urtwn/if_urtwn.c
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/net80211/_ieee80211.h

Modified: head/sys/dev/bwi/if_bwi.c
==============================================================================
--- head/sys/dev/bwi/if_bwi.c   Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/bwi/if_bwi.c   Fri Apr 29 22:14:11 2016        (r298818)
@@ -356,7 +356,7 @@ bwi_attach(struct bwi_softc *sc)
        device_t dev = sc->sc_dev;
        struct bwi_mac *mac;
        struct bwi_phy *phy;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int i, error;
 
        BWI_LOCK_INIT(sc);

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c      Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/if_ndis/if_ndis.c      Fri Apr 29 22:14:11 2016        
(r298818)
@@ -725,7 +725,7 @@ ndis_80211attach(struct ndis_softc *sc)
        struct ndis_80211_nettype_list *ntl;
        uint32_t                arg;
        int                     mode, i, r, len, nonettypes = 1;
-       uint8_t                 bands[howmany(IEEE80211_MODE_MAX, 8)] = { 0 };
+       uint8_t                 bands[IEEE80211_MODE_BYTES] = { 0 };
 
        callout_init(&sc->ndis_scan_callout, 1);
 

Modified: head/sys/dev/iwi/if_iwi.c
==============================================================================
--- head/sys/dev/iwi/if_iwi.c   Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/iwi/if_iwi.c   Fri Apr 29 22:14:11 2016        (r298818)
@@ -271,7 +271,7 @@ iwi_attach(device_t dev)
        struct iwi_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
        uint16_t val;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int i, error;
 
        sc->sc_dev = dev;

Modified: head/sys/dev/malo/if_malo.c
==============================================================================
--- head/sys/dev/malo/if_malo.c Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/malo/if_malo.c Fri Apr 29 22:14:11 2016        (r298818)
@@ -174,7 +174,7 @@ malo_attach(uint16_t devid, struct malo_
        struct ieee80211com *ic = &sc->malo_ic;
        struct malo_hal *mh;
        int error;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
 
        MALO_LOCK_INIT(sc);
        callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0);

Modified: head/sys/dev/otus/if_otus.c
==============================================================================
--- head/sys/dev/otus/if_otus.c Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/otus/if_otus.c Fri Apr 29 22:14:11 2016        (r298818)
@@ -624,7 +624,7 @@ otus_attachhook(struct otus_softc *sc)
        struct ieee80211com *ic = &sc->sc_ic;
        usb_device_request_t req;
        uint32_t in, out;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int error;
 
        /* Not locked */

Modified: head/sys/dev/ral/rt2560.c
==============================================================================
--- head/sys/dev/ral/rt2560.c   Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/ral/rt2560.c   Fri Apr 29 22:14:11 2016        (r298818)
@@ -199,7 +199,7 @@ rt2560_attach(device_t dev, int id)
 {
        struct rt2560_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int error;
 
        sc->sc_dev = dev;

Modified: head/sys/dev/ral/rt2661.c
==============================================================================
--- head/sys/dev/ral/rt2661.c   Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/ral/rt2661.c   Fri Apr 29 22:14:11 2016        (r298818)
@@ -199,7 +199,7 @@ rt2661_attach(device_t dev, int id)
        struct rt2661_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
        uint32_t val;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int error, ac, ntries;
 
        sc->sc_id = id;

Modified: head/sys/dev/ral/rt2860.c
==============================================================================
--- head/sys/dev/ral/rt2860.c   Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/ral/rt2860.c   Fri Apr 29 22:14:11 2016        (r298818)
@@ -232,7 +232,7 @@ rt2860_attach(device_t dev, int id)
        struct rt2860_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
        uint32_t tmp;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int error, ntries, qid;
 
        sc->sc_dev = dev;

Modified: head/sys/dev/rtwn/if_rtwn.c
==============================================================================
--- head/sys/dev/rtwn/if_rtwn.c Fri Apr 29 21:54:28 2016        (r298817)
+++ head/sys/dev/rtwn/if_rtwn.c Fri Apr 29 22:14:11 2016        (r298818)
@@ -251,7 +251,7 @@ rtwn_attach(device_t dev)
        struct rtwn_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
        uint32_t lcsr;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int i, count, error, rid;
 
        sc->sc_dev = dev;

Modified: head/sys/dev/urtwn/if_urtwn.c
==============================================================================
--- head/sys/dev/urtwn/if_urtwn.c       Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/urtwn/if_urtwn.c       Fri Apr 29 22:14:11 2016        
(r298818)
@@ -490,7 +490,7 @@ urtwn_attach(device_t self)
        struct usb_attach_arg *uaa = device_get_ivars(self);
        struct urtwn_softc *sc = device_get_softc(self);
        struct ieee80211com *ic = &sc->sc_ic;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        int error;
 
        device_set_usb_desc(self);

Modified: head/sys/dev/usb/wlan/if_rsu.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rsu.c      Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_rsu.c      Fri Apr 29 22:14:11 2016        
(r298818)
@@ -404,7 +404,7 @@ rsu_attach(device_t self)
        struct rsu_softc *sc = device_get_softc(self);
        struct ieee80211com *ic = &sc->sc_ic;
        int error;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index;
        struct usb_interface *iface;
        const char *rft;

Modified: head/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rum.c      Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_rum.c      Fri Apr 29 22:14:11 2016        
(r298818)
@@ -477,7 +477,7 @@ rum_attach(device_t self)
        struct rum_softc *sc = device_get_softc(self);
        struct ieee80211com *ic = &sc->sc_ic;
        uint32_t tmp;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index;
        int error, ntries;
 

Modified: head/sys/dev/usb/wlan/if_run.c
==============================================================================
--- head/sys/dev/usb/wlan/if_run.c      Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_run.c      Fri Apr 29 22:14:11 2016        
(r298818)
@@ -704,7 +704,7 @@ run_attach(device_t self)
        struct usb_attach_arg *uaa = device_get_ivars(self);
        struct ieee80211com *ic = &sc->sc_ic;
        uint32_t ver;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index;
        int ntries, error;
 

Modified: head/sys/dev/usb/wlan/if_uath.c
==============================================================================
--- head/sys/dev/usb/wlan/if_uath.c     Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_uath.c     Fri Apr 29 22:14:11 2016        
(r298818)
@@ -328,7 +328,7 @@ uath_attach(device_t dev)
        struct uath_softc *sc = device_get_softc(dev);
        struct usb_attach_arg *uaa = device_get_ivars(dev);
        struct ieee80211com *ic = &sc->sc_ic;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index = UATH_IFACE_INDEX;         /* XXX */
        usb_error_t error;
 

Modified: head/sys/dev/usb/wlan/if_upgt.c
==============================================================================
--- head/sys/dev/usb/wlan/if_upgt.c     Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_upgt.c     Fri Apr 29 22:14:11 2016        
(r298818)
@@ -243,7 +243,7 @@ upgt_attach(device_t dev)
        struct upgt_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
        struct usb_attach_arg *uaa = device_get_ivars(dev);
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index = UPGT_IFACE_INDEX;
        int error;
 

Modified: head/sys/dev/usb/wlan/if_ural.c
==============================================================================
--- head/sys/dev/usb/wlan/if_ural.c     Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_ural.c     Fri Apr 29 22:14:11 2016        
(r298818)
@@ -424,7 +424,7 @@ ural_attach(device_t self)
        struct usb_attach_arg *uaa = device_get_ivars(self);
        struct ural_softc *sc = device_get_softc(self);
        struct ieee80211com *ic = &sc->sc_ic;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index;
        int error;
 

Modified: head/sys/dev/usb/wlan/if_urtw.c
==============================================================================
--- head/sys/dev/usb/wlan/if_urtw.c     Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_urtw.c     Fri Apr 29 22:14:11 2016        
(r298818)
@@ -785,7 +785,7 @@ urtw_attach(device_t dev)
        struct urtw_softc *sc = device_get_softc(dev);
        struct usb_attach_arg *uaa = device_get_ivars(dev);
        struct ieee80211com *ic = &sc->sc_ic;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index = URTW_IFACE_INDEX;         /* XXX */
        uint16_t n_setup;
        uint32_t data;

Modified: head/sys/dev/usb/wlan/if_zyd.c
==============================================================================
--- head/sys/dev/usb/wlan/if_zyd.c      Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/dev/usb/wlan/if_zyd.c      Fri Apr 29 22:14:11 2016        
(r298818)
@@ -334,7 +334,7 @@ zyd_attach(device_t dev)
        struct usb_attach_arg *uaa = device_get_ivars(dev);
        struct zyd_softc *sc = device_get_softc(dev);
        struct ieee80211com *ic = &sc->sc_ic;
-       uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)];
+       uint8_t bands[IEEE80211_MODE_BYTES];
        uint8_t iface_index;
        int error;
 

Modified: head/sys/net80211/_ieee80211.h
==============================================================================
--- head/sys/net80211/_ieee80211.h      Fri Apr 29 21:54:28 2016        
(r298817)
+++ head/sys/net80211/_ieee80211.h      Fri Apr 29 22:14:11 2016        
(r298818)
@@ -70,6 +70,7 @@ enum ieee80211_phymode {
        IEEE80211_MODE_QUARTER  = 11,   /* OFDM, 1/4x clock */
 };
 #define        IEEE80211_MODE_MAX      (IEEE80211_MODE_QUARTER+1)
+#define        IEEE80211_MODE_BYTES    2       /* howmany(IEEE80211_MODE_MAX, 
NBBY) */
 
 /*
  * Operating mode.  Devices do not necessarily support
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to