Commit 487db1c7 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] dmasound annotation

dmasound (core + ppc-specific parts) annotated
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0a333133
...@@ -44,12 +44,12 @@ ...@@ -44,12 +44,12 @@
#define le2be16dbl(x) (((x)<<8 & 0xff00ff00) | ((x)>>8 & 0x00ff00ff)) #define le2be16dbl(x) (((x)<<8 & 0xff00ff00) | ((x)>>8 & 0x00ff00ff))
#define IOCTL_IN(arg, ret) \ #define IOCTL_IN(arg, ret) \
do { int error = get_user(ret, (int *)(arg)); \ do { int error = get_user(ret, (int __user *)(arg)); \
if (error) return error; \ if (error) return error; \
} while (0) } while (0)
#define IOCTL_OUT(arg, ret) ioctl_return((int *)(arg), ret) #define IOCTL_OUT(arg, ret) ioctl_return((int __user *)(arg), ret)
static inline int ioctl_return(int *addr, int value) static inline int ioctl_return(int __user *addr, int value)
{ {
return value < 0 ? value : put_user(value, addr); return value < 0 ? value : put_user(value, addr);
} }
...@@ -153,14 +153,14 @@ typedef struct { ...@@ -153,14 +153,14 @@ typedef struct {
*/ */
typedef struct { typedef struct {
ssize_t (*ct_ulaw)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_ulaw)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_alaw)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_alaw)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_s8)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_s8)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_u8)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_u8)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_s16be)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_s16be)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_u16be)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_u16be)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_s16le)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_s16le)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
ssize_t (*ct_u16le)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_u16le)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
} TRANS; } TRANS;
struct sound_settings { struct sound_settings {
......
...@@ -326,12 +326,12 @@ extern int daca_leave_sleep(void); ...@@ -326,12 +326,12 @@ extern int daca_leave_sleep(void);
#undef IOCTL_OUT #undef IOCTL_OUT
#define IOCTL_IN(arg, ret) \ #define IOCTL_IN(arg, ret) \
rc = get_user(ret, (int *)(arg)); \ rc = get_user(ret, (int __user *)(arg)); \
if (rc) break; if (rc) break;
#define IOCTL_OUT(arg, ret) \ #define IOCTL_OUT(arg, ret) \
ioctl_return2((int *)(arg), ret) ioctl_return2((int __user *)(arg), ret)
static inline int ioctl_return2(int *addr, int value) static inline int ioctl_return2(int __user *addr, int value)
{ {
return value < 0 ? value : put_user(value, addr); return value < 0 ? value : put_user(value, addr);
} }
...@@ -514,6 +514,7 @@ tas_set_frame_rate(void) ...@@ -514,6 +514,7 @@ tas_set_frame_rate(void)
static int static int
tas_mixer_ioctl(u_int cmd, u_long arg) tas_mixer_ioctl(u_int cmd, u_long arg)
{ {
int __user *argp = (int __user *)arg;
int data; int data;
int rc; int rc;
...@@ -524,16 +525,16 @@ tas_mixer_ioctl(u_int cmd, u_long arg) ...@@ -524,16 +525,16 @@ tas_mixer_ioctl(u_int cmd, u_long arg)
if ((cmd & ~0xff) == MIXER_WRITE(0) && if ((cmd & ~0xff) == MIXER_WRITE(0) &&
tas_supported_mixers() & (1<<(cmd & 0xff))) { tas_supported_mixers() & (1<<(cmd & 0xff))) {
rc = get_user(data, (int *)(arg)); rc = get_user(data, argp);
if (rc<0) return rc; if (rc<0) return rc;
tas_set_mixer_level(cmd & 0xff, data); tas_set_mixer_level(cmd & 0xff, data);
tas_get_mixer_level(cmd & 0xff, &data); tas_get_mixer_level(cmd & 0xff, &data);
return ioctl_return2((int *)(arg), data); return ioctl_return2(argp, data);
} }
if ((cmd & ~0xff) == MIXER_READ(0) && if ((cmd & ~0xff) == MIXER_READ(0) &&
tas_supported_mixers() & (1<<(cmd & 0xff))) { tas_supported_mixers() & (1<<(cmd & 0xff))) {
tas_get_mixer_level(cmd & 0xff, &data); tas_get_mixer_level(cmd & 0xff, &data);
return ioctl_return2((int *)(arg), data); return ioctl_return2(argp, data);
} }
switch(cmd) { switch(cmd) {
......
...@@ -279,11 +279,11 @@ static int sound_set_stereo(int stereo) ...@@ -279,11 +279,11 @@ static int sound_set_stereo(int stereo)
return stereo; return stereo;
} }
static ssize_t sound_copy_translate(TRANS *trans, const u_char *userPtr, static ssize_t sound_copy_translate(TRANS *trans, const u_char __user *userPtr,
size_t userCount, u_char frame[], size_t userCount, u_char frame[],
ssize_t *frameUsed, ssize_t frameLeft) ssize_t *frameUsed, ssize_t frameLeft)
{ {
ssize_t (*ct_func)(const u_char *, size_t, u_char *, ssize_t *, ssize_t); ssize_t (*ct_func)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
switch (dmasound.soft.format) { switch (dmasound.soft.format) {
case AFMT_MU_LAW: case AFMT_MU_LAW:
...@@ -361,7 +361,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -361,7 +361,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
strlcpy(info.id, dmasound.mach.name2, sizeof(info.id)); strlcpy(info.id, dmasound.mach.name2, sizeof(info.id));
strlcpy(info.name, dmasound.mach.name2, sizeof(info.name)); strlcpy(info.name, dmasound.mach.name2, sizeof(info.name));
info.modify_counter = mixer.modify_counter; info.modify_counter = mixer.modify_counter;
if (copy_to_user((int *)arg, &info, sizeof(info))) if (copy_to_user((void __user *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -546,7 +546,7 @@ static inline void sq_play(void) ...@@ -546,7 +546,7 @@ static inline void sq_play(void)
dmasound.mach.play(); dmasound.mach.play();
} }
static ssize_t sq_write(struct file *file, const char *src, size_t uLeft, static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
loff_t *ppos) loff_t *ppos)
{ {
ssize_t uWritten = 0; ssize_t uWritten = 0;
...@@ -703,7 +703,7 @@ static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait) ...@@ -703,7 +703,7 @@ static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait)
* it and restart the DMA. * it and restart the DMA.
*/ */
static ssize_t sq_read(struct file *file, char *dst, size_t uLeft, static ssize_t sq_read(struct file *file, char __user *dst, size_t uLeft,
loff_t *ppos) loff_t *ppos)
{ {
...@@ -1321,7 +1321,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -1321,7 +1321,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
info.fragstotal = write_sq.max_active; info.fragstotal = write_sq.max_active;
info.fragsize = write_sq.user_frag_size; info.fragsize = write_sq.user_frag_size;
info.bytes = info.fragments * info.fragsize; info.bytes = info.fragments * info.fragsize;
if (copy_to_user((void *)arg, &info, sizeof(info))) if (copy_to_user((void __user *)arg, &info, sizeof(info)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} else } else
...@@ -1547,7 +1547,7 @@ static int state_release(struct inode *inode, struct file *file) ...@@ -1547,7 +1547,7 @@ static int state_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static ssize_t state_read(struct file *file, char *buf, size_t count, static ssize_t state_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos) loff_t *ppos)
{ {
int n = state.len - state.ptr; int n = state.len - state.ptr;
......
...@@ -452,8 +452,9 @@ tas3001c_eq_rw( struct tas3001c_data_t *self, ...@@ -452,8 +452,9 @@ tas3001c_eq_rw( struct tas3001c_data_t *self,
{ {
int rc; int rc;
struct tas_biquad_ctrl_t biquad; struct tas_biquad_ctrl_t biquad;
void __user *argp = (void __user *)arg;
if (copy_from_user((void *)&biquad, (const void *)arg, sizeof(struct tas_biquad_ctrl_t))) { if (copy_from_user(&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -466,7 +467,7 @@ tas3001c_eq_rw( struct tas3001c_data_t *self, ...@@ -466,7 +467,7 @@ tas3001c_eq_rw( struct tas3001c_data_t *self,
rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data); rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
if (rc != 0) return rc; if (rc != 0) return rc;
if (copy_to_user((void *)arg, (const void *)&biquad, sizeof(struct tas_biquad_ctrl_t))) { if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -485,27 +486,21 @@ tas3001c_eq_list_rw( struct tas3001c_data_t *self, ...@@ -485,27 +486,21 @@ tas3001c_eq_list_rw( struct tas3001c_data_t *self,
int i,j; int i,j;
char sync_required[2][6]; char sync_required[2][6];
struct tas_biquad_ctrl_t biquad; struct tas_biquad_ctrl_t biquad;
struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
memset(sync_required,0,sizeof(sync_required)); memset(sync_required,0,sizeof(sync_required));
if (copy_from_user((void *)&filter_count, if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
(const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,filter_count),
sizeof(int))) {
return -EFAULT; return -EFAULT;
}
if (copy_from_user((void *)&flags, if (copy_from_user(&flags, &argp->flags, sizeof(int)))
(const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,flags),
sizeof(int))) {
return -EFAULT; return -EFAULT;
}
if (cmd & SIOC_IN) { if (cmd & SIOC_IN) {
} }
for (i=0; i < filter_count; i++) { for (i=0; i < filter_count; i++) {
if (copy_from_user((void *)&biquad, if (copy_from_user(&biquad, &argp->biquads[i],
(const void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
sizeof(struct tas_biquad_ctrl_t))) { sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -520,8 +515,7 @@ tas3001c_eq_list_rw( struct tas3001c_data_t *self, ...@@ -520,8 +515,7 @@ tas3001c_eq_list_rw( struct tas3001c_data_t *self,
rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data); rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
if (rc != 0) return rc; if (rc != 0) return rc;
if (copy_to_user((void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]), if (copy_to_user(&argp->biquads[i], &biquad,
(const void *)&biquad,
sizeof(struct tas_biquad_ctrl_t))) { sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -596,12 +590,10 @@ tas3001c_drce_rw( struct tas3001c_data_t *self, ...@@ -596,12 +590,10 @@ tas3001c_drce_rw( struct tas3001c_data_t *self,
{ {
int rc; int rc;
struct tas_drce_ctrl_t drce_ctrl; struct tas_drce_ctrl_t drce_ctrl;
void __user *argp = (void __user *)arg;
if (copy_from_user((void *)&drce_ctrl, if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
(const void *)arg,
sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
}
#ifdef DEBUG_DRCE #ifdef DEBUG_DRCE
printk("DRCE IOCTL: input [ FLAGS:%x ENABLE:%x THRESH:%x\n", printk("DRCE IOCTL: input [ FLAGS:%x ENABLE:%x THRESH:%x\n",
...@@ -623,8 +615,7 @@ tas3001c_drce_rw( struct tas3001c_data_t *self, ...@@ -623,8 +615,7 @@ tas3001c_drce_rw( struct tas3001c_data_t *self,
if (drce_ctrl.flags & TAS_DRCE_THRESHOLD) if (drce_ctrl.flags & TAS_DRCE_THRESHOLD)
drce_ctrl.data.threshold = self->drce_state.threshold; drce_ctrl.data.threshold = self->drce_state.threshold;
if (copy_to_user((void *)arg, if (copy_to_user(argp, &drce_ctrl,
(const void *)&drce_ctrl,
sizeof(struct tas_drce_ctrl_t))) { sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -703,6 +694,7 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self, ...@@ -703,6 +694,7 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self,
u_int cmd, u_int cmd,
u_long arg) u_long arg)
{ {
uint __user *argp = (void __user *)arg;
switch (cmd) { switch (cmd) {
case TAS_READ_EQ: case TAS_READ_EQ:
case TAS_WRITE_EQ: case TAS_WRITE_EQ:
...@@ -713,11 +705,11 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self, ...@@ -713,11 +705,11 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self,
return tas3001c_eq_list_rw(self, cmd, arg); return tas3001c_eq_list_rw(self, cmd, arg);
case TAS_READ_EQ_FILTER_COUNT: case TAS_READ_EQ_FILTER_COUNT:
put_user(TAS3001C_BIQUAD_FILTER_COUNT, (uint *)(arg)); put_user(TAS3001C_BIQUAD_FILTER_COUNT, argp);
return 0; return 0;
case TAS_READ_EQ_CHANNEL_COUNT: case TAS_READ_EQ_CHANNEL_COUNT:
put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, (uint *)(arg)); put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, argp);
return 0; return 0;
case TAS_READ_DRCE: case TAS_READ_DRCE:
...@@ -725,15 +717,14 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self, ...@@ -725,15 +717,14 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self,
return tas3001c_drce_rw(self, cmd, arg); return tas3001c_drce_rw(self, cmd, arg);
case TAS_READ_DRCE_CAPS: case TAS_READ_DRCE_CAPS:
put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, (uint *)(arg)); put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, argp);
return 0; return 0;
case TAS_READ_DRCE_MIN: case TAS_READ_DRCE_MIN:
case TAS_READ_DRCE_MAX: { case TAS_READ_DRCE_MAX: {
struct tas_drce_ctrl_t drce_ctrl; struct tas_drce_ctrl_t drce_ctrl;
if (copy_from_user((void *)&drce_ctrl, if (copy_from_user(&drce_ctrl, argp,
(const void *)arg,
sizeof(struct tas_drce_ctrl_t))) { sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -746,8 +737,7 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self, ...@@ -746,8 +737,7 @@ tas3001c_device_ioctl( struct tas3001c_data_t *self,
} }
} }
if (copy_to_user((void *)arg, if (copy_to_user(argp, &drce_ctrl,
(const void *)&drce_ctrl,
sizeof(struct tas_drce_ctrl_t))) { sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
static struct tas_drce_t eqp_0e_2_1_drce = { static struct tas_drce_t eqp_0e_2_1_drce = {
.enable = 1, .enable = 1,
.above { .val = 3.0 * (1<<8), .expand = 0 }, .above = { .val = 3.0 * (1<<8), .expand = 0 },
.below { .val = 1.0 * (1<<8), .expand = 0 }, .below = { .val = 1.0 * (1<<8), .expand = 0 },
.threshold -15.33 * (1<<8), .threshold = -15.33 * (1<<8),
.energy 2.4 * (1<<12), .energy = 2.4 * (1<<12),
.attack 0.013 * (1<<12), .attack = 0.013 * (1<<12),
.decay 0.212 * (1<<12), .decay = 0.212 * (1<<12),
}; };
static struct tas_biquad_ctrl_t eqp_0e_2_1_biquads[]={ static struct tas_biquad_ctrl_t eqp_0e_2_1_biquads[]={
......
...@@ -635,10 +635,11 @@ tas3004_eq_rw( struct tas3004_data_t *self, ...@@ -635,10 +635,11 @@ tas3004_eq_rw( struct tas3004_data_t *self,
u_int cmd, u_int cmd,
u_long arg) u_long arg)
{ {
void __user *argp = (void __user *)arg;
int rc; int rc;
struct tas_biquad_ctrl_t biquad; struct tas_biquad_ctrl_t biquad;
if (copy_from_user((void *)&biquad, (const void *)arg, sizeof(struct tas_biquad_ctrl_t))) { if (copy_from_user((void *)&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -651,7 +652,7 @@ tas3004_eq_rw( struct tas3004_data_t *self, ...@@ -651,7 +652,7 @@ tas3004_eq_rw( struct tas3004_data_t *self,
rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data); rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
if (rc != 0) return rc; if (rc != 0) return rc;
if (copy_to_user((void *)arg, (const void *)&biquad, sizeof(struct tas_biquad_ctrl_t))) { if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -670,27 +671,21 @@ tas3004_eq_list_rw( struct tas3004_data_t *self, ...@@ -670,27 +671,21 @@ tas3004_eq_list_rw( struct tas3004_data_t *self,
int i,j; int i,j;
char sync_required[TAS3004_BIQUAD_CHANNEL_COUNT][TAS3004_BIQUAD_FILTER_COUNT]; char sync_required[TAS3004_BIQUAD_CHANNEL_COUNT][TAS3004_BIQUAD_FILTER_COUNT];
struct tas_biquad_ctrl_t biquad; struct tas_biquad_ctrl_t biquad;
struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
memset(sync_required,0,sizeof(sync_required)); memset(sync_required,0,sizeof(sync_required));
if (copy_from_user((void *)&filter_count, if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
(const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,filter_count),
sizeof(int))) {
return -EFAULT; return -EFAULT;
}
if (copy_from_user((void *)&flags, if (copy_from_user(&flags, &argp->flags, sizeof(int)))
(const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,flags),
sizeof(int))) {
return -EFAULT; return -EFAULT;
}
if (cmd & SIOC_IN) { if (cmd & SIOC_IN) {
} }
for (i=0; i < filter_count; i++) { for (i=0; i < filter_count; i++) {
if (copy_from_user((void *)&biquad, if (copy_from_user(&biquad, &argp->biquads[i],
(const void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
sizeof(struct tas_biquad_ctrl_t))) { sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -705,8 +700,7 @@ tas3004_eq_list_rw( struct tas3004_data_t *self, ...@@ -705,8 +700,7 @@ tas3004_eq_list_rw( struct tas3004_data_t *self,
rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data); rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
if (rc != 0) return rc; if (rc != 0) return rc;
if (copy_to_user((void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]), if (copy_to_user(&argp->biquads[i], &biquad,
(const void *)&biquad,
sizeof(struct tas_biquad_ctrl_t))) { sizeof(struct tas_biquad_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -840,12 +834,10 @@ tas3004_drce_rw( struct tas3004_data_t *self, ...@@ -840,12 +834,10 @@ tas3004_drce_rw( struct tas3004_data_t *self,
{ {
int rc; int rc;
struct tas_drce_ctrl_t drce_ctrl; struct tas_drce_ctrl_t drce_ctrl;
void __user *argp = (void __user *)arg;
if (copy_from_user((void *)&drce_ctrl, if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
(const void *)arg,
sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
}
#ifdef DEBUG_DRCE #ifdef DEBUG_DRCE
printk("DRCE: input [ FLAGS:%x ENABLE:%x ABOVE:%x/%x BELOW:%x/%x THRESH:%x ENERGY:%x ATTACK:%x DECAY:%x\n", printk("DRCE: input [ FLAGS:%x ENABLE:%x ABOVE:%x/%x BELOW:%x/%x THRESH:%x ENERGY:%x ATTACK:%x DECAY:%x\n",
...@@ -880,8 +872,7 @@ tas3004_drce_rw( struct tas3004_data_t *self, ...@@ -880,8 +872,7 @@ tas3004_drce_rw( struct tas3004_data_t *self,
if (drce_ctrl.flags & TAS_DRCE_DECAY) if (drce_ctrl.flags & TAS_DRCE_DECAY)
drce_ctrl.data.decay = self->drce_state.decay; drce_ctrl.data.decay = self->drce_state.decay;
if (copy_to_user((void *)arg, if (copy_to_user(argp, &drce_ctrl,
(const void *)&drce_ctrl,
sizeof(struct tas_drce_ctrl_t))) { sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -952,6 +943,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self, ...@@ -952,6 +943,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self,
u_int cmd, u_int cmd,
u_long arg) u_long arg)
{ {
uint __user *argp = (void __user *)arg;
switch (cmd) { switch (cmd) {
case TAS_READ_EQ: case TAS_READ_EQ:
case TAS_WRITE_EQ: case TAS_WRITE_EQ:
...@@ -962,11 +954,11 @@ tas3004_device_ioctl( struct tas3004_data_t *self, ...@@ -962,11 +954,11 @@ tas3004_device_ioctl( struct tas3004_data_t *self,
return tas3004_eq_list_rw(self, cmd, arg); return tas3004_eq_list_rw(self, cmd, arg);
case TAS_READ_EQ_FILTER_COUNT: case TAS_READ_EQ_FILTER_COUNT:
put_user(TAS3004_BIQUAD_FILTER_COUNT, (uint *)(arg)); put_user(TAS3004_BIQUAD_FILTER_COUNT, argp);
return 0; return 0;
case TAS_READ_EQ_CHANNEL_COUNT: case TAS_READ_EQ_CHANNEL_COUNT:
put_user(TAS3004_BIQUAD_CHANNEL_COUNT, (uint *)(arg)); put_user(TAS3004_BIQUAD_CHANNEL_COUNT, argp);
return 0; return 0;
case TAS_READ_DRCE: case TAS_READ_DRCE:
...@@ -981,7 +973,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self, ...@@ -981,7 +973,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self,
TAS_DRCE_ENERGY | TAS_DRCE_ENERGY |
TAS_DRCE_ATTACK | TAS_DRCE_ATTACK |
TAS_DRCE_DECAY, TAS_DRCE_DECAY,
(uint *)(arg)); argp);
return 0; return 0;
case TAS_READ_DRCE_MIN: case TAS_READ_DRCE_MIN:
...@@ -989,8 +981,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self, ...@@ -989,8 +981,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self,
struct tas_drce_ctrl_t drce_ctrl; struct tas_drce_ctrl_t drce_ctrl;
const struct tas_drce_t *drce_copy; const struct tas_drce_t *drce_copy;
if (copy_from_user((void *)&drce_ctrl, if (copy_from_user(&drce_ctrl, argp,
(const void *)arg,
sizeof(struct tas_drce_ctrl_t))) { sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
...@@ -1020,8 +1011,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self, ...@@ -1020,8 +1011,7 @@ tas3004_device_ioctl( struct tas3004_data_t *self,
drce_ctrl.data.decay=drce_copy->decay; drce_ctrl.data.decay=drce_copy->decay;
} }
if (copy_to_user((void *)arg, if (copy_to_user(argp, &drce_ctrl,
(const void *)&drce_ctrl,
sizeof(struct tas_drce_ctrl_t))) { sizeof(struct tas_drce_ctrl_t))) {
return -EFAULT; return -EFAULT;
} }
......
...@@ -20,42 +20,42 @@ ...@@ -20,42 +20,42 @@
static short dmasound_alaw2dma16[] ; static short dmasound_alaw2dma16[] ;
static short dmasound_ulaw2dma16[] ; static short dmasound_ulaw2dma16[] ;
static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft); ssize_t frameLeft);
...@@ -63,7 +63,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount, ...@@ -63,7 +63,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
static int expand_data; /* Data for expanding */ static int expand_data; /* Data for expanding */
static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -96,7 +96,7 @@ static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount, ...@@ -96,7 +96,7 @@ static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -127,7 +127,7 @@ static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount, ...@@ -127,7 +127,7 @@ static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -158,7 +158,7 @@ static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount, ...@@ -158,7 +158,7 @@ static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -170,7 +170,7 @@ static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount, ...@@ -170,7 +170,7 @@ static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
userCount >>= (stereo? 2: 1); userCount >>= (stereo? 2: 1);
used = count = min_t(unsigned long, userCount, frameLeft); used = count = min_t(unsigned long, userCount, frameLeft);
if (!stereo) { if (!stereo) {
short *up = (short *) userPtr; short __user *up = (short __user *) userPtr;
while (count > 0) { while (count > 0) {
short data; short data;
if (get_user(data, up++)) if (get_user(data, up++))
...@@ -187,7 +187,7 @@ static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount, ...@@ -187,7 +187,7 @@ static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
return stereo? used * 4: used * 2; return stereo? used * 4: used * 2;
} }
static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -195,7 +195,7 @@ static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount, ...@@ -195,7 +195,7 @@ static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000); int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
short *fp = (short *) &frame[*frameUsed]; short *fp = (short *) &frame[*frameUsed];
short *up = (short *) userPtr; short __user *up = (short __user *) userPtr;
frameLeft >>= 2; frameLeft >>= 2;
userCount >>= (stereo? 2: 1); userCount >>= (stereo? 2: 1);
...@@ -219,7 +219,7 @@ static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount, ...@@ -219,7 +219,7 @@ static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -266,7 +266,7 @@ static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount, ...@@ -266,7 +266,7 @@ static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount,
return stereo? utotal * 2: utotal; return stereo? utotal * 2: utotal;
} }
static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -311,7 +311,7 @@ static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount, ...@@ -311,7 +311,7 @@ static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -356,13 +356,13 @@ static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount, ...@@ -356,13 +356,13 @@ static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
unsigned int *p = (unsigned int *) &frame[*frameUsed]; unsigned int *p = (unsigned int *) &frame[*frameUsed];
unsigned int data = expand_data; unsigned int data = expand_data;
unsigned short *up = (unsigned short *) userPtr; unsigned short __user *up = (unsigned short __user *) userPtr;
int bal = expand_bal; int bal = expand_bal;
int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed; int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
...@@ -400,14 +400,14 @@ static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount, ...@@ -400,14 +400,14 @@ static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000); int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
unsigned int *p = (unsigned int *) &frame[*frameUsed]; unsigned int *p = (unsigned int *) &frame[*frameUsed];
unsigned int data = expand_data; unsigned int data = expand_data;
unsigned short *up = (unsigned short *) userPtr; unsigned short __user *up = (unsigned short __user *) userPtr;
int bal = expand_bal; int bal = expand_bal;
int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed; int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
...@@ -447,7 +447,7 @@ static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount, ...@@ -447,7 +447,7 @@ static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
/* data in routines... */ /* data in routines... */
static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s8_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -465,13 +465,13 @@ static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount, ...@@ -465,13 +465,13 @@ static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount,
val = *p++; val = *p++;
val = (val * software_input_volume) >> 7; val = (val * software_input_volume) >> 7;
data = val >> 8; data = val >> 8;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
if (stereo) { if (stereo) {
val = *p; val = *p;
val = (val * software_input_volume) >> 7; val = (val * software_input_volume) >> 7;
data = val >> 8; data = val >> 8;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
} }
p++; p++;
...@@ -482,7 +482,7 @@ static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount, ...@@ -482,7 +482,7 @@ static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u8_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -500,13 +500,13 @@ static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount, ...@@ -500,13 +500,13 @@ static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount,
val = *p++; val = *p++;
val = (val * software_input_volume) >> 7; val = (val * software_input_volume) >> 7;
data = (val >> 8) ^ 0x80; data = (val >> 8) ^ 0x80;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
if (stereo) { if (stereo) {
val = *p; val = *p;
val = (val * software_input_volume) >> 7; val = (val * software_input_volume) >> 7;
data = (val >> 8) ^ 0x80; data = (val >> 8) ^ 0x80;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
} }
p++; p++;
...@@ -516,14 +516,14 @@ static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount, ...@@ -516,14 +516,14 @@ static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount,
return stereo? used * 2: used; return stereo? used * 2: used;
} }
static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
ssize_t count, used; ssize_t count, used;
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
short *fp = (short *) &frame[*frameUsed]; short *fp = (short *) &frame[*frameUsed];
short *up = (short *) userPtr; short __user *up = (short __user *) userPtr;
frameLeft >>= 2; frameLeft >>= 2;
userCount >>= (stereo? 2: 1); userCount >>= (stereo? 2: 1);
...@@ -548,7 +548,7 @@ static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount, ...@@ -548,7 +548,7 @@ static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount,
return stereo? used * 4: used * 2; return stereo? used * 4: used * 2;
} }
static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -556,7 +556,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount, ...@@ -556,7 +556,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000); int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
short *fp = (short *) &frame[*frameUsed]; short *fp = (short *) &frame[*frameUsed];
short *up = (short *) userPtr; short __user *up = (short __user *) userPtr;
frameLeft >>= 2; frameLeft >>= 2;
userCount >>= (stereo? 2: 1); userCount >>= (stereo? 2: 1);
...@@ -585,7 +585,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount, ...@@ -585,7 +585,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
/* data in routines (reducing speed)... */ /* data in routines (reducing speed)... */
static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_s8_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -614,11 +614,11 @@ static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount, ...@@ -614,11 +614,11 @@ static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount,
p++; p++;
if (bal < 0) { if (bal < 0) {
data = vall >> 8; data = vall >> 8;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
if (stereo) { if (stereo) {
data = valr >> 8; data = valr >> 8;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
} }
userCount--; userCount--;
...@@ -634,7 +634,7 @@ static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount, ...@@ -634,7 +634,7 @@ static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount,
} }
static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_u8_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
...@@ -664,11 +664,11 @@ static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount, ...@@ -664,11 +664,11 @@ static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount,
p++; p++;
if (bal < 0) { if (bal < 0) {
data = (vall >> 8) ^ 0x80; data = (vall >> 8) ^ 0x80;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
if (stereo) { if (stereo) {
data = (valr >> 8) ^ 0x80; data = (valr >> 8) ^ 0x80;
if (put_user(data, (u_char *)userPtr++)) if (put_user(data, (u_char __user *)userPtr++))
return -EFAULT; return -EFAULT;
} }
userCount--; userCount--;
...@@ -683,13 +683,13 @@ static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount, ...@@ -683,13 +683,13 @@ static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount,
return stereo? utotal * 2: utotal; return stereo? utotal * 2: utotal;
} }
static ssize_t pmac_ctx_s16_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_s16_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
int bal = expand_read_bal; int bal = expand_read_bal;
short *fp = (short *) &frame[*frameUsed]; short *fp = (short *) &frame[*frameUsed];
short *up = (short *) userPtr; short __user *up = (short __user *) userPtr;
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed; int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
int utotal, ftotal; int utotal, ftotal;
...@@ -730,14 +730,14 @@ static ssize_t pmac_ctx_s16_read(const u_char *userPtr, size_t userCount, ...@@ -730,14 +730,14 @@ static ssize_t pmac_ctx_s16_read(const u_char *userPtr, size_t userCount,
return stereo? utotal * 4: utotal * 2; return stereo? utotal * 4: utotal * 2;
} }
static ssize_t pmac_ctx_u16_read(const u_char *userPtr, size_t userCount, static ssize_t pmac_ctx_u16_read(const u_char __user *userPtr, size_t userCount,
u_char frame[], ssize_t *frameUsed, u_char frame[], ssize_t *frameUsed,
ssize_t frameLeft) ssize_t frameLeft)
{ {
int bal = expand_read_bal; int bal = expand_read_bal;
int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000); int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
short *fp = (short *) &frame[*frameUsed]; short *fp = (short *) &frame[*frameUsed];
short *up = (short *) userPtr; short __user *up = (short __user *) userPtr;
int stereo = dmasound.soft.stereo; int stereo = dmasound.soft.stereo;
int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed; int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
int utotal, ftotal; int utotal, ftotal;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment