aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/pxa2xx_spi.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-01-06 17:41:45 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:20 -0500
commit51e911e27690aecea01d4fe9cb22d38bdd0748ac (patch)
tree0da60b105c3a74ac10a5e34ed9aa0a18af5673ef /drivers/spi/pxa2xx_spi.c
parentee9c1fbfe130a20e0f23d1693d6427dac97239bc (diff)
drivers/spi: move a dereference below a NULL test
In each case, if the NULL test is necessary, then the dereference should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ type T; expression E; identifier i,fld; statement S; @@ - T i = E->fld; + T i; ... when != E when != i if (E == NULL) S + i = E->fld; // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi/pxa2xx_spi.c')
-rw-r--r--drivers/spi/pxa2xx_spi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 6104f461a3c..d0fc4ca2f65 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -1561,11 +1561,12 @@ out_error_master_alloc:
1561static int pxa2xx_spi_remove(struct platform_device *pdev) 1561static int pxa2xx_spi_remove(struct platform_device *pdev)
1562{ 1562{
1563 struct driver_data *drv_data = platform_get_drvdata(pdev); 1563 struct driver_data *drv_data = platform_get_drvdata(pdev);
1564 struct ssp_device *ssp = drv_data->ssp; 1564 struct ssp_device *ssp;
1565 int status = 0; 1565 int status = 0;
1566 1566
1567 if (!drv_data) 1567 if (!drv_data)
1568 return 0; 1568 return 0;
1569 ssp = drv_data->ssp;
1569 1570
1570 /* Remove the queue */ 1571 /* Remove the queue */
1571 status = destroy_queue(drv_data); 1572 status = destroy_queue(drv_data);