All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script
@ 2009-10-14 12:15 Aaro Koskinen
  2009-10-14 12:15 ` [PATCH 2/2] mfd: twl4030-power: fix undefined resconfig value checks Aaro Koskinen
  2009-10-19 16:37 ` [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script Samuel Ortiz
  0 siblings, 2 replies; 4+ messages in thread
From: Aaro Koskinen @ 2009-10-14 12:15 UTC (permalink / raw)
  To: sameo, linux-kernel

The script length cannot be negative. If the length is zero, return
an error.

The patch eliminates the following compiler warning:

drivers/mfd/twl4030-power.c: In function 'twl4030_power_init':
drivers/mfd/twl4030-power.c:151: warning: 'err' may be used uninitialized in this function
drivers/mfd/twl4030-power.c:151: note: 'err' was declared here

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 drivers/mfd/twl4030-power.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index d423e0c..eae6cda 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -146,9 +146,9 @@ out:
 }
 
 static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
-				       int len)
+				       unsigned len)
 {
-	int err;
+	int err = EINVAL;
 
 	for (; len; len--, address++, script++) {
 		if (len == 1) {
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-20 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-14 12:15 [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script Aaro Koskinen
2009-10-14 12:15 ` [PATCH 2/2] mfd: twl4030-power: fix undefined resconfig value checks Aaro Koskinen
2009-10-19 16:37 ` [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script Samuel Ortiz
2009-10-20 10:21   ` Aaro Koskinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.