Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1472576ybt; Thu, 2 Jul 2020 06:26:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyReBLqVQVl8/dujGU1oIi8QRJXi9xeN7DyW77Iy5NUCupfOcY5q6jKKmMou3kaTEOdx+7f X-Received: by 2002:a50:f413:: with SMTP id r19mr36357146edm.17.1593696416711; Thu, 02 Jul 2020 06:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593696416; cv=none; d=google.com; s=arc-20160816; b=HERR/+8X+sOB0u+jje8N2PXuibMVtLzh0V3ufQYTnvE+Af8bhxjbEZb/nGwA9D3/aO EmcKY30cDi8beI7rjIE33mmy0BFC7z5d26juswEvvksu1QOoJJSJwjC7IYrlJ1dt0tOy /TESkN9frHxSQGKcWXv0DQZ4GcYxhMqUeVNaI/gH10z/FuuyETY7pUhMB7HZno0DwyBG 5m4ZoLnMmALNjxjNMrERyhxrS4jQMay/05S4zs2IoFatmyCRDaoBkqIGKjsSU9L9TTQL zFxd+Yv2XuxmixYfRmQA1eNJAxF6bxH+D6b55lcF3JYn58Iau87VreAW83rEYDx9Ody2 tWmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=PwrAXf0LTIjLKMO1hG4s26PCOFTeAj31VZm4YdBPZVk=; b=dBzK68w/M8k+vM7EOkHrMZAZ9C/vRc22sy89xA0b/vGt/2zWmNV5QK8Cd0lMxHCO1m XZ+TzyJS1kmSMrHWqQ76AZyik+vNngp5OJK0khKORA/pWfGjDFh7UkdyayBNrefS/v+C xlfkORCUEPwMGMMkF+RoCvcV61g4oyyvQ1Bi3QLfmwu/dP021H8lW13gDAcAc7TPEtvH /NljW3QL8yQff8zTLMT6NHaAqbkTFLxp4JqEO9T4TkJ2cv6demSnb9fzHrYSps1gx4LP tcDlI6t/MDtNJLoPVuLx09G9hRb1jEd0VvutiRC6mWoRMceIC2peHq7SZLqb3+jHPqpR q0bQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si5792635edt.71.2020.07.02.06.26.32; Thu, 02 Jul 2020 06:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729336AbgGBN0B convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Jul 2020 09:26:01 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:46278 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729335AbgGBN0A (ORCPT ); Thu, 2 Jul 2020 09:26:00 -0400 Received: from marcel-macpro.fritz.box (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id 45535CED13; Thu, 2 Jul 2020 15:35:53 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH 2/5] Bluetooth: btintel: Refactor firmware header download sequence From: Marcel Holtmann In-Reply-To: <20200702120315.26768-3-kiran.k@intel.com> Date: Thu, 2 Jul 2020 15:25:57 +0200 Cc: linux-bluetooth , "Srivatsa, Ravishankar" , Chethan T N , kiraank@gmail.com, Amit K Bag , Raghuram Hegde Content-Transfer-Encoding: 8BIT Message-Id: <8040CBA1-AF50-43A1-8314-4E44E4F27173@holtmann.org> References: <20200702120315.26768-1-kiran.k@intel.com> <20200702120315.26768-3-kiran.k@intel.com> To: Kiran K X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Kiran, > Move firmware header download code to a separate function to > enhance readability and reusability > > Signed-off-by: Kiran K > Signed-off-by: Amit K Bag > Signed-off-by: Raghuram Hegde > Reviewed-by: Chethan T N > Reviewed-by: Sathish Narasimman > Reviewed-by: Srivatsa Ravishankar > --- > drivers/bluetooth/btintel.c | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c > index dea96c585ecb..1c820c187421 100644 > --- a/drivers/bluetooth/btintel.c > +++ b/drivers/bluetooth/btintel.c > @@ -646,12 +646,10 @@ int btintel_read_boot_params(struct hci_dev *hdev, > } > EXPORT_SYMBOL_GPL(btintel_read_boot_params); > > -int btintel_download_firmware(struct hci_dev *hdev, const struct firmware *fw, > - u32 *boot_param) > +static int btintel_sfi_rsa_header_secure_send(struct hci_dev *hdev, > + const struct firmware *fw) > { > int err; > - const u8 *fw_ptr; > - u32 frag_len; > > /* Start the firmware download transaction with the Init fragment > * represented by the 128 bytes of CSS header. > @@ -679,6 +677,21 @@ int btintel_download_firmware(struct hci_dev *hdev, const struct firmware *fw, > bt_dev_err(hdev, "Failed to send firmware signature (%d)", err); > goto done; > } Here should be an extra empty line before the label. > +done: > + return err; > +} > + > +int btintel_download_firmware(struct hci_dev *hdev, const struct firmware *fw, > + u32 *boot_param) > +{ > + int err; > + const u8 *fw_ptr; > + u32 frag_len; > + > + err = btintel_sfi_rsa_header_secure_send(hdev, fw); > + if (err) > + goto done; > + Scrap the extra empty line here. > > fw_ptr = fw->data + 644; > frag_len = 0; Regards Marcel