Re: - isapnp-remove-pointless-check-of-type-against-0-in-isapnp_read_tag.patch removed from -mm tree

From: Jesper Juhl
Date: Mon Jul 16 2007 - 17:15:46 EST


On 16/07/07, akpm@xxxxxxxxxxxxxxxxxxxx <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

The patch titled
isapnp: remove pointless check of 'type' against 0 in isapnp_read_tag()
has been removed from the -mm tree. Its filename was
isapnp-remove-pointless-check-of-type-against-0-in-isapnp_read_tag.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: isapnp: remove pointless check of 'type' against 0 in isapnp_read_tag()
From: Jesper Juhl <jesper.juhl@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

I should have included this in the patch changelog, but I forgot.
Credit should be given where credit is due, even for small stuff like
this. So, for the record:
Thanks go to Andrew Morton for pointing out errors in my initial patch
and pointing me at the fact that callers never actually cause a null
'type' - thank you Andrew for your always careful review of even the
most simple of patches.

--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/