lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230914204404.1253141-1-andrej.skvortzov@gmail.com>
Date:   Thu, 14 Sep 2023 23:44:04 +0300
From:   Andrey Skvortsov <andrej.skvortzov@...il.com>
To:     Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
        Hilda Wu <hildawu@...ltek.com>, Max Chou <max.chou@...ltek.com>
Cc:     Andrey Skvortsov <andrej.skvortzov@...il.com>
Subject: [PATCH] Bluetooth: btrtl: reuse define enumeration values

rtlbt_parse_firmware function sets project_id defined like unnamed
integer constant. But later in the code (btrtl_set_quirks) project_id
is compared against values in btrtl_chip_id enumeration.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@...il.com>
---
 drivers/bluetooth/btrtl.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 84c2c2e1122f..018d86410b88 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -60,7 +60,8 @@ enum btrtl_chip_id {
 	CHIP_ID_8723B,
 	CHIP_ID_8821A,
 	CHIP_ID_8761A,
-	CHIP_ID_8822B = 8,
+	CHIP_ID_8703B = 7,
+	CHIP_ID_8822B,
 	CHIP_ID_8723D,
 	CHIP_ID_8821C,
 	CHIP_ID_8822C = 13,
@@ -631,20 +632,20 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev,
 		__u16 lmp_subver;
 		__u8 id;
 	} project_id_to_lmp_subver[] = {
-		{ RTL_ROM_LMP_8723A, 0 },
-		{ RTL_ROM_LMP_8723B, 1 },
-		{ RTL_ROM_LMP_8821A, 2 },
-		{ RTL_ROM_LMP_8761A, 3 },
-		{ RTL_ROM_LMP_8703B, 7 },
-		{ RTL_ROM_LMP_8822B, 8 },
-		{ RTL_ROM_LMP_8723B, 9 },	/* 8723D */
-		{ RTL_ROM_LMP_8821A, 10 },	/* 8821C */
-		{ RTL_ROM_LMP_8822B, 13 },	/* 8822C */
-		{ RTL_ROM_LMP_8761A, 14 },	/* 8761B */
-		{ RTL_ROM_LMP_8852A, 18 },	/* 8852A */
-		{ RTL_ROM_LMP_8852A, 20 },	/* 8852B */
-		{ RTL_ROM_LMP_8852A, 25 },	/* 8852C */
-		{ RTL_ROM_LMP_8851B, 36 },	/* 8851B */
+		{ RTL_ROM_LMP_8723A, CHIP_ID_8723A },
+		{ RTL_ROM_LMP_8723B, CHIP_ID_8723B },
+		{ RTL_ROM_LMP_8821A, CHIP_ID_8821A },
+		{ RTL_ROM_LMP_8761A, CHIP_ID_8761A },
+		{ RTL_ROM_LMP_8703B, CHIP_ID_8703B },
+		{ RTL_ROM_LMP_8822B, CHIP_ID_8822B },
+		{ RTL_ROM_LMP_8723B, CHIP_ID_8723D },
+		{ RTL_ROM_LMP_8821A, CHIP_ID_8821C },
+		{ RTL_ROM_LMP_8822B, CHIP_ID_8822C },
+		{ RTL_ROM_LMP_8761A, CHIP_ID_8761B },
+		{ RTL_ROM_LMP_8852A, CHIP_ID_8852A },
+		{ RTL_ROM_LMP_8852A, CHIP_ID_8852B },
+		{ RTL_ROM_LMP_8852A, CHIP_ID_8852C },
+		{ RTL_ROM_LMP_8851B, CHIP_ID_8851B },
 	};
 
 	if (btrtl_dev->fw_len <= 8)
-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ