aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/sound_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/sound_config.h')
-rw-r--r--sound/oss/sound_config.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/sound/oss/sound_config.h b/sound/oss/sound_config.h
index 1a00a3210616..55271fbe7f49 100644
--- a/sound/oss/sound_config.h
+++ b/sound/oss/sound_config.h
@@ -110,24 +110,16 @@ struct channel_info {
110#define OPEN_WRITE PCM_ENABLE_OUTPUT 110#define OPEN_WRITE PCM_ENABLE_OUTPUT
111#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE) 111#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
112 112
113#if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
114
115static inline int translate_mode(struct file *file)
116{
117 return file->f_mode;
118}
119
120#else
121
122static inline int translate_mode(struct file *file) 113static inline int translate_mode(struct file *file)
123{ 114{
124 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) | 115 if (OPEN_READ == (__force int)FMODE_READ &&
125 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0); 116 OPEN_WRITE == (__force int)FMODE_WRITE)
117 return (__force int)(file->f_mode & (FMODE_READ | FMODE_WRITE));
118 else
119 return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
120 ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
126} 121}
127 122
128#endif
129
130
131#include "sound_calls.h" 123#include "sound_calls.h"
132#include "dev_table.h" 124#include "dev_table.h"
133 125