]> err.no Git - linux-2.6/commitdiff
isapnp: remove pointless check of 'type' against 0 in isapnp_read_tag()
authorJesper Juhl <jesper.juhl@gmail.com>
Mon, 16 Jul 2007 06:41:53 +0000 (23:41 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 16:05:52 +0000 (09:05 -0700)
In drivers/pnp/isapnp/core.c::isapnp_read_tag() there is a test of 'type'
being == 0 a bit down in the function.  That test doesn't make any sense.
If 'type' could indeed be NULL, then the test happens way too late as we'd
already have tried to dereference the pointer earlier and looking at the
callers it also turns out that there is no way type can ever actually be
NULL.

So the test is completely pointless and should just be removed.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/pnp/isapnp/core.c

index a0b158704ca1f8f5eb5982f55477c96586d5692f..914d00c423ade6a353fd81d333c2eef7d89a6254 100644 (file)
@@ -370,8 +370,6 @@ static int __init isapnp_read_tag(unsigned char *type, unsigned short *size)
 #if 0
        printk(KERN_DEBUG "tag = 0x%x, type = 0x%x, size = %i\n", tag, *type, *size);
 #endif
-       if (type == 0)                          /* wrong type */
-               return -1;
        if (*type == 0xff && *size == 0xffff)   /* probably invalid data */
                return -1;
        return 0;