Return-Path: Date: Tue, 23 Dec 2014 20:55:11 +0200 From: Johan Hedberg To: Tedd Ho-Jeong An Cc: "linux-bluetooth@vger.kernel.org" , Marcel Holtmann Subject: Re: [PATCH] Bluetooth: Cancel the hci_request timeout if it received expected event Message-ID: <20141223185511.GA5686@t440s.P-661HNU-F1> References: <20141222190142.59176a26@tedd-test> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20141222190142.59176a26@tedd-test> List-ID: Hi Tedd, On Mon, Dec 22, 2014, Tedd Ho-Jeong An wrote: > This patch cancels the hci_request timeout work if the expected event > is recevied. The timer you're canceling isn't hci_request specific, so I'm not sure why you're making that reference here? You might want to provide some more detailed explanation in the commit message. > + if (opcode != HCI_OP_NOP) > + cancel_delayed_work(&hdev->cmd_timer); I don't think the check for HCI_OP_NOP is necessary here. The opcode is from the original command that was sent and it can't be HCI_OP_NOP. The other places checking for this before calling cancel_delayed_work() take their opcode from the cmd_status/cmd_complete events where it has special meaning (i.e. a spontaneous event generated by the controller). Johan