Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932764AbbHDJZp (ORCPT ); Tue, 4 Aug 2015 05:25:45 -0400 Received: from mail-db3on0124.outbound.protection.outlook.com ([157.55.234.124]:40992 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755772AbbHDJZm convert rfc822-to-8bit (ORCPT ); Tue, 4 Aug 2015 05:25:42 -0400 From: "Karajgaonkar, Saurabh (S.)" To: "srinivas.kandagatla@gmail.com" , "maxime.coquelin@st.com" , "patrice.chotard@st.com" , "stern@rowland.harvard.edu" , "gregkh@linuxfoundation.org" , "mathias.nyman@intel.com" , "balbi@ti.com" , "johan@kernel.org" , "sergei.shtylyov@cogentembedded.com" , "Julia.Lawall@lip6.fr" , "khilman@linaro.org" , "rafael.j.wysocki@intel.com" , "pmladek@suse.cz" , "wsa@the-dreams.de" CC: "linux-arm-kernel@lists.infradead.org" , "kernel@stlinux.com" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH 6/9] usb: host: u132-hcd: Simplify return statement Thread-Topic: [PATCH 6/9] usb: host: u132-hcd: Simplify return statement Thread-Index: AQHQzpV+7PjXUhBZi0+xAFfjsm/rAw== Date: Tue, 4 Aug 2015 09:11:05 +0000 Message-ID: <4a709b250542c3af2783955f53f1e980b010082a.1438678566.git.skarajga@visteon.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=skarajga@visteon.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [74.112.167.117] x-microsoft-exchange-diagnostics: 1;DBXPR06MB384;5:D9Y+GyOXQskp5zLgtbYNNjMcplgEZXchxTdpGb8ZwyOrXVHIOPkMzSgLN62q9hHoWPTWywHPpuaMNwlUitRHUyHDFKUx4z+yF5kXzziSP77rxADCWpJLmmQiImBq+iszIA4Gay33WGsS6NhBtfTabg==;24:j2KNSHGrnqg7syq1d0WBQE/j0PFKJfInvS2Mwxq9t8BE2Lv2SnPoxBAg5S0HZVC1GgODdq6Ya8zKGuOOcCNrzG4npEsy3AvRYjVutrCZgFU=;20:kXWHla9jjrrPQv6uC/fjm61tXNRvioXJ+2DATPlXiOWoW0FN2xUP6P5Z8yht2RIW01JUxzCodh2XO3KM4LCQGQ== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DBXPR06MB384; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:DBXPR06MB384;BCL:0;PCL:0;RULEID:;SRVR:DBXPR06MB384; x-forefront-prvs: 0658BAF71F x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(199003)(122556002)(2501003)(33646002)(40100003)(62966003)(77156002)(5001960100002)(36756003)(92566002)(229853001)(2950100001)(76176999)(81156007)(2900100001)(4001540100001)(106356001)(19580395003)(87936001)(2171001)(2656002)(66066001)(19580405001)(106116001)(102836002)(105586002)(54356999)(5001770100001)(5001830100001)(118296001)(5001860100001)(64706001)(101416001)(50986999)(5002640100001)(189998001)(2201001)(68736005)(86362001)(46102003)(77096005)(97736004)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DBXPR06MB384;H:DBXPR06MB382.eurprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2015 09:11:05.7174 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR06MB384 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2624 Lines: 86 From: Saurabh Karajgaonkar Replace redundant variable use in return statement. Signed-off-by: Saurabh Karajgaonkar --- 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/