* [PATCH] drm/nouveau: fix WITHIN macro off by one
@ 2009-09-18 18:15 Pekka Paalanen
[not found] ` <1253297727-8126-1-git-send-email-pq-X3B1VOXEql0@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Pekka Paalanen @ 2009-09-18 18:15 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Equality in x <= y + z is already out of range. X must be stricly less.
Signed-off-by: Pekka Paalanen <pq-X3B1VOXEql0@public.gmane.org>
---
drivers/gpu/drm/nouveau/nouveau_bios.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 6afd82e..539835a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -300,7 +300,7 @@ valid_reg(struct nvbios *bios, uint32_t reg)
if (dev_priv->card_type >= NV_50)
return 1;
- #define WITHIN(x, y, z) ((x >= y) && (x <= y + z))
+ #define WITHIN(x, y, z) ((x >= y) && (x < y + z))
if (WITHIN(reg, NV_PMC_OFFSET, NV_PMC_SIZE))
return 1;
if (WITHIN(reg, NV_PBUS_OFFSET, NV_PBUS_SIZE))
--
1.6.3.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/nouveau: fix WITHIN macro off by one
[not found] ` <1253297727-8126-1-git-send-email-pq-X3B1VOXEql0@public.gmane.org>
@ 2009-09-20 11:29 ` Stephane Marchesin
[not found] ` <6a89f9d50909200429u234af84l84e4c1eb6e24b287-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Stephane Marchesin @ 2009-09-20 11:29 UTC (permalink / raw)
To: Pekka Paalanen; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Fri, Sep 18, 2009 at 20:15, Pekka Paalanen <pq-X3B1VOXEql0@public.gmane.org> wrote:
> Equality in x <= y + z is already out of range. X must be stricly less.
>
Yeah, I did that back when the SIZE defines were, say, 0x1fff instead
of 0x2000 so this was required. Seems like the size defines changed,
but the WITHIN macro wasn't updated.
Stephane
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/nouveau: fix WITHIN macro off by one
[not found] ` <6a89f9d50909200429u234af84l84e4c1eb6e24b287-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-09-20 12:23 ` Pekka Paalanen
0 siblings, 0 replies; 3+ messages in thread
From: Pekka Paalanen @ 2009-09-20 12:23 UTC (permalink / raw)
To: Stephane Marchesin; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On Sun, 20 Sep 2009 13:29:24 +0200
Stephane Marchesin <marchesin-YynmYXH4S6491FlJP1ih0VAUjnlXr6A1@public.gmane.org> wrote:
> On Fri, Sep 18, 2009 at 20:15, Pekka Paalanen <pq-X3B1VOXEql0@public.gmane.org> wrote:
> > Equality in x <= y + z is already out of range. X must be
> > stricly less.
> >
>
> Yeah, I did that back when the SIZE defines were, say, 0x1fff
> instead of 0x2000 so this was required. Seems like the size
> defines changed, but the WITHIN macro wasn't updated.
Thanks for confirming this, I pushed it a while back.
--
Pekka Paalanen
http://www.iki.fi/pq/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-20 12:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18 18:15 [PATCH] drm/nouveau: fix WITHIN macro off by one Pekka Paalanen
[not found] ` <1253297727-8126-1-git-send-email-pq-X3B1VOXEql0@public.gmane.org>
2009-09-20 11:29 ` Stephane Marchesin
[not found] ` <6a89f9d50909200429u234af84l84e4c1eb6e24b287-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-20 12:23 ` Pekka Paalanen
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.