public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Writable module parameters - should be volatile?
@ 2004-09-12 11:57 Duncan Sands
  2004-09-12 12:52 ` Arnd Bergmann
  2004-09-13 17:54 ` Rusty Russell
  0 siblings, 2 replies; 5+ messages in thread
From: Duncan Sands @ 2004-09-12 11:57 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org; +Cc: rusty

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-16 22:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-12 11:57 Writable module parameters - should be volatile? Duncan Sands
2004-09-12 12:52 ` Arnd Bergmann
2004-09-13 11:58   ` Duncan Sands
2004-09-13 17:54 ` Rusty Russell
2004-09-16 19:02   ` Duncan Sands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox