From: Pavel Skripkin <paskripkin@gmail.com>
To: Larry.Finger@lwfinger.net, florian.c.schilhabel@googlemail.com,
gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Pavel Skripkin <paskripkin@gmail.com>
Subject: [PATCH 1/3] staging: rtl8712: remove redundant check in r871xu_drv_init
Date: Mon, 14 Jun 2021 01:00:07 +0300 [thread overview]
Message-ID: <d367e5f39f22af44c545f8710cc18fb00f10e66c.1623620630.git.paskripkin@gmail.com> (raw)
In-Reply-To: <cover.1623620630.git.paskripkin@gmail.com>
padapter->dvobj_init is initialized rigth before
initialization check. There is no need for any
branching here.
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
drivers/staging/rtl8712/usb_intf.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index dc21e7743349..c482a6d1998b 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -380,13 +380,11 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
/* step 3.
* initialize the dvobj_priv
*/
- if (!padapter->dvobj_init) {
+
+ status = padapter->dvobj_init(padapter);
+ if (status != _SUCCESS)
goto error;
- } else {
- status = padapter->dvobj_init(padapter);
- if (status != _SUCCESS)
- goto error;
- }
+
/* step 4. */
status = r8712_init_drv_sw(padapter);
if (status)
--
2.32.0
next prev parent reply other threads:[~2021-06-13 22:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-13 21:59 [PATCH 0/3] staging: rtl8712: code improvment and bug fixes Pavel Skripkin
2021-06-13 22:00 ` Pavel Skripkin [this message]
2021-06-13 22:00 ` [PATCH 2/3] staging: rtl8712: fix error handling in r871xu_drv_init Pavel Skripkin
2021-06-13 22:00 ` [PATCH 3/3] staging: rtl8712: fix memory leak in rtl871x_load_fw_cb Pavel Skripkin
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=d367e5f39f22af44c545f8710cc18fb00f10e66c.1623620630.git.paskripkin@gmail.com \
--to=paskripkin@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).