All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org,
	sshtylyov@ru.mvista.com, mlachwani@mvista.com,
	spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH] TXx9 SPI controller driver (take 2)
Date: Sat, 30 Jun 2007 10:46:20 -0700	[thread overview]
Message-ID: <200706301046.20826.david-b@pacbell.net> (raw)
In-Reply-To: <20070701.023414.71085498.anemo@mba.ocn.ne.jp>

On Saturday 30 June 2007, Atsushi Nemoto wrote:
> On Sat, 30 Jun 2007 09:53:19 -0700, David Brownell <david-b@pacbell.net> wrote:
> > > This is a driver for SPI controller built into TXx9 MIPS SoCs.
> > > This driver is derived from arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c.
> > > 
> > > Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> > > ---
> > > Changes from previous version:
> > 
> > Better, but still not there yet.
> 
> Thanks!  I'll be back with take 3 patch.
> 
> > > +	txx9spi_cs_func(spi, c, 0, 1000000000 / 2 / spi->max_speed_hz);
> > 
> > You still use this confusing A/2/B syntax.  Please
> > rewrite that using one "/" and one "*".  (And there
> > is similar usage elsewhere.)
> 
> The compiler will optimize "1000000000 / 2 / spi->max_speed_hz" into
> "500000000 / spi->max_speed_hz", so it can be treat as one "/", no?

Sure it's deterministic.  But that doesn't prevent me from
needing a double-take to figure what it does ... it's best
to avoid confusing idioms in code.  At the very least, put
parentheses there ...

WARNING: multiple messages have this Message-ID (diff)
From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: Atsushi Nemoto <anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org>
Cc: sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
	mlachwani-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH] TXx9 SPI controller driver (take 2)
Date: Sat, 30 Jun 2007 10:46:20 -0700	[thread overview]
Message-ID: <200706301046.20826.david-b@pacbell.net> (raw)
In-Reply-To: <20070701.023414.71085498.anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org>

On Saturday 30 June 2007, Atsushi Nemoto wrote:
> On Sat, 30 Jun 2007 09:53:19 -0700, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
> > > This is a driver for SPI controller built into TXx9 MIPS SoCs.
> > > This driver is derived from arch/mips/tx4938/toshiba_rbtx4938/spi_txx9.c.
> > > 
> > > Signed-off-by: Atsushi Nemoto <anemo-7JcRY8pycbNHfZP73Gtkiw@public.gmane.org>
> > > ---
> > > Changes from previous version:
> > 
> > Better, but still not there yet.
> 
> Thanks!  I'll be back with take 3 patch.
> 
> > > +	txx9spi_cs_func(spi, c, 0, 1000000000 / 2 / spi->max_speed_hz);
> > 
> > You still use this confusing A/2/B syntax.  Please
> > rewrite that using one "/" and one "*".  (And there
> > is similar usage elsewhere.)
> 
> The compiler will optimize "1000000000 / 2 / spi->max_speed_hz" into
> "500000000 / spi->max_speed_hz", so it can be treat as one "/", no?

Sure it's deterministic.  But that doesn't prevent me from
needing a double-take to figure what it does ... it's best
to avoid confusing idioms in code.  At the very least, put
parentheses there ...


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

  reply	other threads:[~2007-06-30 17:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27 13:24 [PATCH] TXx9 SPI controller driver (take 2) Atsushi Nemoto
2007-06-27 13:24 ` Atsushi Nemoto
2007-06-30 16:53 ` David Brownell
2007-06-30 16:53   ` David Brownell
2007-06-30 17:34   ` Atsushi Nemoto
2007-06-30 17:34     ` Atsushi Nemoto
2007-06-30 17:46     ` David Brownell [this message]
2007-06-30 17:46       ` David Brownell
2007-07-01 14:40       ` Atsushi Nemoto
2007-07-02 14:00   ` Atsushi Nemoto
2007-07-02 14:00     ` Atsushi Nemoto

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=200706301046.20826.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    --cc=mlachwani@mvista.com \
    --cc=ralf@linux-mips.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=sshtylyov@ru.mvista.com \
    /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.