Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4488093ybx; Mon, 4 Nov 2019 14:15:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzY0UTn7PdN9SPl75JvUjDX32HjX6HdKU1FpFQ47EH4VzV8edvvhpkLSO7qmL7bTRsiKKPS X-Received: by 2002:a17:906:5786:: with SMTP id k6mr26369799ejq.294.1572905717722; Mon, 04 Nov 2019 14:15:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905717; cv=none; d=google.com; s=arc-20160816; b=LC43esQZ67h4xzXHGK+jo//aaygXB05cqeocTCC1q7/kmBV2QnwMjHpmd7nju+hC9h +EMSA9ygls/MmWBXSeL8l0dVXXe6jIyBfNdvkgURKDYS8f57w/ZRfKpgMmUw8CStCqGL 3cN96hnTO7iUwuodWSaBrDhL+Q9wJ5f0ROd95l2XPGjkheQiIEYJIsEyoMSaEwHnP339 3WbDtPfw2DAUh9yrfrkP46NzQ2jLFsZ7KYyPElWRBMV0sH5g4QQZtiAf2l5E9gjADukO C/ccgsAiCka+7IRc1Qa2LGYIIOzlxR+4WHOLM0JSAwaSVtPasbr0D+Un/sXWZ/jnEKLd mg8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rDl5VGUklydkQJGhKtEfjDU3NjQmg0KpRG4llTxWMNY=; b=bfhXWtLoSuHR/S0uz2JHWgc0y6p6uCpEtRdy0r6jzkdA8KActrWulJnsG/WNjpP8pI Q4hReEEYykgD2n1a+PWuYY65Tds1F2s2gGbUslc35e+Gbzcg3XUYq3XVQqJWjfCQhqvH wcYdAop42F+EmXOF7VDpuuhoIYSdDRof+r/1uLGn/LXTsb49PquGmgD663EjdemX9Csc eKF2U7tUrZQHvcMATGact9LKnekj0NlxRolbM6Bj8UWt/KF61/Brxui1hPaaNq/v65tc YSSrM5ox2ix942ZEUn1K00ARocwYMR6PkBIpTtYloRlUaqlrLKQwguN4z3ZntDxpcwio nbCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dOL8jtqO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g40si8268112edb.369.2019.11.04.14.14.54; Mon, 04 Nov 2019 14:15:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dOL8jtqO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389839AbfKDWIw (ORCPT + 99 others); Mon, 4 Nov 2019 17:08:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:41786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388158AbfKDWIv (ORCPT ); Mon, 4 Nov 2019 17:08:51 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 859C6214D8; Mon, 4 Nov 2019 22:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905330; bh=o/Ex+1vv7SaDW4yyZ1WvsYR1s5YLNJ0IQxV7tuCOcYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dOL8jtqOXh3fbS0aUJX/6997+RzEVbdwZCSlCCedwizYQbqLLpExIHi9oDM9hrX5+ 4pp7jFaOR0EieAdUc/WKESKePKi5fAIG3OuMX1KWdffw3Olb/IJpvT0XJ+v1qhOD37 j/TpjRuq5XFhSNN+iRP1oFMfI1gxPceOx59UaSGk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Dooks , Mathias Nyman Subject: [PATCH 5.3 109/163] usb: xhci: fix __le32/__le64 accessors in debugfs code Date: Mon, 4 Nov 2019 22:44:59 +0100 Message-Id: <20191104212148.146334499@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Dooks (Codethink) commit d5501d5c29a2e684640507cfee428178d6fd82ca upstream. 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: # 4.15+ Signed-off-by: Ben Dooks Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/1572013829-14044-4-git-send-email-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-debugfs.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) --- a/drivers/usb/host/xhci-debugfs.c +++ b/drivers/usb/host/xhci-debugfs.c @@ -202,10 +202,10 @@ static void xhci_ring_dump_segment(struc trb = &seg->trbs[i]; dma = seg->dma + i * sizeof(*trb); seq_printf(s, "%pad: %s\n", &dma, - xhci_decode_trb(trb->generic.field[0], - trb->generic.field[1], - trb->generic.field[2], - trb->generic.field[3])); + xhci_decode_trb(le32_to_cpu(trb->generic.field[0]), + le32_to_cpu(trb->generic.field[1]), + le32_to_cpu(trb->generic.field[2]), + le32_to_cpu(trb->generic.field[3]))); } } @@ -263,10 +263,10 @@ static int xhci_slot_context_show(struct xhci = hcd_to_xhci(bus_to_hcd(dev->udev->bus)); slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); seq_printf(s, "%pad: %s\n", &dev->out_ctx->dma, - xhci_decode_slot_context(slot_ctx->dev_info, - slot_ctx->dev_info2, - slot_ctx->tt_info, - slot_ctx->dev_state)); + xhci_decode_slot_context(le32_to_cpu(slot_ctx->dev_info), + le32_to_cpu(slot_ctx->dev_info2), + le32_to_cpu(slot_ctx->tt_info), + le32_to_cpu(slot_ctx->dev_state))); return 0; } @@ -286,10 +286,10 @@ static int xhci_endpoint_context_show(st ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, dci); dma = dev->out_ctx->dma + dci * CTX_SIZE(xhci->hcc_params); seq_printf(s, "%pad: %s\n", &dma, - xhci_decode_ep_context(ep_ctx->ep_info, - ep_ctx->ep_info2, - ep_ctx->deq, - ep_ctx->tx_info)); + xhci_decode_ep_context(le32_to_cpu(ep_ctx->ep_info), + le32_to_cpu(ep_ctx->ep_info2), + le64_to_cpu(ep_ctx->deq), + le32_to_cpu(ep_ctx->tx_info))); } return 0;