mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michal Nazarewicz <mina86@mina86.com>,
	Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Subject: [PATCH 2/4] usb: gadget: m66592: fix unused-but-set-variable warnings
Date: Mon, 23 May 2016 13:45:56 +0200	[thread overview]
Message-ID: <1464003958-23253-3-git-send-email-mina86@mina86.com> (raw)
In-Reply-To: <1464003958-23253-1-git-send-email-mina86@mina86.com>

This patch fixes the following (W=1) warnings:

drivers/usb/gadget/udc/m66592-udc.c: In function ‘m66592_irq’:
drivers/usb/gadget/udc/m66592-udc.c:1203:15: warning: variable ‘nrdyenb’ set but not used [-Wunused-but-set-variable]
  u16 brdyenb, nrdyenb, bempenb;
               ^
drivers/usb/gadget/udc/m66592-udc.c:1202:15: warning: variable ‘nrdysts’ set but not used [-Wunused-but-set-variable]
  u16 brdysts, nrdysts, bempsts;
               ^

In doing so, it removes calls to m66592_read function which does I/O
with the device, but I hope the reads don’t have any side effects that
are needed.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
---
 drivers/usb/gadget/udc/m66592-udc.c | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
index b1cfa96..6e977dc 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1199,8 +1199,6 @@ static irqreturn_t m66592_irq(int irq, void *_m66592)
 	struct m66592 *m66592 = _m66592;
 	u16 intsts0;
 	u16 intenb0;
-	u16 brdysts, nrdysts, bempsts;
-	u16 brdyenb, nrdyenb, bempenb;
 	u16 savepipe;
 	u16 mask0;
 
@@ -1224,12 +1222,10 @@ static irqreturn_t m66592_irq(int irq, void *_m66592)
 
 	mask0 = intsts0 & intenb0;
 	if (mask0) {
-		brdysts = m66592_read(m66592, M66592_BRDYSTS);
-		nrdysts = m66592_read(m66592, M66592_NRDYSTS);
-		bempsts = m66592_read(m66592, M66592_BEMPSTS);
-		brdyenb = m66592_read(m66592, M66592_BRDYENB);
-		nrdyenb = m66592_read(m66592, M66592_NRDYENB);
-		bempenb = m66592_read(m66592, M66592_BEMPENB);
+		u16 brdysts = m66592_read(m66592, M66592_BRDYSTS);
+		u16 bempsts = m66592_read(m66592, M66592_BEMPSTS);
+		u16 brdyenb = m66592_read(m66592, M66592_BRDYENB);
+		u16 bempenb = m66592_read(m66592, M66592_BEMPENB);
 
 		if (mask0 & M66592_VBINT) {
 			m66592_write(m66592,  0xffff & ~M66592_VBINT,
@@ -1408,28 +1404,20 @@ static int m66592_dequeue(struct usb_ep *_ep, struct usb_request *_req)
 
 static int m66592_set_halt(struct usb_ep *_ep, int value)
 {
-	struct m66592_ep *ep;
-	struct m66592_request *req;
+	struct m66592_ep *ep = container_of(_ep, struct m66592_ep, ep);
 	unsigned long flags;
 	int ret = 0;
 
-	ep = container_of(_ep, struct m66592_ep, ep);
-	req = list_entry(ep->queue.next, struct m66592_request, queue);
-
 	spin_lock_irqsave(&ep->m66592->lock, flags);
 	if (!list_empty(&ep->queue)) {
 		ret = -EAGAIN;
-		goto out;
-	}
-	if (value) {
+	} else if (value) {
 		ep->busy = 1;
 		pipe_stall(ep->m66592, ep->pipenum);
 	} else {
 		ep->busy = 0;
 		pipe_stop(ep->m66592, ep->pipenum);
 	}
-
-out:
 	spin_unlock_irqrestore(&ep->m66592->lock, flags);
 	return ret;
 }
-- 
2.8.0.rc3.226.g39d4020

  parent reply	other threads:[~2016-05-23 11:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 11:45 [PATCH 0/4] usb: gadget: fix most of W=1 warinngs Michal Nazarewicz
2016-05-23 11:45 ` [PATCH 1/4] usb: gadget: fix unused-but-set-variale warnings Michal Nazarewicz
2016-05-23 11:45 ` Michal Nazarewicz [this message]
2016-05-23 11:45 ` [PATCH 3/4] usb: gadget: r8a66597: fix unused-but-set-variable warnings Michal Nazarewicz
2016-05-23 11:45 ` [PATCH 4/4] usb: gadget: mv_u3d: " Michal Nazarewicz
2016-05-31  7:09 ` [PATCH 0/4] usb: gadget: fix most of W=1 warinngs Felipe Balbi
2016-05-31 12:17   ` Michal Nazarewicz
2016-05-31 12:17     ` [PATCHv2 1/4] usb: gadget: fix unused-but-set-variale warnings Michal Nazarewicz
2016-06-04 23:24       ` kbuild test robot
2016-05-31 12:17     ` [PATCHv2 2/4] usb: gadget: m66592: fix unused-but-set-variable warnings Michal Nazarewicz
2016-05-31 12:17     ` [PATCHv2 3/4] usb: gadget: r8a66597: " Michal Nazarewicz
2016-05-31 12:17     ` [PATCHv2 4/4] usb: gadget: mv_u3d: " Michal Nazarewicz

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=1464003958-23253-3-git-send-email-mina86@mina86.com \
    --to=mina86@mina86.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shimoda.yoshihiro@renesas.com \
    /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

all inboxes | Powered by JetHome®