tegra: host: fix the compare statement.
Jubeom Kim [Tue, 9 Aug 2011 09:22:24 +0000 (18:22 +0900)]
Original-Change-Id: Ie1c1aaf2a994193897fc8cc88768e40fb8479b6b
Reviewed-on: http://git-master/r/46028
Tested-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: R2f161c994ef58f20a0ec639964f84c6ebc139467

drivers/video/tegra/host/t20/syncpt_t20.c

index fe83291..ade896e 100644 (file)
@@ -127,7 +127,7 @@ static int t20_syncpt_wait_check(struct nvhost_syncpt *sp,
        while (wait != waitend) {
                u32 syncpt, override;
 
-               BUG_ON(wait->syncpt_id > NV_HOST1X_SYNCPT_NB_PTS);
+               BUG_ON(wait->syncpt_id >= NV_HOST1X_SYNCPT_NB_PTS);
 
                syncpt = atomic_read(&sp->min_val[wait->syncpt_id]);
                if (nvhost_syncpt_wrapping_comparison(syncpt, wait->thresh)) {
@@ -171,7 +171,7 @@ static const char *s_syncpt_names[32] = {
 
 static const char *t20_syncpt_name(struct nvhost_syncpt *s, u32 id)
 {
-       BUG_ON(id > ARRAY_SIZE(s_syncpt_names));
+       BUG_ON(id >= ARRAY_SIZE(s_syncpt_names));
        return s_syncpt_names[id];
 }