Skip to content

Commit 520133f

Browse files
committed
Add missing __iomem and __user tags to follow upstream
In response to below commits which was merged to upstream for v5.9 "PCI: switchtec: Add missing __iomem and __user tags to fix sparse warnings" torvalds/linux@5f11723 "PCI: switchtec: Add missing __iomem tag to fix sparse warnings" torvalds/linux@42dae89
1 parent 00fd044 commit 520133f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

switchtec.c

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

990990
if (event_id < 0 || event_id >= SWITCHTEC_IOCTL_MAX_EVENTS)
991-
return ERR_PTR(-EINVAL);
991+
return (u32 __iomem *)ERR_PTR(-EINVAL);
992992

993993
off = event_regs[event_id].offset;
994994

995995
if (event_regs[event_id].map_reg == part_ev_reg) {
996996
if (index == SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX)
997997
index = stdev->partition;
998998
else if (index < 0 || index >= stdev->partition_count)
999-
return ERR_PTR(-EINVAL);
999+
return (u32 __iomem *)ERR_PTR(-EINVAL);
10001000
} else if (event_regs[event_id].map_reg == pff_ev_reg) {
10011001
if (index < 0 || index >= stdev->pff_csr_count)
1002-
return ERR_PTR(-EINVAL);
1002+
return (u32 __iomem *)ERR_PTR(-EINVAL);
10031003
}
10041004

10051005
return event_regs[event_id].map_reg(stdev, off, index);
@@ -1108,11 +1108,11 @@ static int ioctl_event_ctl(struct switchtec_dev *stdev,
11081108
}
11091109

11101110
static int ioctl_pff_to_port(struct switchtec_dev *stdev,
1111-
struct switchtec_ioctl_pff_port *up)
1111+
struct switchtec_ioctl_pff_port __user *up)
11121112
{
11131113
int i, part;
11141114
u32 reg;
1115-
struct part_cfg_regs *pcfg;
1115+
struct part_cfg_regs __iomem *pcfg;
11161116
struct switchtec_ioctl_pff_port p;
11171117

11181118
if (copy_from_user(&p, up, sizeof(p)))
@@ -1155,10 +1155,10 @@ static int ioctl_pff_to_port(struct switchtec_dev *stdev,
11551155
}
11561156

11571157
static int ioctl_port_to_pff(struct switchtec_dev *stdev,
1158-
struct switchtec_ioctl_pff_port *up)
1158+
struct switchtec_ioctl_pff_port __user *up)
11591159
{
11601160
struct switchtec_ioctl_pff_port p;
1161-
struct part_cfg_regs *pcfg;
1161+
struct part_cfg_regs __iomem *pcfg;
11621162

11631163
if (copy_from_user(&p, up, sizeof(p)))
11641164
return -EFAULT;
@@ -1534,7 +1534,7 @@ static void init_pff(struct switchtec_dev *stdev)
15341534
{
15351535
int i;
15361536
u32 reg;
1537-
struct part_cfg_regs *pcfg = stdev->mmio_part_cfg;
1537+
struct part_cfg_regs __iomem *pcfg = stdev->mmio_part_cfg;
15381538

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

0 commit comments

Comments
 (0)