Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199605 > unrolled thread

[PATCH 0/9] usb: Simplify return statements

Started by"Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com>
First post2015-08-04 11:30 +0200
Last post2015-08-04 11:30 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/9] usb: Simplify return statements "Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com> - 2015-08-04 11:30 +0200
    [PATCH 6/9] usb: host: u132-hcd: Simplify return statement "Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com> - 2015-08-04 11:30 +0200
    [PATCH 3/9] usb: musb: musb_dsps: Simplify return statement "Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com> - 2015-08-04 11:30 +0200

#1199605 — [PATCH 0/9] usb: Simplify return statements

From"Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com>
Date2015-08-04 11:30 +0200
Subject[PATCH 0/9] usb: Simplify return statements
Message-ID<pTGy6-6co-7@gated-at.bofh.it>
From: Saurabh Karajgaonkar <skarajga@visteon.com>

This patch series is created using simple_return.cocci coccinelle script.
It replaces the redundant instances where variable is first assigned
return value from a function call and then used in return statement,
by direct function call in the return statement.

Saurabh Karajgaonkar (9):
  usb: phy: phy-mxs-usb: Simplify return statement
  usb: phy: phy-keystone: Simplify return statement
  usb: musb: musb_dsps: Simplify return statement
  usb: host: ehci-st: Simplify return statement
  usb: host: oxu210hp-hcd: Simplify return statement
  usb: host: u132-hcd: Simplify return statement
  usb: host: xhci: Simplify return statement
  usb: serial: mxuport: Simplify return statement
  usb: misc: ftdi-elan: Simplify return statement

 drivers/usb/host/ehci-st.c      |  7 +------
 drivers/usb/host/oxu210hp-hcd.c |  7 +------
 drivers/usb/host/u132-hcd.c     | 27 +++++----------------------
 drivers/usb/host/xhci.c         |  6 +-----
 drivers/usb/misc/ftdi-elan.c    | 10 ++--------
 drivers/usb/musb/musb_dsps.c    |  6 +-----
 drivers/usb/phy/phy-keystone.c  |  6 +-----
 drivers/usb/phy/phy-mxs-usb.c   |  6 +-----
 drivers/usb/serial/mxuport.c    |  6 +-----
 9 files changed, 14 insertions(+), 67 deletions(-)

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1199607 — [PATCH 6/9] usb: host: u132-hcd: Simplify return statement

From"Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com>
Date2015-08-04 11:30 +0200
Subject[PATCH 6/9] usb: host: u132-hcd: Simplify return statement
Message-ID<pTGHN-6oa-39@gated-at.bofh.it>
In reply to#1199605
From: Saurabh Karajgaonkar <skarajga@visteon.com>

Replace redundant variable use in return statement.

Signed-off-by: Saurabh Karajgaonkar <skarajga@visteon.com>
---
 drivers/usb/host/u132-hcd.c | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index d516877..1cfb811 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -1542,11 +1542,8 @@ static int u132_periodic_reinit(struct u132 *u132)
 		(fit ^ FIT) | u132->hc_fminterval);
 	if (retval)
 		return retval;
-	retval = u132_write_pcimem(u132, periodicstart,
+	return u132_write_pcimem(u132, periodicstart,
 		((9 * fi) / 10) & 0x3fff);
-	if (retval)
-		return retval;
-	return 0;
 }
 
 static char *hcfs2string(int state)
@@ -2701,28 +2698,18 @@ static int u132_roothub_setportfeature(struct u132 *u132, u16 wValue,
 	if (wIndex == 0 || wIndex > u132->num_ports) {
 		return -EINVAL;
 	} else {
-		int retval;
 		int port_index = wIndex - 1;
 		struct u132_port *port = &u132->port[port_index];
 		port->Status &= ~(1 << wValue);
 		switch (wValue) {
 		case USB_PORT_FEAT_SUSPEND:
-			retval = u132_write_pcimem(u132,
+			return u132_write_pcimem(u132,
 				roothub.portstatus[port_index], RH_PS_PSS);
-			if (retval)
-				return retval;
-			return 0;
 		case USB_PORT_FEAT_POWER:
-			retval = u132_write_pcimem(u132,
+			return u132_write_pcimem(u132,
 				roothub.portstatus[port_index], RH_PS_PPS);
-			if (retval)
-				return retval;
-			return 0;
 		case USB_PORT_FEAT_RESET:
-			retval = u132_roothub_portreset(u132, port_index);
-			if (retval)
-				return retval;
-			return 0;
+			return u132_roothub_portreset(u132, port_index);
 		default:
 			return -EPIPE;
 		}
@@ -2737,7 +2724,6 @@ static int u132_roothub_clearportfeature(struct u132 *u132, u16 wValue,
 	} else {
 		int port_index = wIndex - 1;
 		u32 temp;
-		int retval;
 		struct u132_port *port = &u132->port[port_index];
 		port->Status &= ~(1 << wValue);
 		switch (wValue) {
@@ -2773,11 +2759,8 @@ static int u132_roothub_clearportfeature(struct u132 *u132, u16 wValue,
 		default:
 			return -EPIPE;
 		}
-		retval = u132_write_pcimem(u132, roothub.portstatus[port_index],
+		return u132_write_pcimem(u132, roothub.portstatus[port_index],
 			 temp);
-		if (retval)
-			return retval;
-		return 0;
 	}
 }
 
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1199608 — [PATCH 3/9] usb: musb: musb_dsps: Simplify return statement

From"Karajgaonkar, Saurabh (S.)" <skarajga@visteon.com>
Date2015-08-04 11:30 +0200
Subject[PATCH 3/9] usb: musb: musb_dsps: Simplify return statement
Message-ID<pTGHN-6oa-41@gated-at.bofh.it>
In reply to#1199605
From: Saurabh Karajgaonkar <skarajga@visteon.com>

Replace redundant variable use in return statement.

Signed-off-by: Saurabh Karajgaonkar <skarajga@visteon.com>
---
 drivers/usb/musb/musb_dsps.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 1334a3d..a0cfead 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -482,11 +482,7 @@ static int dsps_musb_init(struct musb *musb)
 		dsps_writeb(musb->mregs, MUSB_BABBLE_CTL, val);
 	}
 
-	ret = dsps_musb_dbg_init(musb, glue);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dsps_musb_dbg_init(musb, glue);
 }
 
 static int dsps_musb_exit(struct musb *musb)
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web