aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-07-01 07:36:14 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:56:01 -0400
commit6d8e9dd050ea78862b6c5e2c873ad6407f9b2428 (patch)
tree4279eb8f2b6ac1359f0e4af32f6df75b124e5efe /drivers
parent8307c28eecea917c4754075fbb85eb398a3bc516 (diff)
[PATCH] IB/ipath: read/write correct sizes through diag interface
We must increment uaddr by size we are reading or writing, since it's passed as a char *, not a pointer to the appropriate size. Signed-off-by: Dave Olson <dave.olson@qlogic.com> Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Cc: "Michael S. Tsirkin" <mst@mellanox.co.il> Cc: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_diag.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c
index d7f17f2a436c..8a0425e98b5f 100644
--- a/drivers/infiniband/hw/ipath/ipath_diag.c
+++ b/drivers/infiniband/hw/ipath/ipath_diag.c
@@ -115,7 +115,7 @@ static int ipath_read_umem64(struct ipath_devdata *dd, void __user *uaddr,
115 goto bail; 115 goto bail;
116 } 116 }
117 reg_addr++; 117 reg_addr++;
118 uaddr++; 118 uaddr += sizeof(u64);
119 } 119 }
120 ret = 0; 120 ret = 0;
121bail: 121bail:
@@ -154,7 +154,7 @@ static int ipath_write_umem64(struct ipath_devdata *dd, void __iomem *caddr,
154 writeq(data, reg_addr); 154 writeq(data, reg_addr);
155 155
156 reg_addr++; 156 reg_addr++;
157 uaddr++; 157 uaddr += sizeof(u64);
158 } 158 }
159 ret = 0; 159 ret = 0;
160bail: 160bail:
@@ -192,7 +192,8 @@ static int ipath_read_umem32(struct ipath_devdata *dd, void __user *uaddr,
192 } 192 }
193 193
194 reg_addr++; 194 reg_addr++;
195 uaddr++; 195 uaddr += sizeof(u32);
196
196 } 197 }
197 ret = 0; 198 ret = 0;
198bail: 199bail:
@@ -231,7 +232,7 @@ static int ipath_write_umem32(struct ipath_devdata *dd, void __iomem *caddr,
231 writel(data, reg_addr); 232 writel(data, reg_addr);
232 233
233 reg_addr++; 234 reg_addr++;
234 uaddr++; 235 uaddr += sizeof(u32);
235 } 236 }
236 ret = 0; 237 ret = 0;
237bail: 238bail: