Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4550825imb; Wed, 6 Mar 2019 16:41:42 -0800 (PST) X-Google-Smtp-Source: APXvYqycWL4hOW17dCCSftt0OZzZNe1M+Mn81w2gHmFrnRV1It6HcI3+JghvocVGbNymgXkbfNiu X-Received: by 2002:a65:6497:: with SMTP id e23mr8622432pgv.21.1551919302517; Wed, 06 Mar 2019 16:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551919302; cv=none; d=google.com; s=arc-20160816; b=igs0wI7AEmSW35dYJNBZcEcvx/3sv0czupgyil09MQmZDsCgVSFVxTL8SiL0isWhYF oYANjDTjsmoB4ov+NMx8DhT3xfJpMfbQQiWPWP3KG6oL/aLrlFcafOX4i8IiJ0jwvCp9 25E57n9ZVm3ZJFmAIpoCw3uAmBc2v6olqv2X+7/ODTZEQ0TLaSK0lLFQqLsDSMrB6GtR w7DwTP0ll5H1R9TeoarDbRuVKqOWA//GomR0hm/oBA6v9uDRfv3qUBXZbYnaD4FPVuHK 6UQW+XNR/ou917cHyxWkTYScR0PeGbF7hk/1EirvCj5mgZ203QS2cLO2N+z3FUc1Ln0Y rM+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Bzyw/FtnJm42S211Z4jwpMLy///sVqYqjHEjihMGnWc=; b=OjSlGwXsi0ZOY73Z8aYwbC/4jyt7SMGtBUPBHiiNuhyLlkY/Bex2lxs9io04QEURuM 6gZgZiS2newIuR8Schl0p5ZiI4pVgNETy228NiGk1+AHlx9jPRT2P8lvtytkRC3F3Rs+ apw482Ri05A9nSWXRuRGI1hqvyYB4ptcG9cDJDj+0LhuTBOnjjsnsNvBSCMVZtNgeGz8 hrRKgZlUdHsx14G2HDCC1z6RP/xiW2p+z3MNq1QqhS0k7F8QmsLUwBr//9tkY2NllYiY P1xxqTVdhHFyYRb7uZRYZPwvJ8qN3r4+FPPDWW2JyCaYojQCFMegmFdBVveVQgPxA2Qw Iy9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Fa65DUiP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si2887520plh.397.2019.03.06.16.41.27; Wed, 06 Mar 2019 16:41:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Fa65DUiP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbfCGAlC (ORCPT + 99 others); Wed, 6 Mar 2019 19:41:02 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42689 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbfCGAlB (ORCPT ); Wed, 6 Mar 2019 19:41:01 -0500 Received: by mail-pf1-f196.google.com with SMTP id n74so9984157pfi.9 for ; Wed, 06 Mar 2019 16:41:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bzyw/FtnJm42S211Z4jwpMLy///sVqYqjHEjihMGnWc=; b=Fa65DUiPt0OKc5L+El+Ke/snQVMtahC81LLsTp2Yx7P+ktf6X/+hKfugvViZm6XpSS YKq8EE59N54UfN0K9yAy1YwNcGdKdXGiulKCjd5fXQp7K+GjAq4iBTXVoO6tlID6MrKh VFDeCTYKHIZuZ6WitSatIciXiw6PrPBJ1Weik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bzyw/FtnJm42S211Z4jwpMLy///sVqYqjHEjihMGnWc=; b=CQ3WQMc3UXQu2NY75i26QYWFRGnm5F2KPvDlEFoYiF/qxCrDy23n4B0CF2zkJ+Lm8n 1eMFNrPBHcMDRdgY+XRO+OB7zb9/mjqw5TqDZ28h3uQLzfmpWuo/OJup7vjrSZFhBuyB GuTnvUbk8xrGEBrv0Yl0zC6vL59PFqzvsco46dEss+SdP1X1FwPOe24HktBKT8Plwwau 7208ED4K43t2E8zusGxOf6tPnz6kozhJ6oZlx6oH7miktmu3la75r4sYtAiYrC0ycBu8 /VUaUi5JUCUAIHu9Pe5Z2CNjpXSzmMokUivfd9EORWs7S1JyWtRJbWSEl4qEHCDXqz9f 9N5w== X-Gm-Message-State: APjAAAVaU3iCYX958qkUv6zHlpXRdBaRUVnajOJfPAWpwuK4J0/iFWCc TCrhUMIS3Tz/P/nCDb2kCTXdYQ== X-Received: by 2002:aa7:8051:: with SMTP id y17mr10021766pfm.92.1551919261248; Wed, 06 Mar 2019 16:41:01 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id o76sm8361985pfa.156.2019.03.06.16.41.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 16:41:00 -0800 (PST) From: Matthias Kaehlcke To: Marcel Holtmann , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Balakrishna Godavarthi , Hemantg , Matthias Kaehlcke Subject: [PATCH 1/2] Bluetooth: hci_qca: Rename STATE_ to QCA_ Date: Wed, 6 Mar 2019 16:40:40 -0800 Message-Id: <20190307004041.38059-2-mka@chromium.org> X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog In-Reply-To: <20190307004041.38059-1-mka@chromium.org> References: <20190307004041.38059-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename STATE_IN_BAND_SLEEP_ENABLED to QCA_IN_BAND_SLEEP_ENABLED. The constant represents a flag (multiple flags can be set at once), not a unique state of the controller or driver. Also use the BIT() macro to specify the position of the flag instead of an integer literal. Signed-off-by: Matthias Kaehlcke --- drivers/bluetooth/hci_qca.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 237aea34b69f1..ab8e59419dbc4 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -54,8 +54,7 @@ #define HCI_IBS_WAKE_ACK 0xFC #define HCI_MAX_IBS_SIZE 10 -/* Controller states */ -#define STATE_IN_BAND_SLEEP_ENABLED 1 +#define QCA_IN_BAND_SLEEP_ENABLED BIT(0) #define IBS_WAKE_RETRANS_TIMEOUT_MS 100 #define IBS_TX_IDLE_TIMEOUT_MS 2000 @@ -775,7 +774,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb) /* Don't go to sleep in middle of patch download or * Out-Of-Band(GPIOs control) sleep is selected. */ - if (!test_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags)) { + if (!test_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags)) { skb_queue_tail(&qca->txq, skb); spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); return 0; @@ -1192,7 +1191,7 @@ static int qca_setup(struct hci_uart *hu) return ret; /* Patch downloading has to be done without IBS mode */ - clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); + clear_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags); if (qcadev->btsoc_type == QCA_WCN3990) { bt_dev_info(hdev, "setting up wcn3990"); @@ -1236,7 +1235,7 @@ static int qca_setup(struct hci_uart *hu) /* Setup patch / NVM configurations */ ret = qca_uart_setup(hdev, qca_baudrate, qcadev->btsoc_type, soc_ver); if (!ret) { - set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); + set_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags); qca_debugfs_init(hdev); } else if (ret == -ENOENT) { /* No patch/nvm-config found, run with original fw/config */ @@ -1294,7 +1293,7 @@ static void qca_power_shutdown(struct hci_uart *hu) * data in skb's. */ spin_lock_irqsave(&qca->hci_ibs_lock, flags); - clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); + clear_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags); qca_flush(hu); spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); -- 2.21.0.352.gf09ad66450-goog