diff options
author | Ben Dooks (Codethink) <ben.dooks@codethink.co.uk> | 2019-10-25 10:30:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-28 12:47:08 -0400 |
commit | d5501d5c29a2e684640507cfee428178d6fd82ca (patch) | |
tree | 418826205e441cd599731d2a96eb046782aca02f | |
parent | bfa3dbb343f664573292afb9e44f9abeb81a19de (diff) |
usb: xhci: fix __le32/__le64 accessors in debugfs code
It looks like some of the xhci debug code is passing u32 to functions
directly from __le32/__le64 fields.
Fix this by using le{32,64}_to_cpu() on these to fix the following
sparse warnings;
xhci-debugfs.c:205:62: warning: incorrect type in argument 1 (different base types)
xhci-debugfs.c:205:62: expected unsigned int [usertype] field0
xhci-debugfs.c:205:62: got restricted __le32
xhci-debugfs.c:206:62: warning: incorrect type in argument 2 (different base types)
xhci-debugfs.c:206:62: expected unsigned int [usertype] field1
xhci-debugfs.c:206:62: got restricted __le32
...
[Trim down commit message, sparse warnings were similar -Mathias]
Cc: <stable@vger.kernel.org> # 4.15+
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/1572013829-14044-4-git-send-email-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/host/xhci-debugfs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/host/xhci-debugfs.c b/drivers/usb/host/xhci-debugfs.c index 7ba6afc7ef23..76c3f29562d2 100644 --- a/drivers/usb/host/xhci-debugfs.c +++ b/drivers/usb/host/xhci-debugfs.c | |||
@@ -202,10 +202,10 @@ static void xhci_ring_dump_segment(struct seq_file *s, | |||
202 | trb = &seg->trbs[i]; | 202 | trb = &seg->trbs[i]; |
203 | dma = seg->dma + i * sizeof(*trb); | 203 | dma = seg->dma + i * sizeof(*trb); |
204 | seq_printf(s, "%pad: %s\n", &dma, | 204 | seq_printf(s, "%pad: %s\n", &dma, |
205 | xhci_decode_trb(trb->generic.field[0], | 205 | xhci_decode_trb(le32_to_cpu(trb->generic.field[0]), |
206 | trb->generic.field[1], | 206 | le32_to_cpu(trb->generic.field[1]), |
207 | trb->generic.field[2], | 207 | le32_to_cpu(trb->generic.field[2]), |
208 | trb->generic.field[3])); | 208 | le32_to_cpu(trb->generic.field[3]))); |
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
@@ -263,10 +263,10 @@ static int xhci_slot_context_show(struct seq_file *s, void *unused) | |||
263 | xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus)); | 263 | xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus)); |
264 | slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); | 264 | slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); |
265 | seq_printf(s, "%pad: %s\n", &dev->out_ctx->dma, | 265 | seq_printf(s, "%pad: %s\n", &dev->out_ctx->dma, |
266 | xhci_decode_slot_context(slot_ctx->dev_info, | 266 | xhci_decode_slot_context(le32_to_cpu(slot_ctx->dev_info), |
267 | slot_ctx->dev_info2, | 267 | le32_to_cpu(slot_ctx->dev_info2), |
268 | slot_ctx->tt_info, | 268 | le32_to_cpu(slot_ctx->tt_info), |
269 | slot_ctx->dev_state)); | 269 | le32_to_cpu(slot_ctx->dev_state))); |
270 | 270 | ||
271 | return 0; | 271 | return 0; |
272 | } | 272 | } |
@@ -286,10 +286,10 @@ static int xhci_endpoint_context_show(struct seq_file *s, void *unused) | |||
286 | ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, dci); | 286 | ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, dci); |
287 | dma = dev->out_ctx->dma + dci * CTX_SIZE(xhci->hcc_params); | 287 | dma = dev->out_ctx->dma + dci * CTX_SIZE(xhci->hcc_params); |
288 | seq_printf(s, "%pad: %s\n", &dma, | 288 | seq_printf(s, "%pad: %s\n", &dma, |
289 | xhci_decode_ep_context(ep_ctx->ep_info, | 289 | xhci_decode_ep_context(le32_to_cpu(ep_ctx->ep_info), |
290 | ep_ctx->ep_info2, | 290 | le32_to_cpu(ep_ctx->ep_info2), |
291 | ep_ctx->deq, | 291 | le64_to_cpu(ep_ctx->deq), |
292 | ep_ctx->tx_info)); | 292 | le32_to_cpu(ep_ctx->tx_info))); |
293 | } | 293 | } |
294 | 294 | ||
295 | return 0; | 295 | return 0; |