public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: fix constraints debug output
@ 2015-05-20 20:17 Stefan Wahren
  2015-05-20 20:35 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wahren @ 2015-05-20 20:17 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Stefan Wahren, stable

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


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

end of thread, other threads:[~2015-05-21  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 20:17 [PATCH] regulator: core: fix constraints debug output Stefan Wahren
2015-05-20 20:35 ` Joe Perches
2015-05-21  6:42   ` Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox