From patchwork Mon May 13 08:03:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2556821 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1C2B7DF2E5 for ; Mon, 13 May 2013 08:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752662Ab3EMIDp (ORCPT ); Mon, 13 May 2013 04:03:45 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:55079 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622Ab3EMIDo (ORCPT ); Mon, 13 May 2013 04:03:44 -0400 Received: by mail-bk0-f46.google.com with SMTP id my1so64814bkb.33 for ; Mon, 13 May 2013 01:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=vNT0K9rVn2sdGl9Cfe42Da2kQo0yMAV/ZZ/UkUmGbLw=; b=qIJ+PYNa0GlljypFz8blL+A3M390/Z59JK/pKi74Auaok53wCYeM4MMyB+RhWWTVT/ aDVYhR5hsz7LUEdl4wm38gQl5gZLXfFAXUvPNIOBQ+7FHT3H5IgLw3HLSC78TgdCSlzB ITodTX6cL4k+N3QWqUyOg6Ko5p7Ad6U6W3uSAz8KkgM+qitBhwjeFLsNw6OxsWVSJQd1 lTW94e6mWsavZSokYN8coF3pMvQ4EarJilWYJ7NKlVGWpvQHzsP2M84K8kOFMA6SQme/ dd0T9IrESPTDAqmC8u0722le2bq/cq9Rp0xhZLPYkaLZoTS85H1pS3pwsX1erXERPu6N hKUw== MIME-Version: 1.0 X-Received: by 10.205.38.3 with SMTP id tg3mr5198062bkb.66.1368432223241; Mon, 13 May 2013 01:03:43 -0700 (PDT) Received: by 10.204.199.129 with HTTP; Mon, 13 May 2013 01:03:43 -0700 (PDT) Date: Mon, 13 May 2013 16:03:43 +0800 Message-ID: Subject: [PATCH] cpufreq / intel_pstate: use vzalloc() instead of vmalloc()/memset(0) From: Wei Yongjun To: rjw@sisk.pl, viresh.kumar@linaro.org Cc: yongjun_wei@trendmicro.com.cn, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Wei Yongjun Use vzalloc() instead of vmalloc() and memset(0). Signed-off-by: Wei Yongjun Acked-by: Viresh Kumar Acked-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index cc3a8e6..f59aecb 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -788,10 +788,9 @@ static int __init intel_pstate_init(void) pr_info("Intel P-state driver initializing.\n"); - all_cpu_data = vmalloc(sizeof(void *) * num_possible_cpus()); + all_cpu_data = vzalloc(sizeof(void *) * num_possible_cpus()); if (!all_cpu_data) return -ENOMEM; - memset(all_cpu_data, 0, sizeof(void *) * num_possible_cpus()); rc = cpufreq_register_driver(&intel_pstate_driver); if (rc)