Pekka Paalanen
2009-Sep-18 18:15 UTC
[Nouveau] [PATCH] drm/nouveau: fix WITHIN macro off by one
Equality in x <= y + z is already out of range. X must be stricly less. Signed-off-by: Pekka Paalanen <pq at iki.fi> --- 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
Stephane Marchesin
2009-Sep-20 11:29 UTC
[Nouveau] [PATCH] drm/nouveau: fix WITHIN macro off by one
On Fri, Sep 18, 2009 at 20:15, Pekka Paalanen <pq at iki.fi> 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
Seemingly Similar Threads
- [RFC] nouveau: Add basic i2c sensor chip support
- [PATCH] drm/nouveau/bios: make const arrays hwsq_signature and edid_sig static
- [PATCH] drm/nouveau/bios: downgrade absence of tmds table to info from an error
- [PATCH] drm/nouveau: Do not show an error if the TMDS table pointer is invalid
- [PATCH] bios: Restrict missing fp table message to desktop cards.