From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
Nishad Kamdar <nishadkamdar@gmail.com>,
Mukesh Ojha <mojha@codeaurora.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Forest Bond <forest@alittletooquiet.net>,
Ojaswin Mujoo <ojaswin25111998@gmail.com>
Subject: Re: [PATCH 6/7] staging: vt6656: clean-up registers initialization error path
Date: Tue, 21 May 2019 08:24:30 +0200 [thread overview]
Message-ID: <20190521062430.GA13860@kroah.com> (raw)
In-Reply-To: <20190520163844.1225-7-quentin.deslandes@itdev.co.uk>
On Mon, May 20, 2019 at 04:39:04PM +0000, Quentin Deslandes wrote:
> Avoid discarding function's return code during register initialization.
> Handle it instead and return 0 on success or a negative errno value on
> error.
>
> Signed-off-by: Quentin Deslandes <quentin.deslandes@itdev.co.uk>
> ---
> drivers/staging/vt6656/main_usb.c | 163 ++++++++++++++++++------------
> 1 file changed, 96 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index 5fd845cbdd52..8ed96e8eedbe 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -109,33 +109,38 @@ static void vnt_set_options(struct vnt_private *priv)
> */
> static int vnt_init_registers(struct vnt_private *priv)
> {
> + int ret = 0;
Minor nit here, no need to set this to 0 as you instantly set it with
this call:
> struct vnt_cmd_card_init *init_cmd = &priv->init_command;
> struct vnt_rsp_card_init *init_rsp = &priv->init_response;
> u8 antenna;
> int ii;
> - int status = STATUS_SUCCESS;
> u8 tmp;
> u8 calib_tx_iq = 0, calib_tx_dc = 0, calib_rx_iq = 0;
>
> dev_dbg(&priv->usb->dev, "---->INIbInitAdapter. [%d][%d]\n",
> DEVICE_INIT_COLD, priv->packet_type);
>
> - if (!vnt_check_firmware_version(priv)) {
> - if (vnt_download_firmware(priv) == true) {
> - if (vnt_firmware_branch_to_sram(priv) == false) {
> - dev_dbg(&priv->usb->dev,
> - " vnt_firmware_branch_to_sram fail\n");
> - return false;
> - }
> - } else {
> - dev_dbg(&priv->usb->dev, "FIRMWAREbDownload fail\n");
> - return false;
> + ret = vnt_check_firmware_version(priv);
You can fix that up in a later patch :)
At first glance, these all look really good, thanks for doing this work.
greg k-h
next prev parent reply other threads:[~2019-05-21 6:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 16:39 [PATCH 0/7] staging: vt6656: clean-up error path on init Quentin Deslandes
2019-05-20 16:39 ` [PATCH 1/7] staging: vt6656: fix potential NULL pointer dereference Quentin Deslandes
2019-05-20 16:39 ` [PATCH 2/7] staging: vt6656: clean function's error path in usbpipe.c Quentin Deslandes
2019-05-20 16:39 ` [PATCH 3/7] staging: vt6656: avoid discarding called function's return code Quentin Deslandes
2019-05-20 16:39 ` [PATCH 4/7] staging: vt6656: clean error path for firmware management Quentin Deslandes
2019-05-20 16:39 ` [PATCH 6/7] staging: vt6656: clean-up registers initialization error path Quentin Deslandes
2019-05-21 6:24 ` Greg Kroah-Hartman [this message]
2019-05-20 16:39 ` [PATCH 5/7] staging: vt6656: use meaningful error code during buffer allocation Quentin Deslandes
2019-05-20 16:39 ` [PATCH 7/7] staging: vt6656: manage error path during device initialization Quentin Deslandes
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=20190521062430.GA13860@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=forest@alittletooquiet.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mojha@codeaurora.org \
--cc=nishadkamdar@gmail.com \
--cc=ojaswin25111998@gmail.com \
--cc=quentin.deslandes@itdev.co.uk \
/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