Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4494691ybx; Mon, 4 Nov 2019 14:21:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwY8UkU/p9SwBYvPcYURqVo/WyetSugAutcLZTQTb4/uTiPSp2fqUxg3f35EUVaPBPOfNv9 X-Received: by 2002:aa7:c7c1:: with SMTP id o1mr32067246eds.123.1572906067079; Mon, 04 Nov 2019 14:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572906067; cv=none; d=google.com; s=arc-20160816; b=L7Ged45J0wNMROtUTifbXZD1CzoUPn0ddA85qWhJytbRlMen/0BBZyvrEPWJ9DeInB pgtHgx6zJJEQstat4avmRJiGz+bFKBe/nNpxf/G8RqmPbhq8xD2MIJgNoMDIUczHAi+I W6VCZjlwIYm7+P3lTgmLdoNomgOg61mAZGu1OCnipj9RuwZPfDDRNEaSqiJzV/O4NGMS uKFKHe7aqXl7/nPkPsQ8mrlse/3P2/d7yNk3OPw0NwHuArRA7BhBE5p+ztEL+C57SAzJ yr7Fqx3CNc16bpV9ZArSqF3PMOjOKeu7Ez+vwScgsMEdjLOzS9OhYNvU2EfDP2RHTuby RuUA== 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=BC8r5QsjqqjoPjGf/AZagBsgB2O03SiyPHeBQ8ks2kalslpDwR950xqjhfMARzv2d0 dOZ7/n9PBID75EhWgJnXJE2nacy4bTqeYpOdh+rs1dXO1DR6FFXJml4XKAKUFaJe0APM TG9PKHSPRLj/RgZ17fSR/Hpb0ogliKhsIX2KcAbCdFwSfJHIFJOnpu9w6VDA8uPJjNE9 evzY3GbLkAy9As7pFcz1BTuAWcP/YEGUDzud7AjwIkBnrq6XlkZJgstA3+JYrryHj/sg mjXBkCBu1J9weLWQrKLN2eDo4Nv5DnHR6JJNEAHQOI2lsTeAF73ijZmidQinU0Kml6sh z8Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G0uUfCJS; 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 d25si8804517edb.19.2019.11.04.14.20.43; Mon, 04 Nov 2019 14:21:07 -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=G0uUfCJS; 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 S2389949AbfKDWSI (ORCPT + 99 others); Mon, 4 Nov 2019 17:18:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:60530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389212AbfKDWCL (ORCPT ); Mon, 4 Nov 2019 17:02:11 -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 7326920650; Mon, 4 Nov 2019 22:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904930; bh=o/Ex+1vv7SaDW4yyZ1WvsYR1s5YLNJ0IQxV7tuCOcYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G0uUfCJS9Wa0z0/tmpg16O+XbK3IAw1+EwwN2A7nCrQ2se898xel49dDfEntWcnzX glavUFd7ZJmOj/20rig0gwaWB7roT1LzQekuqNS9PVRy+lGbJMmU6DvbpuWXUW9Am2 0dRrC8YB7LTXbjLRN+MPGikDAV2R750FEOVtuRQI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Dooks , Mathias Nyman Subject: [PATCH 4.19 119/149] usb: xhci: fix __le32/__le64 accessors in debugfs code Date: Mon, 4 Nov 2019 22:45:12 +0100 Message-Id: <20191104212144.661697720@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212126.090054740@linuxfoundation.org> References: <20191104212126.090054740@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;