public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: matt mooney <mfm@muteddisk.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [RFC PATCH] usb: makefile cleanup
Date: Wed, 6 Oct 2010 17:17:03 -0700	[thread overview]
Message-ID: <20101007001703.GA31483@haskell.muteddisk.com> (raw)
In-Reply-To: <4CAC6521.3050303@suse.cz>

On 14:01 Wed 06 Oct     , Michal Marek wrote:
> On 6.10.2010 09:51, matt mooney wrote:
> > 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.
> > 
> > Signed-off-by: matt mooney <mfm@muteddisk.com>
> > ---
> > 
> > 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 trivial@kernel.org. 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).

> > diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
> > index 4fd29f8..b1f79ae 100644
> > --- a/drivers/usb/musb/Makefile
> > +++ b/drivers/usb/musb/Makefile
> > [...]
> >  # 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
> >  
> >        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

  reply	other threads:[~2010-10-07  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06  7:51 [RFC PATCH] usb: makefile cleanup matt mooney
2010-10-06 12:01 ` Michal Marek
2010-10-07  0:17   ` matt mooney [this message]
2010-10-06 16:50 ` Sam Ravnborg
2010-10-07  0:31   ` matt mooney
2010-10-08  7:47   ` matt mooney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101007001703.GA31483@haskell.muteddisk.com \
    --to=mfm@muteddisk.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox