Re: [patch] synclink.c compiler optimiation fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 07, 2005 at 12:02:23PM -0500, Paul Fulghum wrote:
> -	u16 count;	/* buffer size/data count */
> -	u16 status;	/* Control/status field */
> -	u16 rcc;	/* character count field */
> +	volatile u16 count;	/* buffer size/data count */
> +	volatile u16 status;	/* Control/status field */
> +	volatile u16 rcc;	/* character count field */

this is wrong.  The structure is in ioremaped memory so you must
use reads/writes to access them instead.  volatile usage in drivers
is never okay - if you are accessing I/O memory you need to use
proper acessors, if it is normal memory and you want atomic sematics
you need to use the atomic_t type and the operators defined on it.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux