mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Min-Hua Chen <minhuadotchen@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Min-Hua Chen <minhuadotchen@gmail.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Bluetooth: hci_mrvl: use correct __le16 type
Date: Sat, 20 May 2023 05:44:08 +0800	[thread overview]
Message-ID: <20230519214408.20984-1-minhuadotchen@gmail.com> (raw)

Cast 0xffff to __le16 before comparing it with a __le16 type pkt
and fix the following sparse warnings:

drivers/bluetooth/hci_mrvl.c:170:23: sparse: warning:
restricted __le16 degrades to integer
drivers/bluetooth/hci_mrvl.c:203:23: sparse: warning:
restricted __le16 degrades to integer

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
 drivers/bluetooth/hci_mrvl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c
index e08222395772..91f63d2b0c02 100644
--- a/drivers/bluetooth/hci_mrvl.c
+++ b/drivers/bluetooth/hci_mrvl.c
@@ -167,7 +167,7 @@ static int mrvl_recv_fw_req(struct hci_dev *hdev, struct sk_buff *skb)
 	struct mrvl_data *mrvl = hu->priv;
 	int ret = 0;
 
-	if ((pkt->lhs ^ pkt->rhs) != 0xffff) {
+	if ((pkt->lhs ^ pkt->rhs) != cpu_to_le16(0xffff)) {
 		bt_dev_err(hdev, "Corrupted mrvl header");
 		mrvl_send_ack(hu, MRVL_NAK);
 		ret = -EINVAL;
@@ -200,7 +200,7 @@ static int mrvl_recv_chip_ver(struct hci_dev *hdev, struct sk_buff *skb)
 	u16 version = le16_to_cpu(pkt->lhs);
 	int ret = 0;
 
-	if ((pkt->lhs ^ pkt->rhs) != 0xffff) {
+	if ((pkt->lhs ^ pkt->rhs) != cpu_to_le16(0xffff)) {
 		bt_dev_err(hdev, "Corrupted mrvl header");
 		mrvl_send_ack(hu, MRVL_NAK);
 		ret = -EINVAL;
-- 
2.34.1


                 reply	other threads:[~2023-05-19 21:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230519214408.20984-1-minhuadotchen@gmail.com \
    --to=minhuadotchen@gmail.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    /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®