public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] cpufreq: s3c24xx: Delete an error message for a failed memory allocation in two functions
Date: Mon, 19 Feb 2018 09:14:54 +0530	[thread overview]
Message-ID: <20180219034454.GM28462@vireshk-i7> (raw)
In-Reply-To: <201722ce-019d-a5b4-fc00-74679d82b64f@users.sourceforge.net>

On 15-02-18, 17:40, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 15 Feb 2018 17:28:40 +0100
> 
> Omit an extra message for a memory allocation failure in these functions.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/cpufreq/s3c24xx-cpufreq.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
> index 7b596fa38ad2..024afd0b9458 100644
> --- a/drivers/cpufreq/s3c24xx-cpufreq.c
> +++ b/drivers/cpufreq/s3c24xx-cpufreq.c
> @@ -473,10 +473,8 @@ int __init s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
>  	 * initdata. */
>  
>  	ours = kzalloc(sizeof(*ours), GFP_KERNEL);
> -	if (ours == NULL) {
> -		pr_err("%s: no memory\n", __func__);
> +	if (!ours)
>  		return -ENOMEM;
> -	}
>  
>  	*ours = *board;
>  	cpu_cur.board = ours;
> @@ -562,10 +560,8 @@ static int s3c_cpufreq_build_freq(void)
>  	size++;
>  
>  	ftab = kzalloc(sizeof(*ftab) * size, GFP_KERNEL);
> -	if (!ftab) {
> -		pr_err("%s: no memory for tables\n", __func__);
> +	if (!ftab)
>  		return -ENOMEM;
> -	}
>  
>  	ftab_size = size;
>  

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

      reply	other threads:[~2018-02-19  3:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 16:40 [PATCH] cpufreq: s3c24xx: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2018-02-19  3:44 ` Viresh Kumar [this message]

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=20180219034454.GM28462@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox