Browse Source

spi: mpc512x-psc: fix compiler warning about uninitialized variable

This fixes several warnings like:

	drivers/spi/spi-mpc512x-psc.c: In function 'mpc512x_psc_spi_prep_xfer_hw':
	arch/powerpc/include/asm/io.h:163:2: warning: '__ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

introduced in commit 8bf960985dfc for some build configurations.

Fixes: 8bf960985dfc ("spi: mpc512x-psc: add support for Freescale MPC5125")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Uwe Kleine-König 10 years ago
parent
commit
1f2112af11
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/spi/spi-mpc512x-psc.c

+ 2 - 2
drivers/spi/spi-mpc512x-psc.c

@@ -40,8 +40,8 @@ enum {
  * MPC5121 (which uses a struct mpc52xx_psc) and MPC5125 (using mpc5125_psc).
  */
 #define psc_addr(mps, regname) ({					\
-	void *__ret;							\
-	switch(mps->type) {						\
+	void *__ret = NULL;						\
+	switch (mps->type) {						\
 	case TYPE_MPC5121: {						\
 			struct mpc52xx_psc __iomem *psc = mps->psc;	\
 			__ret = &psc->regname;				\