From: Piyush Mehta <piyush.mehta@amd.com>
To: <gregkh@linuxfoundation.org>, <michal.simek@amd.com>,
<u.kleine-koenig@pengutronix.de>, <linus.walleij@linaro.org>
Cc: <linux-usb@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <git@amd.com>,
Piyush Mehta <piyush.mehta@amd.com>
Subject: [PATCH 3/3] usb: gadget: udc-xilinx: fix incorrect type in assignment warning
Date: Tue, 22 Aug 2023 12:02:01 +0530 [thread overview]
Message-ID: <20230822063201.16929-4-piyush.mehta@amd.com> (raw)
In-Reply-To: <20230822063201.16929-1-piyush.mehta@amd.com>
The bitwise attribute is used by the sparse utility to make sure the
variable is converted to the local processor type before other (unsafe)
operations are performed on the variable. Fix the below sparse warnings
type casted with __le16:
warning: incorrect type in assignment (different base types)
expected unsigned short [usertype]
got restricted __le16 [usertype]
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@intel.com/
Signed-off-by: Piyush Mehta <piyush.mehta@amd.com>
---
drivers/usb/gadget/udc/udc-xilinx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index 476c0a8fc5e7..0b12155635d9 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -1638,7 +1638,7 @@ static void xudc_getstatus(struct xusb_udc *udc)
}
req->usb_req.length = 2;
- *(u16 *)req->usb_req.buf = cpu_to_le16(status);
+ *(__le16 *)req->usb_req.buf = cpu_to_le16(status);
ret = __xudc_ep0_queue(ep0, req);
if (ret == 0)
return;
--
2.17.1
prev parent reply other threads:[~2023-08-22 6:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 6:31 [PATCH 0/3] usb: gadget: udc-xilinx: fix warnings Piyush Mehta
2023-08-22 6:31 ` [PATCH 1/3] usb: gadget: udc-xilinx: fix restricted __le16 degrades to integer warning Piyush Mehta
2023-08-22 6:32 ` [PATCH 2/3] usb: gadget: udc-xilinx: fix cast from restricted __le16 warning Piyush Mehta
2023-08-22 6:32 ` Piyush Mehta [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230822063201.16929-4-piyush.mehta@amd.com \
--to=piyush.mehta@amd.com \
--cc=git@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®