Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26930rwd; Fri, 19 May 2023 14:49:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6KcJGASK/eeTihLPCpoJjKNmvf7H3hzA6lceEpQo9oFsi9a0oSni9EPLPMpJAOepX7Xb5Z X-Received: by 2002:a17:902:e74f:b0:1ae:4f8a:7d4e with SMTP id p15-20020a170902e74f00b001ae4f8a7d4emr4699435plf.24.1684532954772; Fri, 19 May 2023 14:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684532954; cv=none; d=google.com; s=arc-20160816; b=hXae0elbzjpxzhEzShl6ARRw7fTX4L/gTEB34a9p2SzKpP5ZHo/XYNvhVkiSW0XrOq YoJm3wW8BtfW3qapGHPfX+996daQZ4nrOqWMbO63FvXGW9x05HQrH9qIR2j9ep+N2UD5 v6Ow5nZfs1xjRiF0r9+IyTqqVMt926ILmoMilUB2L+qXQI09cgZVA31famo6cT28a8rp kNxeEy9SR+zJGkrdi3jAa03JuZSyNg0A0WST0TwOn0nhQId76C9tipE4xtbVNiWWAjSV DrO+b700hgLnhzBHa94OrJweAT6t/UQN0VM/6AvzTxhfudwuJ3w0f8TYzXnFG1+HO9Jd 2ETw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8+YI3oWErqNGQDBE42kFbzwZJwN9CxeeSi1fS965dfk=; b=ztKZ3msnVNsqj+9Ky1H8cFM4osc8oyTmO8R2/b7pCGuxVaWJi+1OTyb9xXof+Kkd00 vn6jQjBJTpsOQNeEeeCT83PnzTqolBgbOGAEJrhQQ9S0CpByrr/wQ0e2gqi+TCl4hYGR P5l+835wadtG1vEl/qbtjZEZ8g5DOaU3xYmVF/LziWRRQCs9aL+SOVKXsV7+0KsE9cLu 5ZaETOYP+2x5DV4bDY0ZadQeqt1j2YAOOJeDdg1tMC2Zp7wr09P4/AQpsnOdez2vRq5r bNJuA+T+1Ifoi6eBVTzgYCLeRRmkR3Lw+Q+5vlsJ+nQM4ykE689j/lZxQHYrXRXJKDO+ p6GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rAUzIwBG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a170902d38200b001aadba392c1si147297pld.464.2023.05.19.14.48.58; Fri, 19 May 2023 14:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=rAUzIwBG; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229522AbjESVoQ (ORCPT + 99 others); Fri, 19 May 2023 17:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjESVoP (ORCPT ); Fri, 19 May 2023 17:44:15 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0B0BB4; Fri, 19 May 2023 14:44:14 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-64d341bdedcso839840b3a.3; Fri, 19 May 2023 14:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684532654; x=1687124654; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8+YI3oWErqNGQDBE42kFbzwZJwN9CxeeSi1fS965dfk=; b=rAUzIwBGnAq2HbC9AkeTZ/QzT7LAhUHStbdYTu29WP+9B4KMekZ/Reh1WAwJNyCoXm HKQZhImu4kOfk/lFFf8vfU5QD7A6EtXMQ9sy8me3HunVPYoadbpF6DFi6FjuJxPA7prR qAmxOWivMtR3iFZwT0vdk7vIIcc2Mn7TLLjNNd224i0W3o6db5iKf9vpqwKFB0VNGEj1 C0H+KeD6HfaaZJeeQY2T6n11NGd1hxin9/2BvHOesEFb4w4zYsjIx8kNkxaCWjMw0iEt lowiAYC6PnZFMhmDJc0XaB52LyK3v9hMZmG5ZReVM882Zr57OFXWCGGWG0qgE9QKBhZ2 BNxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684532654; x=1687124654; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8+YI3oWErqNGQDBE42kFbzwZJwN9CxeeSi1fS965dfk=; b=BDQ6MtjSu0sAoSXs0+pyUkNhXSorBVV0BtxliNdhPxfhEDqG59a+pBiWFVGZbv4L3c P0O/n7Oyh5Nq3tzJHWYnBFfiSBowuoH63v1AgLpPjNNsAfhfYj5es0YTBe9dIZ4jxVYP DcRUQ+W92jfpZwQGE5C60M2c44u+EtryOqirF2W8dmkHqjsq1AdOikhidJhPQm7pAgAL bE+LFCtSkQfHKb5phWPiQCHIxezCCF+5SihgrcTLCiE103N9zCxaKizEsJLC883Q5yaH WpOtoh+GFe3w1UaVssO5o3hdN3ccB8gsKvTGTglPDs7BOi/IIYtitm0H14nj8UB9lIBU 3nkA== X-Gm-Message-State: AC+VfDzVNqFr+XvgOAsXwHLI2iKOGz4RIwjbrCh+3rtHB0eZaSt0i+Lb lZ8acJz4U4yWksPrTZ87QDBEtOFlTXP5UA== X-Received: by 2002:a17:902:d501:b0:1ae:2e0d:b38c with SMTP id b1-20020a170902d50100b001ae2e0db38cmr4599935plg.12.1684532653947; Fri, 19 May 2023 14:44:13 -0700 (PDT) Received: from ubuntu777.domain.name (36-228-97-28.dynamic-ip.hinet.net. [36.228.97.28]) by smtp.gmail.com with ESMTPSA id s10-20020a170902ea0a00b001ab09f5ca61sm105639plg.55.2023.05.19.14.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 14:44:13 -0700 (PDT) From: Min-Hua Chen To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Min-Hua Chen , 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 Message-Id: <20230519214408.20984-1-minhuadotchen@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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 --- 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