lkml.org 
[lkml]   [2005]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] synclink.c compiler optimiation fix
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-08 15:54    [W:1.165 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site