From: <sean.wang@mediatek.com>
To: <marcel@holtmann.org>, <johan.hedberg@gmail.com>
Cc: <Mark-YW.Chen@mediatek.com>, <sean.wang@mediatek.com>,
<Soul.Huang@mediatek.com>, <YN.Chen@mediatek.com>,
<Leon.Yen@mediatek.com>, <Eric-SY.Chang@mediatek.com>,
<Deren.Wu@mediatek.com>, <km.lin@mediatek.com>,
<robin.chiu@mediatek.com>, <Eddie.Chen@mediatek.com>,
<ch.yeh@mediatek.com>, <posh.sun@mediatek.com>,
<ted.huang@mediatek.com>, <Eric.Liang@mediatek.com>,
<Stella.Chang@mediatek.com>, <Tom.Chou@mediatek.com>,
<steve.lee@mediatek.com>, <jsiuda@google.com>,
<frankgor@google.com>, <jemele@google.com>,
<abhishekpandit@google.com>, <michaelfsun@google.com>,
<mcchou@chromium.org>, <shawnku@google.com>,
<linux-bluetooth@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 1/4] Bluetooth: btmtksdio: drop the unnecessary variable created
Date: Sat, 20 Nov 2021 06:25:43 +0800 [thread overview]
Message-ID: <4176102d8bbc36e5156e348df666a3e12c5a3d75.1637360076.git.objelf@gmail.com> (raw)
From: Sean Wang <sean.wang@mediatek.com>
Use the existent variable to drop the unnecessary variable created.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
drivers/bluetooth/btmtksdio.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index ce6a6c00ff98..4f3412ad8fca 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -98,6 +98,7 @@ MODULE_DEVICE_TABLE(sdio, btmtksdio_table);
#define MTK_SDIO_BLOCK_SIZE 256
#define BTMTKSDIO_TX_WAIT_VND_EVT 1
+#define BTMTKSDIO_HW_TX_READY 2
struct mtkbtsdio_hdr {
__le16 len;
@@ -113,7 +114,6 @@ struct btmtksdio_dev {
struct work_struct txrx_work;
unsigned long tx_state;
struct sk_buff_head txq;
- bool hw_tx_ready;
struct sk_buff *evt_skb;
@@ -254,7 +254,7 @@ static int btmtksdio_tx_packet(struct btmtksdio_dev *bdev,
sdio_hdr->reserved = cpu_to_le16(0);
sdio_hdr->bt_type = hci_skb_pkt_type(skb);
- bdev->hw_tx_ready = false;
+ clear_bit(BTMTKSDIO_HW_TX_READY, &bdev->tx_state);
err = sdio_writesb(bdev->func, MTK_REG_CTDR, skb->data,
round_up(skb->len, MTK_SDIO_BLOCK_SIZE));
if (err < 0)
@@ -463,11 +463,12 @@ static void btmtksdio_txrx_work(struct work_struct *work)
bt_dev_dbg(bdev->hdev, "Get fw own back");
if (int_status & TX_EMPTY)
- bdev->hw_tx_ready = true;
+ set_bit(BTMTKSDIO_HW_TX_READY, &bdev->tx_state);
+
else if (unlikely(int_status & TX_FIFO_OVERFLOW))
bt_dev_warn(bdev->hdev, "Tx fifo overflow");
- if (bdev->hw_tx_ready) {
+ if (test_bit(BTMTKSDIO_HW_TX_READY, &bdev->tx_state)) {
skb = skb_dequeue(&bdev->txq);
if (skb) {
err = btmtksdio_tx_packet(bdev, skb);
@@ -811,7 +812,7 @@ static int btmtksdio_setup(struct hci_dev *hdev)
u32 fw_version = 0;
calltime = ktime_get();
- bdev->hw_tx_ready = true;
+ set_bit(BTMTKSDIO_HW_TX_READY, &bdev->tx_state);
switch (bdev->data->chipid) {
case 0x7921:
--
2.25.1
next reply other threads:[~2021-11-19 22:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-19 22:25 sean.wang [this message]
2021-11-19 22:25 ` [PATCH 2/4] Bluetooth: btmtksdio: handle runtime pm only when sdio_func is available sean.wang
2021-11-24 14:53 ` Marcel Holtmann
2021-11-19 22:25 ` [PATCH 3/4] Bluetooth: btmtksdio: fix resume failure sean.wang
2021-11-24 15:21 ` Marcel Holtmann
2021-11-19 22:25 ` [PATCH 4/4] Bluetooth: btmtksdio: add support of processing firmware coredump and log sean.wang
2021-11-24 15:20 ` Marcel Holtmann
2021-11-24 15:19 ` [PATCH 1/4] Bluetooth: btmtksdio: drop the unnecessary variable created Marcel Holtmann
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=4176102d8bbc36e5156e348df666a3e12c5a3d75.1637360076.git.objelf@gmail.com \
--to=sean.wang@mediatek.com \
--cc=Deren.Wu@mediatek.com \
--cc=Eddie.Chen@mediatek.com \
--cc=Eric-SY.Chang@mediatek.com \
--cc=Eric.Liang@mediatek.com \
--cc=Leon.Yen@mediatek.com \
--cc=Mark-YW.Chen@mediatek.com \
--cc=Soul.Huang@mediatek.com \
--cc=Stella.Chang@mediatek.com \
--cc=Tom.Chou@mediatek.com \
--cc=YN.Chen@mediatek.com \
--cc=abhishekpandit@google.com \
--cc=ch.yeh@mediatek.com \
--cc=frankgor@google.com \
--cc=jemele@google.com \
--cc=johan.hedberg@gmail.com \
--cc=jsiuda@google.com \
--cc=km.lin@mediatek.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=marcel@holtmann.org \
--cc=mcchou@chromium.org \
--cc=michaelfsun@google.com \
--cc=posh.sun@mediatek.com \
--cc=robin.chiu@mediatek.com \
--cc=shawnku@google.com \
--cc=steve.lee@mediatek.com \
--cc=ted.huang@mediatek.com \
/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;
as well as URLs for NNTP newsgroup(s).