All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Saravana Kannan <skannan@codeaurora.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	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
Subject: Re: [PATCH] PM / devfreq: Allocate memory using the right data type
Date: Wed, 16 Jul 2014 10:21:13 -0700	[thread overview]
Message-ID: <53C6B489.3040001@codeaurora.org> (raw)
In-Reply-To: <1405480243-25915-1-git-send-email-skannan@codeaurora.org>

On 07/15/14 20:10, Saravana Kannan wrote:
> 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);

We could use devm_kcalloc() here too.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PM / devfreq: Allocate memory using the right data type
Date: Wed, 16 Jul 2014 10:21:13 -0700	[thread overview]
Message-ID: <53C6B489.3040001@codeaurora.org> (raw)
In-Reply-To: <1405480243-25915-1-git-send-email-skannan@codeaurora.org>

On 07/15/14 20:10, Saravana Kannan wrote:
> 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);

We could use devm_kcalloc() here too.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2014-07-16 17:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  3:10 [PATCH] PM / devfreq: Allocate memory using the right data type Saravana Kannan
2014-07-16  3:10 ` 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 [this message]
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=53C6B489.3040001@codeaurora.org \
    --to=sboyd@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=skannan@codeaurora.org \
    --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: link
Be 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.