Writable module parameters - should be volatile?
From: Duncan Sands
Date: Sun Sep 12 2004 - 07:08:00 EST
I declare a writable module parameter as follows:
static unsigned int num_rcv_urbs = UDSL_DEFAULT_RCV_URBS;
module_param (num_rcv_urbs, uint, S_IRUGO | S_IWUSR);
Shouldn't I declare num_rcv_urbs volatile? Otherwise compiler
optimizations could (for example) stick it in a register and miss
any changes made by someone writing to it... However, if I do
declare it volatile then I get a warning:
In function `__check_num_rcv_urbs':
warning: return discards qualifiers from pointer target type
So what is the right thing to do?
Thanks,
Duncan.
-
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/