lkml.org 
[lkml]   [2015]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] regulator: core: fix constraints debug output
Date
In the case uV_offset is greater than 0 the debug output before
is accidentally overwritten. So take care of the output count.

Fixes: bf5892a8167e ("regulator: Support voltage offsets to compensate for drops")
CC: <stable@vger.kernel.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 443eaab..9afa3af 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -801,7 +801,7 @@ static void print_constraints(struct regulator_dev *rdev)
}

if (constraints->uV_offset)
- count += sprintf(buf, "%dmV offset ",
+ count += sprintf(buf + count, "%dmV offset ",
constraints->uV_offset / 1000);

if (constraints->min_uA && constraints->max_uA) {
--
1.7.9.5


\
 
 \ /
  Last update: 2015-05-20 22:41    [W:0.191 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site