Commit f17a077e authored by Harvey Harrison's avatar Harvey Harrison Committed by Jesse Barnes

PCI: fixup sparse endianness warnings in proc.c

drivers/pci/proc.c:91:3: warning: cast from restricted __le16
drivers/pci/proc.c:100:3: warning: cast from restricted __le32
drivers/pci/proc.c:109:3: warning: cast from restricted __le16
drivers/pci/proc.c:161:40: warning: cast to restricted __le16
drivers/pci/proc.c:170:41: warning: cast to restricted __le32
drivers/pci/proc.c:179:40: warning: cast to restricted __le16
Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent e5899e1b
...@@ -88,7 +88,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -88,7 +88,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_user_read_config_word(dev, pos, &val); pci_user_read_config_word(dev, pos, &val);
__put_user(cpu_to_le16(val), (unsigned short __user *) buf); __put_user(cpu_to_le16(val), (__le16 __user *) buf);
buf += 2; buf += 2;
pos += 2; pos += 2;
cnt -= 2; cnt -= 2;
...@@ -97,7 +97,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -97,7 +97,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_user_read_config_dword(dev, pos, &val); pci_user_read_config_dword(dev, pos, &val);
__put_user(cpu_to_le32(val), (unsigned int __user *) buf); __put_user(cpu_to_le32(val), (__le32 __user *) buf);
buf += 4; buf += 4;
pos += 4; pos += 4;
cnt -= 4; cnt -= 4;
...@@ -106,7 +106,7 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -106,7 +106,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_user_read_config_word(dev, pos, &val); pci_user_read_config_word(dev, pos, &val);
__put_user(cpu_to_le16(val), (unsigned short __user *) buf); __put_user(cpu_to_le16(val), (__le16 __user *) buf);
buf += 2; buf += 2;
pos += 2; pos += 2;
cnt -= 2; cnt -= 2;
...@@ -156,8 +156,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof ...@@ -156,8 +156,8 @@ 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; __le16 val;
__get_user(val, (unsigned short __user *) buf); __get_user(val, (__le16 __user *) buf);
pci_user_write_config_word(dev, pos, le16_to_cpu(val)); pci_user_write_config_word(dev, pos, le16_to_cpu(val));
buf += 2; buf += 2;
pos += 2; pos += 2;
...@@ -165,8 +165,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof ...@@ -165,8 +165,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
} }
while (cnt >= 4) { while (cnt >= 4) {
unsigned int val; __le32 val;
__get_user(val, (unsigned int __user *) buf); __get_user(val, (__le32 __user *) buf);
pci_user_write_config_dword(dev, pos, le32_to_cpu(val)); pci_user_write_config_dword(dev, pos, le32_to_cpu(val));
buf += 4; buf += 4;
pos += 4; pos += 4;
...@@ -174,8 +174,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof ...@@ -174,8 +174,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
} }
if (cnt >= 2) { if (cnt >= 2) {
unsigned short val; __le16 val;
__get_user(val, (unsigned short __user *) buf); __get_user(val, (__le16 __user *) buf);
pci_user_write_config_word(dev, pos, le16_to_cpu(val)); pci_user_write_config_word(dev, pos, le16_to_cpu(val));
buf += 2; buf += 2;
pos += 2; pos += 2;
......
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