linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: spi-devel-general@lists.sourceforge.net
Subject: [PATCH] SPI: Fix apparently reversed args to time_before().
Date: Fri, 1 Jan 2010 12:24:41 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1001011222400.24884@localhost> (raw)


Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

  given that the macro this is contained in reads:

#define busy_wait(cond)                                           \
        ({                                                        \
        unsigned long end_jiffies = jiffies + STMP_SPI_TIMEOUT;   \
        bool succeeded = false;                                   \
        do {                                                      \
                if (cond) {                                       \
                        succeeded = true;                         \
                        break;                                    \
                }                                                 \
                cpu_relax();                                      \
        } while (time_before(jiffies, end_jiffies));              \
        succeeded;                                                \
        })

it seems obvious that those args are in the wrong order.

diff --git a/drivers/spi/spi_stmp.c b/drivers/spi/spi_stmp.c
index 2552bb3..fadff76 100644
--- a/drivers/spi/spi_stmp.c
+++ b/drivers/spi/spi_stmp.c
@@ -76,7 +76,7 @@ struct stmp_spi {
 			break;						\
 		}							\
 		cpu_relax();						\
-	} while (time_before(end_jiffies, jiffies));			\
+	} while (time_before(jiffies, end_jiffies));			\
 	succeeded;							\
 	})



========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

                 reply	other threads:[~2010-01-01 17:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LFD.2.00.1001011222400.24884@localhost \
    --to=rpjday@crashcourse.ca \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).