Skip to content

Commit

Permalink
x86: Simplify flush_write_buffers()
Browse files Browse the repository at this point in the history
Always make it an inline instead of using a macro for the no-op case.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <1265380629-3212-7-git-send-email-brgerst@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
Brian Gerst authored and H. Peter Anvin committed Feb 5, 2010
1 parent 6175ddf commit 910bf6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 2 additions & 8 deletions arch/x86/include/asm/io_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,12 @@ memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
* 2. Accidentally out of order processors (PPro errata #51)
*/

#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)

static inline void flush_write_buffers(void)
{
#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
asm volatile("lock; addl $0,0(%%esp)": : :"memory");
}

#else

#define flush_write_buffers() do { } while (0)

#endif
}

#endif /* __KERNEL__ */

Expand Down
8 changes: 7 additions & 1 deletion arch/x86/include/asm/io_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
* 1. Out of order aware processors
* 2. Accidentally out of order processors (PPro errata #51)
*/
#define flush_write_buffers() do { } while (0)

static inline void flush_write_buffers(void)
{
#if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)
asm volatile("lock; addl $0,0(%%esp)": : :"memory");
#endif
}

#endif /* __KERNEL__ */

Expand Down

0 comments on commit 910bf6a

Please sign in to comment.