Skip to content

Commit 06f3506

Browse files
committed
Merge branch 'pci/switchtec'
- Add __iomem and __user tags to switchtec driver (Logan Gunthorpe) * pci/switchtec: PCI: switchtec: Add missing __iomem tag to fix sparse warnings PCI: switchtec: Add missing __iomem and __user tags to fix sparse warnings
2 parents 6585a1a + 42dae89 commit 06f3506

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/pci/switch/switchtec.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -940,18 +940,18 @@ static u32 __iomem *event_hdr_addr(struct switchtec_dev *stdev,
940940
size_t off;
941941

942942
if (event_id < 0 || event_id >= SWITCHTEC_IOCTL_MAX_EVENTS)
943-
return ERR_PTR(-EINVAL);
943+
return (u32 __iomem *)ERR_PTR(-EINVAL);
944944

945945
off = event_regs[event_id].offset;
946946

947947
if (event_regs[event_id].map_reg == part_ev_reg) {
948948
if (index == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX)
949949
index = stdev->partition;
950950
else if (index < 0 || index >= stdev->partition_count)
951-
return ERR_PTR(-EINVAL);
951+
return (u32 __iomem *)ERR_PTR(-EINVAL);
952952
} else if (event_regs[event_id].map_reg == pff_ev_reg) {
953953
if (index < 0 || index >= stdev->pff_csr_count)
954-
return ERR_PTR(-EINVAL);
954+
return (u32 __iomem *)ERR_PTR(-EINVAL);
955955
}
956956

957957
return event_regs[event_id].map_reg(stdev, off, index);
@@ -1057,11 +1057,11 @@ static int ioctl_event_ctl(struct switchtec_dev *stdev,
10571057
}
10581058

10591059
static int ioctl_pff_to_port(struct switchtec_dev *stdev,
1060-
struct switchtec_ioctl_pff_port *up)
1060+
struct switchtec_ioctl_pff_port __user *up)
10611061
{
10621062
int i, part;
10631063
u32 reg;
1064-
struct part_cfg_regs *pcfg;
1064+
struct part_cfg_regs __iomem *pcfg;
10651065
struct switchtec_ioctl_pff_port p;
10661066

10671067
if (copy_from_user(&p, up, sizeof(p)))
@@ -1104,10 +1104,10 @@ static int ioctl_pff_to_port(struct switchtec_dev *stdev,
11041104
}
11051105

11061106
static int ioctl_port_to_pff(struct switchtec_dev *stdev,
1107-
struct switchtec_ioctl_pff_port *up)
1107+
struct switchtec_ioctl_pff_port __user *up)
11081108
{
11091109
struct switchtec_ioctl_pff_port p;
1110-
struct part_cfg_regs *pcfg;
1110+
struct part_cfg_regs __iomem *pcfg;
11111111

11121112
if (copy_from_user(&p, up, sizeof(p)))
11131113
return -EFAULT;
@@ -1484,7 +1484,7 @@ static void init_pff(struct switchtec_dev *stdev)
14841484
{
14851485
int i;
14861486
u32 reg;
1487-
struct part_cfg_regs *pcfg = stdev->mmio_part_cfg;
1487+
struct part_cfg_regs __iomem *pcfg = stdev->mmio_part_cfg;
14881488

14891489
for (i = 0; i < SWITCHTEC_MAX_PFF_CSR; i++) {
14901490
reg = ioread16(&stdev->mmio_pff_csr[i].vendor_id);

0 commit comments

Comments
 (0)