Rolf Eike Beer | 8 Aug 2005 15:05
Picon

[PATCH 2.6.13-rc6] Fix handling in parport_pc init code

parport_pc_find_ports():

	r = pci_register_driver (&parport_pc_pci_driver);
	if (r)
		return r;

The only caller of parport_pc_find_ports() is parport_pc_init(), which has:

		count += parport_pc_find_ports (irqval[0], dmaval[0]);

	return 0;

This assignment is totally useless as count is local and never used again. Bad 
thing is that module_init succeeds but something really bad had happened to 
pci_register_driver() before (e.g. ENOMEM or something).

Also module_init does not fail if pnp_register_driver() fails. And the return 
code of pnp_register_driver() can never be >0, if there are initial matches 0 
is returned.

Why is parport_pc_find_isa_ports() marked as ((unused)) when it is used by 
asm/parport.h? Shouldn't this be ((used)) to tell the compiler that this static 
function has references to it that he might not see? I left this the way it is 
if there is some magic I missed.

The return code of this function is of no interest, I did not touch it for now 
because I don't wanted to change all the header files, I just changed it to 
always return 0.

Signed-off-by: Rolf Eike Beer <eike-kernel <at> sf-tec.de>
(Continue reading)


Gmane