All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: spi-devel-general@lists.sourceforge.net
Cc: 'linuxppc-dev Development' <linuxppc-dev@ozlabs.org>
Subject: Re: [spi-devel-general] [PATCH] Adapt spi_mpc83xx SPI driver for 832x
Date: Fri, 22 Dec 2006 16:57:11 -0800	[thread overview]
Message-ID: <200612221657.12007.david-b@pacbell.net> (raw)
In-Reply-To: <037901c71f14$a47115b0$020120ac@Jocke>

On Wednesday 13 December 2006 4:13 pm, Joakim Tjernlund wrote:
>
> > The problem I have with this patch is that it has too much 
> > #ifdeffery.  If
> 
> Too much? There is only 2 of them.

But it's the wrong kind of  #ifdeffery, and that's avoidable.


> > > (possibly this can be reduced by adding more logic to the 
> > > tx_buf/rx_buf functions)
> > > not to mention what will happen when support for reversed 
> > > bit order is added.
> > 
> > Sure enough, sounds ugly.  But cpu_is_xxx() macros, combined 
> > with GCC dead
> > code elimination will strip out functions that are unused, so 
> > that e.g.
> > 
> > 	if (cpu_is_mpc834x())
> > 		fn = mpc834x_spi_tx_buf_u16;
> > 	else if (cpu_is_mpc832x())
> > 		fn = mpc832x_spi_tx_buf_u16;
> > 
> > would only link one of them unless the kernel supports both SOCs.  And
> > without in-driver #ifdeffery.
> 
> Hmm, I can't find any cpu_is_xxx macros/functions. I guess the
> infrastructure isn't there yet?

So it would seem.    At least for PPC.  I noticed the patch from
Kumar Gala, which takes an alternate approach based on parameters
passed through platform_data ... that works too, in terms of
code being cleaner.

- Dave

      parent reply	other threads:[~2006-12-23  0:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-13  9:22 [PATCH] Adapt spi_mpc83xx SPI driver for 832x Joakim Tjernlund
2006-12-13  9:44 ` Vitaly Wool
2006-12-13  9:53 ` Li Yang-r58472
2006-12-13 14:46 ` Kumar Gala
2006-12-13 15:36   ` Joakim Tjernlund
2006-12-13 20:31     ` [spi-devel-general] " David Brownell
2006-12-14  0:13       ` Joakim Tjernlund
2006-12-14  5:54         ` Kumar Gala
2006-12-14 10:02           ` Joakim Tjernlund
2006-12-14 19:59             ` Reeve Yang
2006-12-14 20:12               ` Ben Warren
2006-12-14 20:39                 ` Reeve Yang
2006-12-14 21:30                   ` Ben Warren
2006-12-23  1:09             ` David Brownell
2006-12-26 16:31               ` Kumar Gala
2007-02-17  2:17             ` David Brownell
2007-02-17  9:14               ` Joakim Tjernlund
2006-12-23  0:57         ` David Brownell [this message]

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=200612221657.12007.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.