Browse Source

cpufreq: s3c24xx: Drop memory allocation error messages from two functions

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>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Markus Elfring 7 years ago
parent
commit
d430fb9984
1 changed files with 2 additions and 6 deletions
  1. 2 6
      drivers/cpufreq/s3c24xx-cpufreq.c

+ 2 - 6
drivers/cpufreq/s3c24xx-cpufreq.c

@@ -473,10 +473,8 @@ int __init s3c_cpufreq_setboard(struct s3c_cpufreq_board *board)
 	 * initdata. */
 	 * initdata. */
 
 
 	ours = kzalloc(sizeof(*ours), GFP_KERNEL);
 	ours = kzalloc(sizeof(*ours), GFP_KERNEL);
-	if (ours == NULL) {
-		pr_err("%s: no memory\n", __func__);
+	if (!ours)
 		return -ENOMEM;
 		return -ENOMEM;
-	}
 
 
 	*ours = *board;
 	*ours = *board;
 	cpu_cur.board = ours;
 	cpu_cur.board = ours;
@@ -562,10 +560,8 @@ static int s3c_cpufreq_build_freq(void)
 	size++;
 	size++;
 
 
 	ftab = kzalloc(sizeof(*ftab) * size, GFP_KERNEL);
 	ftab = kzalloc(sizeof(*ftab) * size, GFP_KERNEL);
-	if (!ftab) {
-		pr_err("%s: no memory for tables\n", __func__);
+	if (!ftab)
 		return -ENOMEM;
 		return -ENOMEM;
-	}
 
 
 	ftab_size = size;
 	ftab_size = size;