[PATCH 2.6.23] uninitialised variable in ARM/ixp4xx clockevents code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Compiling kernel 2.6.23 for an ARM/ixp4xx machine results in:

arch/arm/mach-ixp4xx/common.c: In function 'ixp4xx_set_mode':
arch/arm/mach-ixp4xx/common.c:445: warning: 'opts' may be used uninitialized in this function

The warning is valid: if ixp4xx_set_mode() is called with mode
CLOCK_EVT_MODE_RESUME, then 'opts' will be uninitialised at the
'*IXP4XX_OSRT1 = osrt | opts;' statement.

Initialising opts to zero in this case may not be correct, but
at least it's better than writing random junk to the hardware.

Signed-off-by: Mikael Pettersson <[email protected]>
--
I'm not cc:ing linux-arm-kernel since that's subscribers-only.
This code hasn't changed in 2.6.23-git17.

 arch/arm/mach-ixp4xx/common.c |    1 +
 1 files changed, 1 insertion(+)

--- linux-2.6.23/arch/arm/mach-ixp4xx/common.c.~1~	2007-10-22 20:26:50.000000000 +0200
+++ linux-2.6.23/arch/arm/mach-ixp4xx/common.c	2007-10-22 21:22:10.000000000 +0200
@@ -460,6 +460,7 @@ static void ixp4xx_set_mode(enum clock_e
 		osrt = opts = 0;
 		break;
 	case CLOCK_EVT_MODE_RESUME:
+		opts = 0;
 		break;
 	}
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux