Linux USB
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: b-liu@ti.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jia-Ju Bai <baijiaju1990@gmail.com>
Subject: [PATCH] usb: musb: Remove unnecessary check of musb->hcd in musb_handle_intr_connect()
Date: Tue, 17 Dec 2019 17:50:23 +0800	[thread overview]
Message-ID: <20191217095023.6878-1-baijiaju1990@gmail.com> (raw)

In musb_handle_intr_connect(), musb->hcd should be non-null, 
so the check of musb->hcd on line 783 could be dropped.

Thank Greg for good advice.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/usb/musb/musb_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 15cca912c53e..ce57f253a8e1 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -780,8 +780,7 @@ static void musb_handle_intr_connect(struct musb *musb, u8 devctl, u8 int_usb)
 		musb_dbg(musb, "HNP: CONNECT, now b_host");
 b_host:
 		musb->xceiv->otg->state = OTG_STATE_B_HOST;
-		if (musb->hcd)
-			musb->hcd->self.is_b_host = 1;
+		musb->hcd->self.is_b_host = 1;
 		del_timer(&musb->otg_timer);
 		break;
 	default:
-- 
2.17.1


             reply	other threads:[~2019-12-17  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17  9:50 Jia-Ju Bai [this message]
2019-12-17  9:59 ` [PATCH] usb: musb: Remove unnecessary check of musb->hcd in musb_handle_intr_connect() Greg KH
2019-12-17 12:27   ` Jia-Ju Bai
2019-12-17 19:15     ` Bin Liu

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=20191217095023.6878-1-baijiaju1990@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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