cpufreq: s3c24xx: Drop memory allocation error messages from two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 15 Feb 2018 16:28:40 +0000 (17:28 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 27 Feb 2018 17:29:01 +0000 (18:29 +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>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/s3c24xx-cpufreq.c

index 7b596fa38ad2de4b7d9cf075ce69a876b4f2e35f..024afd0b945822722b478198e22a2a0d1a689833 100644 (file)
@@ -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;