Revert "[media] DVB: dvb_frontend: off by one in dtv_property_dump()"
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 15 Jul 2011 11:49:06 +0000 (08:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:56:02 +0000 (17:56 -0300)
This reverts commit a3e4adf274f86b2363fedaa964297cb38526cef0.

As pointed by Andread Oberritter <obi@linuxtv.org>:

That's wrong, because the array size is DTV_MAX_COMMAND + 1.
Using the ARRAY_SIZE macro instead might reduce the confusion.

Also, changeset 3995223038 already fixed this issue.

Reported-by: Andread Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-core/dvb_frontend.c

index 21c9072ed99fe40ca047d41e044ecfd06874648e..efe9c30605e890688b6a7557156436fe0c4611a9 100644 (file)
@@ -982,7 +982,7 @@ static void dtv_property_dump(struct dtv_property *tvp)
 {
        int i;
 
-       if (tvp->cmd <= 0 || tvp->cmd >= DTV_MAX_COMMAND) {
+       if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) {
                printk(KERN_WARNING "%s: tvp.cmd = 0x%08x undefined\n",
                        __func__, tvp->cmd);
                return;