From patchwork Tue Jun 26 17:06:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10489695 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5E60460386 for ; Tue, 26 Jun 2018 17:07:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4856A203B9 for ; Tue, 26 Jun 2018 17:07:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B8582621D; Tue, 26 Jun 2018 17:07:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBFB5203B9 for ; Tue, 26 Jun 2018 17:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753070AbeFZRG7 (ORCPT ); Tue, 26 Jun 2018 13:06:59 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:37096 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752264AbeFZRG5 (ORCPT ); Tue, 26 Jun 2018 13:06:57 -0400 Received: by mail-pg0-f65.google.com with SMTP id o11-v6so2018677pgv.4 for ; Tue, 26 Jun 2018 10:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=6u6skc5JtH2hk815ltBe4z6R74w7GY2bpN3RFLzQA2o=; b=Nc4z9nN+QNPYwT5EPv6D153UPqj9B3a57SL8+jwAOKUbm5BP5bBomfOHwmXy+XSWOr D6MSKVz0slDEhrr7IaH9L3zQXd7N6pNrBzv4D1FeNQ3pB9pA/tUVWulH2TP07cgXal3G SICGabVQKxZ2/L8WKY3IsyVIYQE8MyNP8G1pA= 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; bh=6u6skc5JtH2hk815ltBe4z6R74w7GY2bpN3RFLzQA2o=; b=UKSXWO9Xn6fF2M9YHN0O3k82L4HC9UQ1dpOlpWbQWfDvCNjPDoBROETA4YHyQEpjrS 9RDKxUl6uQkyWo01cXEZ9GjTXVm8hUs/zHCRP05i4OtPLlvWBtiqlyQKMOM2hP6WhAI9 pb8I/5lzD0bkSf+tujyaNpf7S4/Gu6Zq6CEGVpdEVzfhDvlGPfJSmopz3SAHzqBEhG3b 13yC588kZRDhGrPtD9LUHGnq5TgDaUCNRu28U5BrnWu32jy2lMRBSDKPpZpqGyoApfp7 JDwuVBMCCl2YYF9aXcdDpxrR4u+6vRKUiYrQgEr9l4NNpRq2rm6T7Hl9tZcoAX7XEB0W r7Zw== X-Gm-Message-State: APt69E1kTYIvOAP58u4J1FPKew/PYPruIwtp/Lxq7txa+LjZDhgXnKVJ RT36qG2QrYYut1dKkHVCGMwQdQ== X-Google-Smtp-Source: AAOMgpdcEeBHKX6t9M86GCdQjCV68k7FhCU3hOf8qfE16iIv4zgX7JJS0nf92MV8MOAlPsewMTI5wQ== X-Received: by 2002:a62:cc4d:: with SMTP id a74-v6mr652682pfg.200.1530032817049; Tue, 26 Jun 2018 10:06:57 -0700 (PDT) Received: from swboyd.mtv.corp.google.com ([2620:0:1000:1511:d30e:62c6:f82c:ff40]) by smtp.gmail.com with ESMTPSA id u14-v6sm10664493pfd.103.2018.06.26.10.06.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 10:06:56 -0700 (PDT) From: Stephen Boyd To: Marcel Holtmann , Johan Hedberg Cc: linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, Thierry Escande Subject: [PATCH] Bluetooth: hci_qca: Replace open-coded msleep() Date: Tue, 26 Jun 2018 10:06:54 -0700 Message-Id: <20180626170654.96831-1-swboyd@chromium.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These three lines make up what msleep() already does, i.e. setting the task to uninterruptible, sleeping for so many jiffies, and then schedule() already puts the task state back to TASK_RUNNING when it returns. Make things clearer by just calling msleep() instead. Cc: Thierry Escande Signed-off-by: Stephen Boyd --- drivers/bluetooth/hci_qca.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 51790dd02afb..ef2b00bdf06d 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -908,9 +908,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) * controller will come back after they receive this HCI command * then host can communicate with new baudrate to controller */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS)); - set_current_state(TASK_RUNNING); + msleep(BAUDRATE_SETTLE_TIMEOUT_MS); return 0; }