From: Saravana Kannan <skannan@codeaurora.org> To: MyungJoo Ham <myungjoo.ham@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Suman Tatiraju <sumant@codeaurora.org>, linux-pm@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Saravana Kannan <skannan@codeaurora.org> Subject: [PATCH] PM / devfreq: Allocate memory using the right data type Date: Tue, 15 Jul 2014 20:10:43 -0700 [thread overview] Message-ID: <1405480243-25915-1-git-send-email-skannan@codeaurora.org> (raw) From: Suman Tatiraju <sumant@codeaurora.org> Long and int have different sizes on a 64-bit machine. Allocate memory for the time_in_state table using the right data type. Change-Id: I335277674018c0ea759aa0996309d52578ea1fd5 Signed-off-by: Suman Tatiraju <sumant@codeaurora.org> Reviewed-by: Saravana Kannan <skannan@codeaurora.org> Signed-off-by: Saravana Kannan <skannan@codeaurora.org> --- drivers/devfreq/devfreq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 65eed38..349e28ea 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -483,9 +483,10 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->profile->max_state * devfreq->profile->max_state, GFP_KERNEL); - devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) * - devfreq->profile->max_state, - GFP_KERNEL); + devfreq->time_in_state = devm_kzalloc(dev, + sizeof(*(devfreq->time_in_state)) * + devfreq->profile->max_state, + GFP_KERNEL); devfreq->last_stat_updated = jiffies; dev_set_name(&devfreq->dev, "%s", dev_name(dev)); -- 1.8.2.1 The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
WARNING: multiple messages have this Message-ID (diff)
From: skannan@codeaurora.org (Saravana Kannan) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] PM / devfreq: Allocate memory using the right data type Date: Tue, 15 Jul 2014 20:10:43 -0700 [thread overview] Message-ID: <1405480243-25915-1-git-send-email-skannan@codeaurora.org> (raw) From: Suman Tatiraju <sumant@codeaurora.org> Long and int have different sizes on a 64-bit machine. Allocate memory for the time_in_state table using the right data type. Change-Id: I335277674018c0ea759aa0996309d52578ea1fd5 Signed-off-by: Suman Tatiraju <sumant@codeaurora.org> Reviewed-by: Saravana Kannan <skannan@codeaurora.org> Signed-off-by: Saravana Kannan <skannan@codeaurora.org> --- drivers/devfreq/devfreq.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 65eed38..349e28ea 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -483,9 +483,10 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->profile->max_state * devfreq->profile->max_state, GFP_KERNEL); - devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) * - devfreq->profile->max_state, - GFP_KERNEL); + devfreq->time_in_state = devm_kzalloc(dev, + sizeof(*(devfreq->time_in_state)) * + devfreq->profile->max_state, + GFP_KERNEL); devfreq->last_stat_updated = jiffies; dev_set_name(&devfreq->dev, "%s", dev_name(dev)); -- 1.8.2.1 The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
next reply other threads:[~2014-07-16 3:10 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-16 3:10 Saravana Kannan [this message] 2014-07-16 3:10 ` [PATCH] PM / devfreq: Allocate memory using the right data type Saravana Kannan 2014-07-16 3:33 ` Greg Kroah-Hartman 2014-07-16 3:33 ` Greg Kroah-Hartman 2014-07-16 17:21 ` Stephen Boyd 2014-07-16 17:21 ` Stephen Boyd
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1405480243-25915-1-git-send-email-skannan@codeaurora.org \ --to=skannan@codeaurora.org \ --cc=gregkh@linuxfoundation.org \ --cc=kyungmin.park@samsung.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=myungjoo.ham@samsung.com \ --cc=stable@vger.kernel.org \ --cc=sumant@codeaurora.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.