From owner-svn-src-user@FreeBSD.ORG Wed Oct 6 23:47:52 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B901065679; Wed, 6 Oct 2010 23:47:52 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89C7C8FC1F; Wed, 6 Oct 2010 23:47:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o96Nlqr8021788; Wed, 6 Oct 2010 23:47:52 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o96NlqTw021779; Wed, 6 Oct 2010 23:47:52 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201010062347.o96NlqTw021779@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 6 Oct 2010 23:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213502 - user/weongyo/usb/sys/dev/usb/controller X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 23:47:52 -0000 Author: weongyo Date: Wed Oct 6 23:47:52 2010 New Revision: 213502 URL: http://svn.freebsd.org/changeset/base/213502 Log: Cleans up ..._BUS2SC() macros that don't need to use container_of()-like macros because the usb_bus already knows how to get the softc pointer. Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c user/weongyo/usb/sys/dev/usb/controller/atmegadci.c user/weongyo/usb/sys/dev/usb/controller/avr32dci.c user/weongyo/usb/sys/dev/usb/controller/ehci.c user/weongyo/usb/sys/dev/usb/controller/musb_otg.c user/weongyo/usb/sys/dev/usb/controller/ohci.c user/weongyo/usb/sys/dev/usb/controller/uhci.c user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Modified: user/weongyo/usb/sys/dev/usb/controller/at91dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/at91dci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/at91dci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -81,9 +81,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define AT9100_DCI_BUS2SC(bus) \ - ((struct at91dci_softc *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((struct at91dci_softc *)0)->sc_bus)))) +#define AT9100_DCI_BUS2SC(bus) (device_get_softc((bus)->parent)) #define AT9100_DCI_PC2SC(pc) \ AT9100_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) Modified: user/weongyo/usb/sys/dev/usb/controller/atmegadci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/atmegadci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define ATMEGA_BUS2SC(bus) \ - ((struct atmegadci_softc *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((struct atmegadci_softc *)0)->sc_bus)))) +#define ATMEGA_BUS2SC(bus) (device_get_softc((bus)->parent)) #define ATMEGA_PC2SC(pc) \ ATMEGA_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) Modified: user/weongyo/usb/sys/dev/usb/controller/avr32dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/avr32dci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define AVR32_BUS2SC(bus) \ - ((struct avr32dci_softc *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((struct avr32dci_softc *)0)->sc_bus)))) +#define AVR32_BUS2SC(bus) (device_get_softc((bus)->parent)) #define AVR32_PC2SC(pc) \ AVR32_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) Modified: user/weongyo/usb/sys/dev/usb/controller/ehci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ehci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/ehci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -84,9 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define EHCI_BUS2SC(bus) \ - ((ehci_softc_t *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((ehci_softc_t *)0)->sc_bus)))) +#define EHCI_BUS2SC(bus) (device_get_softc((bus)->parent)) #ifdef USB_DEBUG static int ehcidebug = 0; Modified: user/weongyo/usb/sys/dev/usb/controller/musb_otg.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/musb_otg.c Wed Oct 6 23:47:52 2010 (r213502) @@ -75,9 +75,7 @@ #define MUSBOTG_INTR_ENDPT 1 -#define MUSBOTG_BUS2SC(bus) \ - ((struct musbotg_softc *)(((uint8_t *)(bus)) - \ - USB_P2U(&(((struct musbotg_softc *)0)->sc_bus)))) +#define MUSBOTG_BUS2SC(bus) (device_get_softc((bus)->parent)) #define MUSBOTG_PC2SC(pc) \ MUSBOTG_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus) Modified: user/weongyo/usb/sys/dev/usb/controller/ohci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/ohci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/ohci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define OHCI_BUS2SC(bus) \ - ((ohci_softc_t *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((ohci_softc_t *)0)->sc_bus)))) +#define OHCI_BUS2SC(bus) (device_get_softc((bus)->parent)) #ifdef USB_DEBUG static int ohcidebug = 0; Modified: user/weongyo/usb/sys/dev/usb/controller/uhci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uhci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/uhci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$"); #include #define alt_next next -#define UHCI_BUS2SC(bus) \ - ((uhci_softc_t *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((uhci_softc_t *)0)->sc_bus)))) +#define UHCI_BUS2SC(bus) (device_get_softc((bus)->parent)) #ifdef USB_DEBUG static int uhcidebug = 0; Modified: user/weongyo/usb/sys/dev/usb/controller/uss820dci.c ============================================================================== --- user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Wed Oct 6 23:13:30 2010 (r213501) +++ user/weongyo/usb/sys/dev/usb/controller/uss820dci.c Wed Oct 6 23:47:52 2010 (r213502) @@ -69,9 +69,7 @@ #include #include -#define USS820_DCI_BUS2SC(bus) \ - ((struct uss820dci_softc *)(((uint8_t *)(bus)) - \ - ((uint8_t *)&(((struct uss820dci_softc *)0)->sc_bus)))) +#define USS820_DCI_BUS2SC(bus) (device_get_softc((bus)->parent)) #define USS820_DCI_PC2SC(pc) \ USS820_DCI_BUS2SC(USB_DMATAG_TO_XROOT((pc)->tag_parent)->bus)