mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-19 12:54:22 -05:00
75 lines
2.3 KiB
Diff
75 lines
2.3 KiB
Diff
From 17014696ce3836c91215b6d6dd82f3befd6e7d4d Mon Sep 17 00:00:00 2001
|
|
From: Archana Sathyakumar <asathyak@codeaurora.org>
|
|
Date: Wed, 29 Jun 2016 11:47:47 -0600
|
|
Subject: msm-core: debug: Fix the number of arguments for sysfs nodes
|
|
|
|
Ptable and enable node parses the input arguments incorrectly. Parse the
|
|
input message into exact number of arguments that are required for the
|
|
respective nodes.
|
|
|
|
CRs-fixed: 1032875
|
|
Change-Id: I881f18217b703a497efa4799288dee39a28ea8ab
|
|
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
|
|
---
|
|
drivers/power/qcom/debug_core.c | 14 +++++++++-----
|
|
1 file changed, 9 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/drivers/power/qcom/debug_core.c b/drivers/power/qcom/debug_core.c
|
|
index d3620bb..e9c578f 100644
|
|
--- a/drivers/power/qcom/debug_core.c
|
|
+++ b/drivers/power/qcom/debug_core.c
|
|
@@ -1,4 +1,4 @@
|
|
-/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
|
|
+/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
@@ -22,6 +22,8 @@
|
|
#include "soc/qcom/msm-core.h"
|
|
|
|
#define MAX_PSTATES 50
|
|
+#define NUM_OF_PENTRY 3 /* number of variables for ptable node */
|
|
+#define NUM_OF_EENTRY 2 /* number of variables for enable node */
|
|
|
|
enum arg_offset {
|
|
CPU_OFFSET,
|
|
@@ -131,13 +133,15 @@ static void add_to_ptable(uint64_t *arg)
|
|
node->ptr->len = node->len;
|
|
}
|
|
|
|
-static int split_ptable_args(char *line, uint64_t *arg)
|
|
+static int split_ptable_args(char *line, uint64_t *arg, uint32_t n)
|
|
{
|
|
char *args;
|
|
int i;
|
|
int ret = 0;
|
|
|
|
- for (i = 0; line; i++) {
|
|
+ for (i = 0; i < n; i++) {
|
|
+ if (!line)
|
|
+ break;
|
|
args = strsep(&line, " ");
|
|
ret = kstrtoull(args, 10, &arg[i]);
|
|
}
|
|
@@ -163,7 +167,7 @@ static ssize_t msm_core_ptable_write(struct file *file,
|
|
goto done;
|
|
}
|
|
kbuf[len] = '\0';
|
|
- ret = split_ptable_args(kbuf, arg);
|
|
+ ret = split_ptable_args(kbuf, arg, NUM_OF_PENTRY);
|
|
if (!ret) {
|
|
add_to_ptable(arg);
|
|
ret = len;
|
|
@@ -227,7 +231,7 @@ static ssize_t msm_core_enable_write(struct file *file,
|
|
goto done;
|
|
}
|
|
kbuf[len] = '\0';
|
|
- ret = split_ptable_args(kbuf, arg);
|
|
+ ret = split_ptable_args(kbuf, arg, NUM_OF_EENTRY);
|
|
if (ret)
|
|
goto done;
|
|
cpu = arg[CPU_OFFSET];
|
|
--
|
|
cgit v1.1
|
|
|