Skip to contentSkip to conversation

usb: makefile cleanup

RFC PATCH In review matt mooney 3 participants 6 messages Oct 6, 2010 – Oct 8, 2010

Subsystems (8)
USB Kbuild USB serial ATM +4 more subsystems
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 usb: makefile cleanup

For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file.

None of the dependencies are modified.

---

So here is a sample cleanup patch; I am not posting it to greg-kh or the rest of the necessary usb guys yet because I would like to know what you guys think first.

Thanks,
mfm

 drivers/usb/atm/Makefile            |    4 +-
 drivers/usb/c67x00/Makefile         |    6 ++--
 drivers/usb/core/Makefile           |   19 ++++------
 drivers/usb/early/Makefile          |    2 +-
 drivers/usb/gadget/Makefile         |   39 +++++++++-----------
 drivers/usb/host/Makefile           |   19 +++++-----
 drivers/usb/host/whci/Kbuild        |    2 +-
 drivers/usb/misc/Makefile           |   42 +++++++++++-----------
 drivers/usb/misc/sisusbvga/Makefile |    3 +-
 drivers/usb/mon/Makefile            |    2 +-
 drivers/usb/musb/Makefile           |   66 ++++++++--------------------------
 drivers/usb/otg/Makefile            |    7 ++--
 drivers/usb/serial/Makefile         |    9 ++---
 drivers/usb/storage/Makefile        |   37 ++++++++++---------
 drivers/usb/wusbcore/Makefile       |   17 +++++----
 15 files changed, 116 insertions(+), 158 deletions(-)
drivers/usb/atm/Makefile +2 -2
index d40a126..a5d792e 100644
@@ -2,10 +2,10 @@
 # Makefile for USB ATM/xDSL drivers
 #
 
+ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
+
 obj-$(CONFIG_USB_CXACRU)	+= cxacru.o
 obj-$(CONFIG_USB_SPEEDTOUCH)	+= speedtch.o
 obj-$(CONFIG_USB_UEAGLEATM)	+= ueagle-atm.o
 obj-$(CONFIG_USB_ATM)		+= usbatm.o
 obj-$(CONFIG_USB_XUSBATM)	+= xusbatm.o
-
-ccflags-$(CONFIG_USB_DEBUG)	:= -DDEBUG
drivers/usb/c67x00/Makefile +3 -3
index 868bc41..b121868 100644
@@ -2,8 +2,8 @@
 # Makefile for Cypress C67X00 USB Controller
 #
 
-ccflags-$(CONFIG_USB_DEBUG)		+= -DDEBUG
+ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
 
-obj-$(CONFIG_USB_C67X00_HCD)		+= c67x00.o
+obj-$(CONFIG_USB_C67X00_HCD)	+= c67x00.o
 
-c67x00-objs := c67x00-drv.o c67x00-ll-hpi.o c67x00-hcd.o c67x00-sched.o
+c67x00-y := c67x00-drv.o c67x00-ll-hpi.o c67x00-hcd.o c67x00-sched.o
drivers/usb/core/Makefile +7 -12
index 17c8e2d..507a4e1 100644
@@ -2,18 +2,13 @@
 # Makefile for USB Core files and filesystem
 #
 
-usbcore-objs	:= usb.o hub.o hcd.o urb.o message.o driver.o \
-			config.o file.o buffer.o sysfs.o endpoint.o \
-			devio.o notify.o generic.o quirks.o devices.o
-
-ifeq ($(CONFIG_PCI),y)
-	usbcore-objs	+= hcd-pci.o
-endif
+ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
 
-ifeq ($(CONFIG_USB_DEVICEFS),y)
-	usbcore-objs	+= inode.o
-endif
+usbcore-y := usb.o hub.o hcd.o urb.o message.o driver.o
+usbcore-y += config.o file.o buffer.o sysfs.o endpoint.o
+usbcore-y += devio.o notify.o generic.o quirks.o devices.o
 
-obj-$(CONFIG_USB)	+= usbcore.o
+usbcore-$(CONFIG_PCI)		+= hcd-pci.o
+usbcore-$(CONFIG_USB_DEVICEFS)	+= inode.o
 
-ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
+obj-$(CONFIG_USB)		+= usbcore.o
drivers/usb/early/Makefile +1 -1
index dfedee8..24bbe51 100644
@@ -2,4 +2,4 @@
 # Makefile for early USB devices
 #
 
-obj-$(CONFIG_EARLY_PRINTK_DBGP)        += ehci-dbgp.o
+obj-$(CONFIG_EARLY_PRINTK_DBGP) += ehci-dbgp.o
drivers/usb/gadget/Makefile +18 -21
index c682005..5780db4 100644
@@ -1,7 +1,7 @@
 #
 # USB peripheral controller drivers
 #
-ccflags-$(CONFIG_USB_GADGET_DEBUG)	:= -DDEBUG
+ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG
 
 obj-$(CONFIG_USB_DUMMY_HCD)	+= dummy_hcd.o
 obj-$(CONFIG_USB_NET2280)	+= net2280.o
@@ -16,10 +16,8 @@ obj-$(CONFIG_USB_S3C2410)	+= s3c2410_udc.o
 obj-$(CONFIG_USB_AT91)		+= at91_udc.o
 obj-$(CONFIG_USB_ATMEL_USBA)	+= atmel_usba_udc.o
 obj-$(CONFIG_USB_FSL_USB2)	+= fsl_usb2_udc.o
-fsl_usb2_udc-objs		:= fsl_udc_core.o
-ifeq ($(CONFIG_ARCH_MXC),y)
-fsl_usb2_udc-objs		+= fsl_mxc_udc.o
-endif
+fsl_usb2_udc-y			:= fsl_udc_core.o
+fsl_usb2_udc-$(CONFIG_ARCH_MXC)	+= fsl_mxc_udc.o
 obj-$(CONFIG_USB_M66592)	+= m66592-udc.o
 obj-$(CONFIG_USB_R8A66597)	+= r8a66597-udc.o
 obj-$(CONFIG_USB_FSL_QE)	+= fsl_qe_udc.o
@@ -30,21 +28,21 @@ obj-$(CONFIG_USB_LANGWELL)	+= langwell_udc.o
 #
 # USB gadget drivers
 #
-g_zero-objs			:= zero.o
-g_audio-objs			:= audio.o
-g_ether-objs			:= ether.o
-g_serial-objs			:= serial.o
-g_midi-objs			:= gmidi.o
-gadgetfs-objs			:= inode.o
-g_file_storage-objs		:= file_storage.o
-g_mass_storage-objs		:= mass_storage.o
-g_printer-objs			:= printer.o
-g_cdc-objs			:= cdc2.o
-g_multi-objs			:= multi.o
-g_hid-objs			:= hid.o
-g_dbgp-objs			:= dbgp.o
-g_nokia-objs			:= nokia.o
-g_webcam-objs			:= webcam.o
+g_zero-y			:= zero.o
+g_audio-y			:= audio.o
+g_ether-y			:= ether.o
+g_serial-y			:= serial.o
+g_midi-y			:= gmidi.o
+gadgetfs-y			:= inode.o
+g_file_storage-y		:= file_storage.o
+g_mass_storage-y		:= mass_storage.o
+g_printer-y			:= printer.o
+g_cdc-y				:= cdc2.o
+g_multi-y			:= multi.o
+g_hid-y				:= hid.o
+g_dbgp-y			:= dbgp.o
+g_nokia-y			:= nokia.o
+g_webcam-y			:= webcam.o
 
 obj-$(CONFIG_USB_ZERO)		+= g_zero.o
 obj-$(CONFIG_USB_AUDIO)		+= g_audio.o
@@ -62,4 +60,3 @@ obj-$(CONFIG_USB_G_DBGP)	+= g_dbgp.o
 obj-$(CONFIG_USB_G_MULTI)	+= g_multi.o
 obj-$(CONFIG_USB_G_NOKIA)	+= g_nokia.o
 obj-$(CONFIG_USB_G_WEBCAM)	+= g_webcam.o
-
drivers/usb/host/Makefile +10 -9
index f041442..fc10a03 100644
@@ -2,15 +2,17 @@
 # Makefile for USB Host Controller Drivers
 #
 
-ccflags-$(CONFIG_USB_DEBUG)	:= -DDEBUG
+ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
 
-isp1760-objs := isp1760-hcd.o isp1760-if.o
-fhci-objs := fhci-hcd.o fhci-hub.o fhci-q.o fhci-mem.o \
-	     fhci-tds.o fhci-sched.o
-ifeq ($(CONFIG_FHCI_DEBUG),y)
-fhci-objs += fhci-dbg.o
-endif
-xhci-hcd-objs := xhci.o xhci-mem.o xhci-pci.o xhci-ring.o xhci-hub.o xhci-dbg.o
+isp1760-y := isp1760-hcd.o isp1760-if.o
+
+fhci-y := fhci-hcd.o fhci-hub.o fhci-q.o
+fhci-y += fhci-mem.o fhci-tds.o fhci-sched.o
+
+fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
+
+xhci-hcd-y := xhci.o xhci-mem.o xhci-pci.o
+xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
 
 obj-$(CONFIG_USB_WHCI_HCD)	+= whci/
 
@@ -31,4 +33,3 @@ obj-$(CONFIG_USB_R8A66597_HCD)	+= r8a66597-hcd.o
 obj-$(CONFIG_USB_ISP1760_HCD)	+= isp1760.o
 obj-$(CONFIG_USB_HWA_HCD)	+= hwa-hc.o
 obj-$(CONFIG_USB_IMX21_HCD)	+= imx21-hcd.o
-
drivers/usb/host/whci/Kbuild +1 -1
index 11e5040..26df013 100644
@@ -3,7 +3,7 @@ obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o
 whci-hcd-y := \
 	asl.o	\
 	debug.o \
-	hcd.o 	\
+	hcd.o	\
 	hw.o	\
 	init.o	\
 	int.o	\
drivers/usb/misc/Makefile +21 -21

47 lines not on this page · raw message

drivers/usb/misc/sisusbvga/Makefile +1 -2
index 7f934cf..3142476 100644
@@ -4,5 +4,4 @@
 
 obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga.o
 
-sisusbvga-objs := sisusb.o sisusb_init.o sisusb_con.o
-
+sisusbvga-y := sisusb.o sisusb_init.o sisusb_con.o
drivers/usb/mon/Makefile +1 -1
index 384b198..8ed24ab 100644
@@ -2,6 +2,6 @@
 # Makefile for USB monitor
 #
 
-usbmon-objs	:= mon_main.o mon_stat.o mon_text.o mon_bin.o
+usbmon-y := mon_main.o mon_stat.o mon_text.o mon_bin.o
 
 obj-$(CONFIG_USB_MON)	+= usbmon.o
drivers/usb/musb/Makefile +16 -50

89 lines not on this page · raw message

drivers/usb/otg/Makefile +3 -4
index aeb49a8..5d28372 100644
@@ -2,6 +2,9 @@
 # OTG infrastructure and transceiver drivers
 #
 
+ccflags-$(CONFIG_USB_DEBUG)		:= -DDEBUG
+ccflags-$(CONFIG_USB_GADGET_DEBUG)	+= -DDEBUG
+
 # infrastructure
 obj-$(CONFIG_USB_OTG_UTILS)	+= otg.o
 
@@ -11,7 +14,3 @@ obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
 obj-$(CONFIG_TWL4030_USB)	+= twl4030-usb.o
 obj-$(CONFIG_NOP_USB_XCEIV)	+= nop-usb-xceiv.o
 obj-$(CONFIG_USB_ULPI)		+= ulpi.o
-
-ccflags-$(CONFIG_USB_DEBUG)	+= -DDEBUG
-ccflags-$(CONFIG_USB_GADGET_DEBUG) += -DDEBUG
-
drivers/usb/serial/Makefile +4 -5
index 40ebe17..9e536ee 100644
@@ -6,10 +6,10 @@
 
 obj-$(CONFIG_USB_SERIAL)			+= usbserial.o
 
-usbserial-obj-$(CONFIG_USB_SERIAL_CONSOLE)	+= console.o
-usbserial-obj-$(CONFIG_USB_EZUSB)		+= ezusb.o
+usbserial-y := usb-serial.o generic.o bus.o
 
-usbserial-objs	:= usb-serial.o generic.o bus.o $(usbserial-obj-y)
+usbserial-$(CONFIG_USB_SERIAL_CONSOLE)	+= console.o
+usbserial-$(CONFIG_USB_EZUSB)		+= ezusb.o
 
 obj-$(CONFIG_USB_SERIAL_AIRCABLE)		+= aircable.o
 obj-$(CONFIG_USB_SERIAL_ARK3116)		+= ark3116.o
@@ -58,6 +58,5 @@ obj-$(CONFIG_USB_SERIAL_TI)			+= ti_usb_3410_5052.o
 obj-$(CONFIG_USB_SERIAL_VISOR)			+= visor.o
 obj-$(CONFIG_USB_SERIAL_WHITEHEAT)		+= whiteheat.o
 obj-$(CONFIG_USB_SERIAL_XIRCOM)			+= keyspan_pda.o
-obj-$(CONFIG_USB_SERIAL_VIVOPAY_SERIAL)	+= vivopay-serial.o
+obj-$(CONFIG_USB_SERIAL_VIVOPAY_SERIAL)		+= vivopay-serial.o
 obj-$(CONFIG_USB_SERIAL_ZIO)			+= zio.o
-
drivers/usb/storage/Makefile +19 -18
index 786f086..660a5fc 100644
@@ -5,20 +5,21 @@
 # Rewritten to use lists instead of if-statements.
 #
 
-ccflags-y	:= -Idrivers/scsi
+ccflags-y := -Idrivers/scsi
 
-obj-$(CONFIG_USB_STORAGE)	+= usb-storage.o
+obj-$(CONFIG_USB_STORAGE) += usb-storage.o
 
-usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG)	+= debug.o
+usb-storage-y := scsiglue.o protocol.o transport.o usb.o
+usb-storage-y += initializers.o sierra_ms.o option_ms.o
+
+usb-storage-$(CONFIG_USB_STORAGE_DEBUG) += debug.o
 
-usb-storage-objs :=	scsiglue.o protocol.o transport.o usb.o \
-			initializers.o sierra_ms.o option_ms.o $(usb-storage-obj-y)
 
 ifeq ($(CONFIG_USB_LIBUSUAL),)
-	usb-storage-objs	+= usual-tables.o
+	usb-storage-y += usual-tables.o
 else
 	obj-$(CONFIG_USB)	+= usb-libusual.o
-	usb-libusual-objs	:= libusual.o usual-tables.o
+	usb-libusual-y		:= libusual.o usual-tables.o
 endif
 
 obj-$(CONFIG_USB_STORAGE_ALAUDA)	+= ums-alauda.o
@@ -33,14 +34,14 @@ obj-$(CONFIG_USB_STORAGE_SDDR09)	+= ums-sddr09.o
 obj-$(CONFIG_USB_STORAGE_SDDR55)	+= ums-sddr55.o
 obj-$(CONFIG_USB_STORAGE_USBAT)		+= ums-usbat.o
 
-ums-alauda-objs		:= alauda.o
-ums-cypress-objs	:= cypress_atacb.o
-ums-datafab-objs	:= datafab.o
-ums-freecom-objs	:= freecom.o
-ums-isd200-objs		:= isd200.o
-ums-jumpshot-objs	:= jumpshot.o
-ums-karma-objs		:= karma.o
-ums-onetouch-objs	:= onetouch.o
-ums-sddr09-objs		:= sddr09.o
-ums-sddr55-objs		:= sddr55.o
-ums-usbat-objs		:= shuttle_usbat.o
+ums-alauda-y		:= alauda.o
+ums-cypress-y		:= cypress_atacb.o
+ums-datafab-y		:= datafab.o
+ums-freecom-y		:= freecom.o
+ums-isd200-y		:= isd200.o
+ums-jumpshot-y		:= jumpshot.o
+ums-karma-y		:= karma.o
+ums-onetouch-y		:= onetouch.o
+ums-sddr09-y		:= sddr09.o
+ums-sddr55-y		:= sddr55.o
+ums-usbat-y		:= shuttle_usbat.o
drivers/usb/wusbcore/Makefile +9 -8
index f0d8045..b3bd313 100644
@@ -1,9 +1,11 @@
+ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+
 obj-$(CONFIG_USB_WUSB)		+= wusbcore.o
 obj-$(CONFIG_USB_HWA_HCD)	+= wusb-wa.o
 obj-$(CONFIG_USB_WUSB_CBAF)	+= wusb-cbaf.o
 
 
-wusbcore-objs := 	\
+wusbcore-y :=		\
 	crypto.o	\
 	devconnect.o	\
 	dev-sysfs.o	\
@@ -14,11 +16,10 @@ wusbcore-objs := 	\
 	security.o	\
 	wusbhc.o
 
-wusb-cbaf-objs := cbaf.o
+wusb-cbaf-y := cbaf.o
 
-wusb-wa-objs :=	wa-hc.o		\
-		wa-nep.o	\
-		wa-rpipe.o	\
-		wa-xfer.o
-
-ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+wusb-wa-y :=		\
+	wa-hc.o		\
+	wa-nep.o	\
+	wa-rpipe.o	\
+	wa-xfer.o
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 5 lines · matt mooney

For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file.

Quoted 8 lines

None of the dependencies are modified.

---

So here is a sample cleanup patch; I am not posting it to greg-kh or the rest of the necessary usb guys yet because I would like to know what you guys think first.

The elimination of conditionals in Makefiles is definitely worth it. Not sure about pure whitespace fixes, if the USB developers don't show interest, you can try pushing these through [email protected]. I have only one remark below:

Quoted 18 lines
drivers/usb/musb/Makefile +2 -2
index 4fd29f8..b1f79ae 100644
[...]
 # the kconfig must guarantee that only one of the
 # possible I/O schemes will be enabled at a time ...
@@ -54,24 +27,17 @@ endif
 ifneq ($(CONFIG_MUSB_PIO_ONLY),y)
 
   ifeq ($(CONFIG_USB_INVENTRA_DMA),y)
-    musb_hdrc-objs		+= musbhsdma.o
+    musb_hdrc-y			+= musbhsdma.o
 
   else
     ifeq ($(CONFIG_USB_TI_CPPI_DMA),y)
-      musb_hdrc-objs		+= cppi_dma.o
+      musb_hdrc-y		+= cppi_dma.o

drivers/usb/musb/Makefile endif · line 43

Quoted 10 lines
drivers/usb/musb/Makefile +1 -1
 
     else
       ifeq ($(CONFIG_USB_TUSB_OMAP_DMA),y)
-        musb_hdrc-objs		+= tusb6010_omap.o
+	musb_hdrc-y		+= tusb6010_omap.o
 
       endif
     endif
   endif
 endif

So this wasn't exactly elegant before and you are only changing *-objs to *-y. Looking at drivers/usb/musb/Kconfig, al the three USB_*_DMA depend on !MUSB_PIO_ONLY, so the outermost if statement can go away. Furthermore, the intent seems to be to only enable one of the four modes (MUSB_PIO_ONLY, USB_INVENTRA_DMA, USB_TI_CPPI_DMA or USB_TUSB_OMAP_DMA), so it is a perfect candidate for a "choice" group. Have a look e.g. at "PCI access mode" in arch/x86/Kconfig. Then, the Makefile part can be reduced to three lines without any ifs.

Michal

#2 lore raw
Quoted 11 lines · Michal Marek
Quoted 10 lines · matt mooney

For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file.

None of the dependencies are modified.

---

Quoted 8 lines
Quoted 3 lines

So here is a sample cleanup patch; I am not posting it to greg-kh or the rest of the necessary usb guys yet because I would like to know what you guys think first.

The elimination of conditionals in Makefiles is definitely worth it. Not sure about pure whitespace fixes, if the USB developers don't show interest, you can try pushing these through [email protected]. I have only one remark below:

I questioned this myself, but I concluded that whitespace fixes help with readability (of course this is purely subjective).

Quoted 24 lines
Quoted 24 lines
drivers/usb/musb/Makefile +3 -3
index 4fd29f8..b1f79ae 100644
[...]
 # the kconfig must guarantee that only one of the
 # possible I/O schemes will be enabled at a time ...
@@ -54,24 +27,17 @@ endif
 ifneq ($(CONFIG_MUSB_PIO_ONLY),y)
 
   ifeq ($(CONFIG_USB_INVENTRA_DMA),y)
-    musb_hdrc-objs		+= musbhsdma.o
+    musb_hdrc-y			+= musbhsdma.o
 
   else
     ifeq ($(CONFIG_USB_TI_CPPI_DMA),y)
-      musb_hdrc-objs		+= cppi_dma.o
+      musb_hdrc-y		+= cppi_dma.o
 
     else
       ifeq ($(CONFIG_USB_TUSB_OMAP_DMA),y)
-        musb_hdrc-objs		+= tusb6010_omap.o
+	musb_hdrc-y		+= tusb6010_omap.o
 
Quoted 13 lines

drivers/usb/musb/Makefile endif · line 43

Quoted 4 lines
drivers/usb/musb/Makefile +0 -0
       endif
     endif
   endif
 endif

So this wasn't exactly elegant before and you are only changing *-objs to *-y. Looking at drivers/usb/musb/Kconfig, al the three USB_*_DMA depend on !MUSB_PIO_ONLY, so the outermost if statement can go away. Furthermore, the intent seems to be to only enable one of the four modes (MUSB_PIO_ONLY, USB_INVENTRA_DMA, USB_TI_CPPI_DMA or USB_TUSB_OMAP_DMA), so it is a perfect candidate for a "choice" group. Have a look e.g. at "PCI access mode" in arch/x86/Kconfig. Then, the Makefile part can be reduced to three lines without any ifs.

I thought this section was more of a Kconfig issue although I am not all that familiar with Kconfig yet. After I look into it a little more and better understand your advice, I will send a separate patch to fix this.

Thanks,
mfm

Acked-by on v1 1/1
#3 lore raw
In reply to matt mooney
Quoted 8 lines · matt mooney

For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file.

None of the dependencies are modified.

Looks good. I agree with Michal's comment about
moving the complexity from MAkefile to Kconfig.
But I think that should be a follow-up patch.

You can add my:

Two trivial comments...
You can keep my ack independent of addressing these comments or not.

Sam

drivers/usb/host/whci/Kbuild obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o · line 9

Quoted 13 lines
drivers/usb/host/whci/Kbuild +1 -1
index 11e5040..26df013 100644
@@ -3,7 +3,7 @@ obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o
 whci-hcd-y := \
 	asl.o	\
 	debug.o \
-	hcd.o 	\
+	hcd.o	\
 	hw.o	\
 	init.o	\
 	int.o	\

I would be good to loose the "\"

Quoted 25 lines
drivers/usb/wusbcore/Makefile +4 -3
index f0d8045..b3bd313 100644
@@ -1,9 +1,11 @@
+ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+
 obj-$(CONFIG_USB_WUSB)		+= wusbcore.o
 obj-$(CONFIG_USB_HWA_HCD)	+= wusb-wa.o
 obj-$(CONFIG_USB_WUSB_CBAF)	+= wusb-cbaf.o
 
 
-wusbcore-objs := 	\
+wusbcore-y :=		\
 	crypto.o	\
 	devconnect.o	\
 	dev-sysfs.o	\
@@ -14,11 +16,10 @@ wusbcore-objs := 	\
 	security.o	\
 	wusbhc.o
 
-wusb-cbaf-objs := cbaf.o
+wusb-cbaf-y := cbaf.o
 
-wusb-wa-objs :=	wa-hc.o		\

drivers/usb/wusbcore/Makefile wusbcore-objs := \ · line 25

Quoted 10 lines
drivers/usb/wusbcore/Makefile +5 -5
-		wa-nep.o	\
-		wa-rpipe.o	\
-		wa-xfer.o
-
-ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+wusb-wa-y :=		\
+	wa-hc.o		\
+	wa-nep.o	\
+	wa-rpipe.o	\
+	wa-xfer.o

This file could also benefit from loosing the excessive use of "\".

Sam

#4 lore raw
Quoted 62 lines · Sam Ravnborg
Quoted 8 lines · matt mooney

For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file.

None of the dependencies are modified.

Looks good. I agree with Michal's comment about
moving the complexity from MAkefile to Kconfig.
But I think that should be a follow-up patch.

You can add my:

Two trivial comments...
You can keep my ack independent of addressing these comments or not.

Sam

drivers/usb/host/whci/Kbuild obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o · line 9

Quoted 13 lines
drivers/usb/host/whci/Kbuild +1 -1
index 11e5040..26df013 100644
@@ -3,7 +3,7 @@ obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o
 whci-hcd-y := \
 	asl.o	\
 	debug.o \
-	hcd.o 	\
+	hcd.o	\
 	hw.o	\
 	init.o	\
 	int.o	\

I would be good to loose the "\"

Quoted 24 lines
drivers/usb/wusbcore/Makefile +4 -2
index f0d8045..b3bd313 100644
@@ -1,9 +1,11 @@
+ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+
 obj-$(CONFIG_USB_WUSB)		+= wusbcore.o
 obj-$(CONFIG_USB_HWA_HCD)	+= wusb-wa.o
 obj-$(CONFIG_USB_WUSB_CBAF)	+= wusb-cbaf.o
 
 
-wusbcore-objs := 	\
+wusbcore-y :=		\
 	crypto.o	\
 	devconnect.o	\
 	dev-sysfs.o	\
@@ -14,11 +16,10 @@ wusbcore-objs := 	\
 	security.o	\
 	wusbhc.o
 
-wusb-cbaf-objs := cbaf.o
+wusb-cbaf-y := cbaf.o
 
Quoted 12 lines

drivers/usb/wusbcore/Makefile wusbcore-objs := \ · line 25

Quoted 11 lines
drivers/usb/wusbcore/Makefile +5 -6
-wusb-wa-objs :=	wa-hc.o		\
-		wa-nep.o	\
-		wa-rpipe.o	\
-		wa-xfer.o
-
-ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+wusb-wa-y :=		\
+	wa-hc.o		\
+	wa-nep.o	\
+	wa-rpipe.o	\
+	wa-xfer.o

This file could also benefit from loosing the excessive use of "\".

I know, I am not a fan of this either. My reasoning for leaving it is that the original author wanted each file to be on a separate line, so I felt I had two
choices: 1) combine some of the files onto a single line and add another statement with +=, or 2) keep all on a their own line and use += for all. In the end, I figured it was at least better than some of those other multi file statements using "\" that either lined up oddly or had to resort to spaces. (Not to mention, I worried that this change would be unwelcomed; however, I really wanted to make it.)

So I will add your ack and send the patch off to see how the changes are received.

Thanks,
mfm

#5 lore raw
In reply to Sam Ravnborg
Quoted 62 lines · Sam Ravnborg
Quoted 8 lines · matt mooney

For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file.

None of the dependencies are modified.

Looks good. I agree with Michal's comment about
moving the complexity from MAkefile to Kconfig.
But I think that should be a follow-up patch.

You can add my:

Two trivial comments...
You can keep my ack independent of addressing these comments or not.

Sam

drivers/usb/host/whci/Kbuild obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o · line 9

Quoted 13 lines
drivers/usb/host/whci/Kbuild +1 -1
index 11e5040..26df013 100644
@@ -3,7 +3,7 @@ obj-$(CONFIG_USB_WHCI_HCD) += whci-hcd.o
 whci-hcd-y := \
 	asl.o	\
 	debug.o \
-	hcd.o 	\
+	hcd.o	\
 	hw.o	\
 	init.o	\
 	int.o	\

I would be good to loose the "\"

Quoted 24 lines
drivers/usb/wusbcore/Makefile +4 -2
index f0d8045..b3bd313 100644
@@ -1,9 +1,11 @@
+ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+
 obj-$(CONFIG_USB_WUSB)		+= wusbcore.o
 obj-$(CONFIG_USB_HWA_HCD)	+= wusb-wa.o
 obj-$(CONFIG_USB_WUSB_CBAF)	+= wusb-cbaf.o
 
 
-wusbcore-objs := 	\
+wusbcore-y :=		\
 	crypto.o	\
 	devconnect.o	\
 	dev-sysfs.o	\
@@ -14,11 +16,10 @@ wusbcore-objs := 	\
 	security.o	\
 	wusbhc.o
 
-wusb-cbaf-objs := cbaf.o
+wusb-cbaf-y := cbaf.o
 
Quoted 12 lines

drivers/usb/wusbcore/Makefile wusbcore-objs := \ · line 25

Quoted 11 lines
drivers/usb/wusbcore/Makefile +5 -6
-wusb-wa-objs :=	wa-hc.o		\
-		wa-nep.o	\
-		wa-rpipe.o	\
-		wa-xfer.o
-
-ccflags-$(CONFIG_USB_WUSB_CBAF_DEBUG) := -DDEBUG
+wusb-wa-y :=		\
+	wa-hc.o		\
+	wa-nep.o	\
+	wa-rpipe.o	\
+	wa-xfer.o

This file could also benefit from loosing the excessive use of "\".

Maybe this should have been changed. A lot of the staging makefiles are doing this.

-mfm
k