Commit 7ca9ab3b authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse: drivers/pci __user annotation

parent f49b24c5
...@@ -89,7 +89,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -89,7 +89,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
if ((pos & 3) && cnt > 2) { if ((pos & 3) && cnt > 2) {
unsigned short val; unsigned short val;
pci_read_config_word(dev, pos, &val); pci_read_config_word(dev, pos, &val);
__put_user(cpu_to_le16(val), (unsigned short *) buf); __put_user(cpu_to_le16(val), (unsigned short __user *) buf);
buf += 2; buf += 2;
pos += 2; pos += 2;
cnt -= 2; cnt -= 2;
...@@ -98,7 +98,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -98,7 +98,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
while (cnt >= 4) { while (cnt >= 4) {
unsigned int val; unsigned int val;
pci_read_config_dword(dev, pos, &val); pci_read_config_dword(dev, pos, &val);
__put_user(cpu_to_le32(val), (unsigned int *) buf); __put_user(cpu_to_le32(val), (unsigned int __user *) buf);
buf += 4; buf += 4;
pos += 4; pos += 4;
cnt -= 4; cnt -= 4;
...@@ -107,7 +107,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -107,7 +107,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
if (cnt >= 2) { if (cnt >= 2) {
unsigned short val; unsigned short val;
pci_read_config_word(dev, pos, &val); pci_read_config_word(dev, pos, &val);
__put_user(cpu_to_le16(val), (unsigned short *) buf); __put_user(cpu_to_le16(val), (unsigned short __user *) buf);
buf += 2; buf += 2;
pos += 2; pos += 2;
cnt -= 2; cnt -= 2;
...@@ -158,7 +158,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof ...@@ -158,7 +158,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
if ((pos & 3) && cnt > 2) { if ((pos & 3) && cnt > 2) {
unsigned short val; unsigned short val;
__get_user(val, (unsigned short *) buf); __get_user(val, (unsigned short __user *) buf);
pci_write_config_word(dev, pos, le16_to_cpu(val)); pci_write_config_word(dev, pos, le16_to_cpu(val));
buf += 2; buf += 2;
pos += 2; pos += 2;
...@@ -167,7 +167,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof ...@@ -167,7 +167,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
while (cnt >= 4) { while (cnt >= 4) {
unsigned int val; unsigned int val;
__get_user(val, (unsigned int *) buf); __get_user(val, (unsigned int __user *) buf);
pci_write_config_dword(dev, pos, le32_to_cpu(val)); pci_write_config_dword(dev, pos, le32_to_cpu(val));
buf += 4; buf += 4;
pos += 4; pos += 4;
...@@ -176,7 +176,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof ...@@ -176,7 +176,7 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
if (cnt >= 2) { if (cnt >= 2) {
unsigned short val; unsigned short val;
__get_user(val, (unsigned short *) buf); __get_user(val, (unsigned short __user *) buf);
pci_write_config_word(dev, pos, le16_to_cpu(val)); pci_write_config_word(dev, pos, le16_to_cpu(val));
buf += 2; buf += 2;
pos += 2; pos += 2;
......
...@@ -57,13 +57,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn, ...@@ -57,13 +57,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
switch (len) { switch (len) {
case 1: case 1:
err = put_user(byte, (unsigned char *)buf); err = put_user(byte, (unsigned char __user *)buf);
break; break;
case 2: case 2:
err = put_user(word, (unsigned short *)buf); err = put_user(word, (unsigned short __user *)buf);
break; break;
case 4: case 4:
err = put_user(dword, (unsigned int *)buf); err = put_user(dword, (unsigned int __user *)buf);
break; break;
}; };
return err; return err;
...@@ -74,13 +74,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn, ...@@ -74,13 +74,13 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
they get instead of a machine check on x86. */ they get instead of a machine check on x86. */
switch (len) { switch (len) {
case 1: case 1:
put_user(-1, (unsigned char *)buf); put_user(-1, (unsigned char __user *)buf);
break; break;
case 2: case 2:
put_user(-1, (unsigned short *)buf); put_user(-1, (unsigned short __user *)buf);
break; break;
case 4: case 4:
put_user(-1, (unsigned int *)buf); put_user(-1, (unsigned int __user *)buf);
break; break;
}; };
return err; return err;
...@@ -106,7 +106,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -106,7 +106,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
lock_kernel(); lock_kernel();
switch(len) { switch(len) {
case 1: case 1:
err = get_user(byte, (u8 *)buf); err = get_user(byte, (u8 __user *)buf);
if (err) if (err)
break; break;
err = pci_write_config_byte(dev, off, byte); err = pci_write_config_byte(dev, off, byte);
...@@ -115,7 +115,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -115,7 +115,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
break; break;
case 2: case 2:
err = get_user(word, (u16 *)buf); err = get_user(word, (u16 __user *)buf);
if (err) if (err)
break; break;
err = pci_write_config_word(dev, off, word); err = pci_write_config_word(dev, off, word);
...@@ -124,7 +124,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -124,7 +124,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
break; break;
case 4: case 4:
err = get_user(dword, (u32 *)buf); err = get_user(dword, (u32 __user *)buf);
if (err) if (err)
break; break;
err = pci_write_config_dword(dev, off, dword); err = pci_write_config_dword(dev, off, dword);
......
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