aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/sound_config.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-09-02 15:28:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-21 07:47:06 -0400
commitaeb5d727062a0238a2f96c9c380fbd2be4640c6f (patch)
tree51dae8a071fcf42e4431a66d37c5b843c8e99cf6 /sound/oss/sound_config.h
parent2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff)
[PATCH] introduce fmode_t, do annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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