Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6048754ybp; Tue, 15 Oct 2019 08:52:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4KEoolRGU/Eyu69m0IXghwVBJvTpkMVPFsKJ+KVNdqLTZgSPem9H8ELg9tuyp+7lV5g0v X-Received: by 2002:a17:906:2319:: with SMTP id l25mr35020184eja.309.1571154720672; Tue, 15 Oct 2019 08:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571154720; cv=none; d=google.com; s=arc-20160816; b=aHvMc+O4ugZs/yHaXWPk/o+Zge43QrhL2iT2lpj8bVpjWCMzxrZQaD/fcV9KLsknMS PrWtxbu+qe0fR/iu45lE7FMHViavaJzDo0YwOYMJXG4gnqJYM6ZjEJcCExmRIZS/Epno iiuaWah23xr6ao3CxepBBvJHyKxIZdiIHE1NmO68YcUfVa6UUuCDD6KFXqt3H/ss/F3X 3wcRbb/P+ZPqQl0iZCZKzhObynEUoD3dkMPpJfdQRgc5fDUPq0BWYchliLzZtlwuaLNi U/cOc9DBWvzATtlhsVnMRlLbqNYGDci9lPRonmYXgrZpbMkl1XOhdcgHM1zb37uplZfi BcUg== 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 :message-id:date:subject:cc:to:from; bh=y123u+P0ociRljRkZeK5FMlNVdp9ekAXIt6OV6DkcBY=; b=FVbZZVlEG+tKgODMoQSvh0Ki2+0+hI1W81PL/UyR2vsI0KxkHj3+lm8KfD70wjBC+H 5APAjcu8fgnARbzrVVDsOAqB0x6fLUUxOFsQ2clsCZ+APjwMamkndb4hg8gCG+l+p1iu 4a+gLyjwcUB0LV7Y+tEBoJjRQW1ZaFBZO5Rwqyc+j7RSEyxf+vgp9KOOt0PLq49gbAQT +1jAE3yo3f+o70Ghb6WcfLPIk944KidejvsUmPBY/1QMGSpXpCNcNDqX9r5pD/OxAynM CtkBSrlqElWhaykYwBAzMBMF/6D847rrasg+fw3DU16GpqekfDE3BPGsdv1qM4disaNi MFdg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b42si14166466edb.11.2019.10.15.08.51.37; Tue, 15 Oct 2019 08:52:00 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387741AbfJOPvC (ORCPT + 99 others); Tue, 15 Oct 2019 11:51:02 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:53096 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbfJOPvC (ORCPT ); Tue, 15 Oct 2019 11:51:02 -0400 Received: from [167.98.27.226] (helo=rainbowdash.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iKP63-00077G-SO; Tue, 15 Oct 2019 16:50:51 +0100 Received: from ben by rainbowdash.codethink.co.uk with local (Exim 4.92.2) (envelope-from ) id 1iKP63-000361-85; Tue, 15 Oct 2019 16:50:51 +0100 From: "Ben Dooks (Codethink)" To: linux-kernel@lists.codethink.co.uk Cc: "Ben Dooks (Codethink)" , Greg Kroah-Hartman , Yoshihiro Shimoda , Simon Horman , Geert Uytterhoeven , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: renesas_usbhs: fix __le16 warnings Date: Tue, 15 Oct 2019 16:50:44 +0100 Message-Id: <20191015155044.11858-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the warnings generated by casting to/from __le16 without using the correct functions. Fixes the following sparse warnings: drivers/usb/renesas_usbhs/common.c:165:25: warning: incorrect type in assignment (different base types) drivers/usb/renesas_usbhs/common.c:165:25: expected restricted __le16 [usertype] wValue drivers/usb/renesas_usbhs/common.c:165:25: got unsigned short drivers/usb/renesas_usbhs/common.c:166:25: warning: incorrect type in assignment (different base types) drivers/usb/renesas_usbhs/common.c:166:25: expected restricted __le16 [usertype] wIndex drivers/usb/renesas_usbhs/common.c:166:25: got unsigned short drivers/usb/renesas_usbhs/common.c:167:25: warning: incorrect type in assignment (different base types) drivers/usb/renesas_usbhs/common.c:167:25: expected restricted __le16 [usertype] wLength drivers/usb/renesas_usbhs/common.c:167:25: got unsigned short drivers/usb/renesas_usbhs/common.c:173:39: warning: incorrect type in argument 3 (different base types) drivers/usb/renesas_usbhs/common.c:173:39: expected unsigned short [usertype] data drivers/usb/renesas_usbhs/common.c:173:39: got restricted __le16 [usertype] wValue drivers/usb/renesas_usbhs/common.c:174:39: warning: incorrect type in argument 3 (different base types) drivers/usb/renesas_usbhs/common.c:174:39: expected unsigned short [usertype] data drivers/usb/renesas_usbhs/common.c:174:39: got restricted __le16 [usertype] wIndex drivers/usb/renesas_usbhs/common.c:175:39: warning: incorrect type in argument 3 (different base types) drivers/usb/renesas_usbhs/common.c:175:39: expected unsigned short [usertype] data Note. I belive this to be correct, and should be a no-op on arm. Signed-off-by: Ben Dooks --- Cc: Greg Kroah-Hartman Cc: Yoshihiro Shimoda Cc: Simon Horman Cc: Geert Uytterhoeven Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/usb/renesas_usbhs/common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 4c3de777ef6c..a3c30b609433 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -162,17 +162,17 @@ void usbhs_usbreq_get_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req) req->bRequest = (val >> 8) & 0xFF; req->bRequestType = (val >> 0) & 0xFF; - req->wValue = usbhs_read(priv, USBVAL); - req->wIndex = usbhs_read(priv, USBINDX); - req->wLength = usbhs_read(priv, USBLENG); + req->wValue = cpu_to_le16(usbhs_read(priv, USBVAL)); + req->wIndex = cpu_to_le16(usbhs_read(priv, USBINDX)); + req->wLength = cpu_to_le16(usbhs_read(priv, USBLENG)); } void usbhs_usbreq_set_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req) { usbhs_write(priv, USBREQ, (req->bRequest << 8) | req->bRequestType); - usbhs_write(priv, USBVAL, req->wValue); - usbhs_write(priv, USBINDX, req->wIndex); - usbhs_write(priv, USBLENG, req->wLength); + usbhs_write(priv, USBVAL, le16_to_cpu(req->wValue)); + usbhs_write(priv, USBINDX, le16_to_cpu(req->wIndex)); + usbhs_write(priv, USBLENG, le16_to_cpu(req->wLength)); usbhs_bset(priv, DCPCTR, SUREQ, SUREQ); } -- 2.23.0