From patchwork Fri Jun 25 21:46:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 108148 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5PLkmMa016657 for ; Fri, 25 Jun 2010 21:46:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932173Ab0FYVqr (ORCPT ); Fri, 25 Jun 2010 17:46:47 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:53627 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088Ab0FYVqq (ORCPT ); Fri, 25 Jun 2010 17:46:46 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o5PLkjLL002641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Jun 2010 16:46:45 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o5PLkgWb021230; Fri, 25 Jun 2010 16:46:43 -0500 (CDT) Received: from senorita (senorita.am.dhcp.ti.com [128.247.74.250]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o5PLkgP15922; Fri, 25 Jun 2010 16:46:42 -0500 (CDT) Received: by senorita (Postfix, from userid 1000) id 93CADC253; Fri, 25 Jun 2010 16:46:41 -0500 (CDT) From: Nishanth Menon To: linux-omap Cc: Nishanth Menon , Kevin Hilman , Thara Gopinath Subject: [PM-SR] [PATCH 5/7] omap3: sr: device: add unlikely checks Date: Fri, 25 Jun 2010 16:46:38 -0500 Message-Id: <1277502400-9915-6-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1277502400-9915-1-git-send-email-nm@ti.com> References: <1277502400-9915-1-git-send-email-nm@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 25 Jun 2010 21:46:49 +0000 (UTC) diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index 7d13704..177299a 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c @@ -43,8 +43,9 @@ static void __init sr_read_efuse(struct omap_sr_dev_data *dev_data, { int i; - if (!dev_data || !dev_data->volts_supported || !dev_data->volt_data || - !dev_data->efuse_nvalues_offs) { + if (unlikely(!dev_data || !dev_data->volts_supported || + !dev_data->volt_data || + !dev_data->efuse_nvalues_offs)) { pr_warning("%s: Bad parameters! dev_data = %x," "dev_data->volts_supported = %x," "dev_data->volt_data = %x," @@ -87,8 +88,8 @@ static void __init sr_set_testing_nvalues(struct omap_sr_dev_data *dev_data, { int i; - if (!dev_data || !dev_data->volts_supported || - !dev_data->volt_data || !dev_data->test_nvalues) { + if (unlikely(!dev_data || !dev_data->volts_supported || + !dev_data->volt_data || !dev_data->test_nvalues)) { pr_warning("%s: Bad parameters! dev_data = %x," "dev_data->volts_supported = %x," "dev_data->volt_data = %x," @@ -123,7 +124,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) static int i; sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL); - if (!sr_data) { + if (unlikely(!sr_data)) { pr_err("%s: Unable to allocate memory for %s sr_data.Error!\n", __func__, oh->name); return -ENOMEM; @@ -150,7 +151,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) sr_data->device_idle = omap_device_idle; sr_dev_data->volts_supported = omap_get_voltage_table(i, &sr_dev_data->volt_data); - if (!sr_dev_data->volts_supported) { + if (unlikely(!sr_dev_data->volts_supported)) { pr_warning("%s: No Voltage table registerd fo VDD%d. " "Something is really wrong\n", __func__, i + 1); @@ -162,7 +163,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data), omap_sr_latency, ARRAY_SIZE(omap_sr_latency), 0); - if (IS_ERR(od)) { + if (unlikely(IS_ERR(od))) { pr_warning("%s: Could not build omap_device for %s: %s.\n\n", __func__, name, oh->name); kfree(sr_data);