aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-04-23 16:19:13 -0400
committerJiri Kosina <jkosina@suse.cz>2010-04-26 05:51:59 -0400
commitb1ffdc8f3d8c8913388ca97dfdf064c87940dd72 (patch)
treefb03112d670022f6ad6e42cfd097faf0c1e2946d
parenta33f32244d8550da8b4a26e277ce07d5c6d158b5 (diff)
i2o: cleanup some exit paths
This is just a cleanup and doesn't change how the code works. The original code had a mix of returns and gotos so I changed everything to just return directly. Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/message/i2o/i2o_config.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index 11073fa3d9f4..d33693c13368 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -314,22 +314,22 @@ static int i2o_cfg_swul(unsigned long arg)
314 int ret = 0; 314 int ret = 0;
315 315
316 if (copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer))) 316 if (copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer)))
317 goto return_fault; 317 return -EFAULT;
318 318
319 if (get_user(swlen, kxfer.swlen) < 0) 319 if (get_user(swlen, kxfer.swlen) < 0)
320 goto return_fault; 320 return -EFAULT;
321 321
322 if (get_user(maxfrag, kxfer.maxfrag) < 0) 322 if (get_user(maxfrag, kxfer.maxfrag) < 0)
323 goto return_fault; 323 return -EFAULT;
324 324
325 if (get_user(curfrag, kxfer.curfrag) < 0) 325 if (get_user(curfrag, kxfer.curfrag) < 0)
326 goto return_fault; 326 return -EFAULT;
327 327
328 if (curfrag == maxfrag) 328 if (curfrag == maxfrag)
329 fragsize = swlen - (maxfrag - 1) * 8192; 329 fragsize = swlen - (maxfrag - 1) * 8192;
330 330
331 if (!kxfer.buf) 331 if (!kxfer.buf)
332 goto return_fault; 332 return -EFAULT;
333 333
334 c = i2o_find_iop(kxfer.iop); 334 c = i2o_find_iop(kxfer.iop);
335 if (!c) 335 if (!c)
@@ -373,12 +373,8 @@ static int i2o_cfg_swul(unsigned long arg)
373 373
374 i2o_dma_free(&c->pdev->dev, &buffer); 374 i2o_dma_free(&c->pdev->dev, &buffer);
375 375
376 return_ret:
377 return ret; 376 return ret;
378 return_fault: 377}
379 ret = -EFAULT;
380 goto return_ret;
381};
382 378
383static int i2o_cfg_swdel(unsigned long arg) 379static int i2o_cfg_swdel(unsigned long arg)
384{ 380{