GET_USE_COUNT(THIS_MODULE) and i810_rng driver.

Tigran Aivazian (tigran@veritas.com)
Thu, 5 Oct 2000 20:52:20 +0100 (BST)


Hi Keith,

I tried to compile Jeff's i810_rng driver statically and I can't because
of a construct like this:

if (GET_USE_COUNT(THIS_MODULE) > 0)
MOD_DEC_USE_COUNT;
if (GET_USE_COUNT(THIS_MODULE) == 0)
rng_hw_enabled = 0;

A similar thing is used by other drivers but always inside #ifdef
MODULE. The problem here is that if MODULE is not defined then THIS_MODULE
is just NULL and GET_USE_COUNT(NULL) is not a very wise thing to be used
in expressions :)

Any ideas what should one do? To enclose the driver's code inside #ifdef
MODULE (and check all other drivers) or to provide a magic version of
GET_USE_COUNT() that will be suitable for static case? E.g. 1? Is 1 good
enough?

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/