Re: Why does test_bit() take a volatile addr?

From: Michael S. Tsirkin
Date: Mon Sep 16 2013 - 03:24:20 EST


On Mon, Sep 16, 2013 at 04:53:44PM +1000, Stephen Rothwell wrote:
> Hi Rusty,
>
> On Mon, 16 Sep 2013 13:38:35 +0930 Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
> >
> > Predates git, does anyone remember the rationale?
> >
> > ie:
> > int test_bit(int nr, const volatile unsigned long *addr)
>
> Because we sometimes pass volatile pointers to it and gcc will complain
> if you pass a volatile to a non volatile (I think).

Where are these? I did git grep -W test_bit and looked for volatile,
couldn't find anything.

> --
> Cheers,
> Stephen Rothwell sfr@xxxxxxxxxxxxxxxx


--
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/