Commit 0ba45b3c authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: mwave annotation

parent 04bf264c
......@@ -467,10 +467,10 @@ int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
}
int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr)
{
unsigned short *pusBuffer = pvBuffer;
unsigned short __user *pusBuffer = pvBuffer;
unsigned short val;
......@@ -508,10 +508,10 @@ int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
}
int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
void *pvBuffer, unsigned uCount,
void __user *pvBuffer, unsigned uCount,
unsigned long ulDSPAddr)
{
unsigned short *pusBuffer = pvBuffer;
unsigned short __user *pusBuffer = pvBuffer;
unsigned short val;
......@@ -549,10 +549,10 @@ int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
}
int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr)
{
unsigned short *pusBuffer = pvBuffer;
unsigned short __user *pusBuffer = pvBuffer;
PRINTK_5(TRACE_3780I,
......@@ -590,10 +590,10 @@ int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
}
int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr)
{
unsigned short *pusBuffer = pvBuffer;
unsigned short __user *pusBuffer = pvBuffer;
PRINTK_5(TRACE_3780I,
"3780i::dsp3780I_ReadIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
......@@ -637,10 +637,10 @@ int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
}
int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr)
{
unsigned short *pusBuffer = pvBuffer;
unsigned short __user *pusBuffer = pvBuffer;
PRINTK_5(TRACE_3780I,
"3780i::dsp3780I_WriteIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
......
......@@ -323,16 +323,16 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings);
int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings);
int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings);
int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr);
int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
void *pvBuffer, unsigned uCount,
void __user *pvBuffer, unsigned uCount,
unsigned long ulDSPAddr);
int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr);
int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr);
int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer,
int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
unsigned uCount, unsigned long ulDSPAddr);
unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
unsigned long ulMsaAddr);
......
......@@ -121,6 +121,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
{
unsigned int retval = 0;
pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
void __user *arg = (void __user *)ioarg;
PRINTK_5(TRACE_MWAVE,
"mwavedd::mwave_ioctl, entry inode %x file %x cmd %x arg %x\n",
......@@ -164,8 +165,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
" retval %x from tp3780I_QueryAbilities\n",
retval);
if (retval == 0) {
if( copy_to_user((char *) ioarg,
(char *) &rAbilities,
if( copy_to_user(arg, &rAbilities,
sizeof(MW_ABILITIES)) )
return -EFAULT;
}
......@@ -179,13 +179,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
case IOCTL_MW_READ_DATA:
case IOCTL_MW_READCLEAR_DATA: {
MW_READWRITE rReadData;
unsigned short *pusBuffer = 0;
unsigned short __user *pusBuffer = 0;
if( copy_from_user((char *) &rReadData,
(char *) ioarg,
if( copy_from_user(&rReadData, arg,
sizeof(MW_READWRITE)) )
return -EFAULT;
pusBuffer = (unsigned short *) (rReadData.pBuf);
pusBuffer = (unsigned short __user *) (rReadData.pBuf);
PRINTK_4(TRACE_MWAVE,
"mwavedd::mwave_ioctl IOCTL_MW_READ_DATA,"
......@@ -193,7 +192,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
rReadData.ulDataLength, ioarg, pusBuffer);
retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData,
iocmd,
(void *) pusBuffer,
pusBuffer,
rReadData.ulDataLength,
rReadData.usDspAddress);
}
......@@ -201,12 +200,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
case IOCTL_MW_READ_INST: {
MW_READWRITE rReadData;
unsigned short *pusBuffer = 0;
unsigned short __user *pusBuffer = 0;
if( copy_from_user((char *) &rReadData, (char *) ioarg,
if( copy_from_user(&rReadData, arg,
sizeof(MW_READWRITE)) )
return -EFAULT;
pusBuffer = (unsigned short *) (rReadData.pBuf);
pusBuffer = (unsigned short __user *) (rReadData.pBuf);
PRINTK_4(TRACE_MWAVE,
"mwavedd::mwave_ioctl IOCTL_MW_READ_INST,"
......@@ -222,13 +221,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
case IOCTL_MW_WRITE_DATA: {
MW_READWRITE rWriteData;
unsigned short *pusBuffer = 0;
unsigned short __user *pusBuffer = 0;
if( copy_from_user((char *) &rWriteData,
(char *) ioarg,
if( copy_from_user(&rWriteData, arg,
sizeof(MW_READWRITE)) )
return -EFAULT;
pusBuffer = (unsigned short *) (rWriteData.pBuf);
pusBuffer = (unsigned short __user *) (rWriteData.pBuf);
PRINTK_4(TRACE_MWAVE,
"mwavedd::mwave_ioctl IOCTL_MW_WRITE_DATA,"
......@@ -244,13 +242,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
case IOCTL_MW_WRITE_INST: {
MW_READWRITE rWriteData;
unsigned short *pusBuffer = 0;
unsigned short __user *pusBuffer = 0;
if( copy_from_user((char *) &rWriteData,
(char *) ioarg,
if( copy_from_user(&rWriteData, arg,
sizeof(MW_READWRITE)) )
return -EFAULT;
pusBuffer = (unsigned short *) (rWriteData.pBuf);
pusBuffer = (unsigned short __user *)(rWriteData.pBuf);
PRINTK_4(TRACE_MWAVE,
"mwavedd::mwave_ioctl IOCTL_MW_WRITE_INST,"
......@@ -388,7 +385,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
}
static ssize_t mwave_read(struct file *file, char *buf, size_t count,
static ssize_t mwave_read(struct file *file, char __user *buf, size_t count,
loff_t * ppos)
{
PRINTK_5(TRACE_MWAVE,
......@@ -399,7 +396,7 @@ static ssize_t mwave_read(struct file *file, char *buf, size_t count,
}
static ssize_t mwave_write(struct file *file, const char *buf,
static ssize_t mwave_write(struct file *file, const char __user *buf,
size_t count, loff_t * ppos)
{
PRINTK_5(TRACE_MWAVE,
......
......@@ -522,7 +522,7 @@ int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities
}
int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
void *pvBuffer, unsigned int uCount,
void __user *pvBuffer, unsigned int uCount,
unsigned long ulDSPAddr)
{
int retval = 0;
......@@ -558,7 +558,7 @@ int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
void *pvBuffer, unsigned int uCount,
void __user *pvBuffer, unsigned int uCount,
unsigned long ulDSPAddr)
{
int retval = 0;
......
......@@ -93,10 +93,10 @@ int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData);
int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities);
int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData);
int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
void *pvBuffer, unsigned int uCount,
void __user *pvBuffer, unsigned int uCount,
unsigned long ulDSPAddr);
int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
void *pvBuffer, unsigned int uCount,
void __user *pvBuffer, unsigned int uCount,
unsigned long ulDSPAddr);
......
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