From: Roel Kluin <roel.kluin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mariusz Ceier <mceier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] spi: limit reaches -1, tested 0
Date: Sun, 08 Feb 2009 18:46:47 +0100 [thread overview]
Message-ID: <498F1A87.8060403@gmail.com> (raw)
In-Reply-To: <498F1979.1030104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Mariusz Ceier wrote:
> Roel Kluin writes in first post:
>> - while ((read(drv_data) == 0) && limit--);
>> + while ((read(drv_data) == 0) && --limit);
>
> Roel Kluin writes in last post:
>> - while ((read(drv_data) == 0) && limit--);
>> + while ((read(drv_data) == 0) && limit--)
>> + cpu_relax();
>
> so should there be postfix or prefix decrement ? :)
Thanks for spotting, I took the liberty to add David Brownell's Acked-by
in this case.
----------------------->8------------------8<---------------------------
With a postfix decrement limit will reach -1 rather than 0,
so the warning will not be issued.
Signed-off-by: Roel Kluin <roel.kluin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 269a55e..b143e8c 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -779,7 +779,8 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
/* Read trailing bytes */
limit = loops_per_jiffy << 1;
- while ((read(drv_data) == 0) && limit--);
+ while ((read(drv_data) == 0) && --limit)
+ cpu_relax();
if (limit == 0)
dev_err(&drv_data->pdev->dev,
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
WARNING: multiple messages have this Message-ID (diff)
From: Roel Kluin <roel.kluin@gmail.com>
To: Mariusz Ceier <mceier@gmail.com>
Cc: David Brownell <david-b@pacbell.net>,
spi-devel-general@lists.sourceforge.net,
lkml <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] spi: limit reaches -1, tested 0
Date: Sun, 08 Feb 2009 18:46:47 +0100 [thread overview]
Message-ID: <498F1A87.8060403@gmail.com> (raw)
In-Reply-To: <498F1979.1030104@gmail.com>
Mariusz Ceier wrote:
> Roel Kluin writes in first post:
>> - while ((read(drv_data) == 0) && limit--);
>> + while ((read(drv_data) == 0) && --limit);
>
> Roel Kluin writes in last post:
>> - while ((read(drv_data) == 0) && limit--);
>> + while ((read(drv_data) == 0) && limit--)
>> + cpu_relax();
>
> so should there be postfix or prefix decrement ? :)
Thanks for spotting, I took the liberty to add David Brownell's Acked-by
in this case.
----------------------->8------------------8<---------------------------
With a postfix decrement limit will reach -1 rather than 0,
so the warning will not be issued.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
---
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 269a55e..b143e8c 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -779,7 +779,8 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
/* Read trailing bytes */
limit = loops_per_jiffy << 1;
- while ((read(drv_data) == 0) && limit--);
+ while ((read(drv_data) == 0) && --limit)
+ cpu_relax();
if (limit == 0)
dev_err(&drv_data->pdev->dev,
next prev parent reply other threads:[~2009-02-08 17:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 14:18 [PATCH] spi: limit reaches -1, tested 0 Roel Kluin
[not found] ` <498EE9C0.3010601-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-08 15:55 ` David Brownell
2009-02-08 15:55 ` David Brownell
[not found] ` <200902080755.26241.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-08 16:28 ` David Brownell
2009-02-08 16:28 ` David Brownell
[not found] ` <200902080828.49036.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-02-08 16:50 ` Roel Kluin
2009-02-08 16:50 ` Roel Kluin
[not found] ` <498F0D64.4040909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-08 17:26 ` David Brownell
2009-02-08 17:26 ` David Brownell
2009-02-08 17:42 ` Mariusz Ceier
2009-02-08 17:42 ` Mariusz Ceier
[not found] ` <498F1979.1030104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-02-08 17:46 ` Roel Kluin [this message]
2009-02-08 17:46 ` Roel Kluin
-- strict thread matches above, loose matches on Subject: below --
2009-01-31 11:33 Roel Kluin
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=498F1A87.8060403@gmail.com \
--to=roel.kluin-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mceier-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 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.