From patchwork Tue Jan 20 10:09:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Medve X-Patchwork-Id: 430964 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6E74B1402D9 for ; Tue, 20 Jan 2015 21:28:39 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 4D9A61A133D for ; Tue, 20 Jan 2015 21:28:39 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bbn0105.outbound.protection.outlook.com [157.56.111.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 7F6D31A083B for ; Tue, 20 Jan 2015 21:27:58 +1100 (AEDT) Received: from DM2PR0301MB0735.namprd03.prod.outlook.com (25.160.97.143) by DM2PR0301MB1231.namprd03.prod.outlook.com (25.160.219.20) with Microsoft SMTP Server (TLS) id 15.1.59.20; Tue, 20 Jan 2015 10:13:19 +0000 Received: from BN3PR0301CA0036.namprd03.prod.outlook.com (25.160.180.174) by DM2PR0301MB0735.namprd03.prod.outlook.com (25.160.97.143) with Microsoft SMTP Server (TLS) id 15.1.59.20; Tue, 20 Jan 2015 10:13:18 +0000 Received: from BY2FFO11FD048.protection.gbl (2a01:111:f400:7c0c::198) by BN3PR0301CA0036.outlook.office365.com (2a01:111:e400:4000::46) with Microsoft SMTP Server (TLS) id 15.1.59.20 via Frontend Transport; Tue, 20 Jan 2015 10:13:18 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD048.mail.protection.outlook.com (10.1.15.176) with Microsoft SMTP Server (TLS) id 15.1.59.14 via Frontend Transport; Tue, 20 Jan 2015 10:13:17 +0000 Received: from right.am.freescale.net (right.am.freescale.net [10.81.116.70]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t0KADDnA011345; Tue, 20 Jan 2015 03:13:17 -0700 From: Emil Medve To: , , , , Subject: [PATCH 4/8] clk: ppc-corenet: Fix checkpatch type OOM_MESSAGE Date: Tue, 20 Jan 2015 04:09:26 -0600 Message-ID: <1421748570-14282-5-git-send-email-Emilian.Medve@Freescale.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1421748570-14282-1-git-send-email-Emilian.Medve@Freescale.com> References: <1421748570-14282-1-git-send-email-Emilian.Medve@Freescale.com> X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Emilian.Medve@freescale.com; X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(199003)(189002)(62966003)(77156002)(2201001)(50986999)(76176999)(77096005)(68736005)(47776003)(92566002)(64706001)(104016003)(36756003)(2950100001)(50226001)(46102003)(81156004)(106466001)(105606002)(97736003)(6806004)(86362001)(48376002)(87936001)(50466002)(229853001)(69596002)(19580405001)(19580395003)(85426001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0735; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005004);SRVR:DM2PR0301MB0735; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:DM2PR0301MB0735; X-Forefront-PRVS: 0462918D61 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0735; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2015 10:13:17.8301 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0735 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1231; X-OriginatorOrg: freescale.com Cc: Emil Medve X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message + if (!parent_names) { + pr_err("%s: could not allocate parent_names\n", __func__); WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message + if (!cmux_clk) { + pr_err("%s: could not allocate cmux_clk\n", __func__); WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message + if (!subclks) { + pr_err("%s: could not allocate subclks\n", __func__); WARNING:OOM_MESSAGE: Possible unnecessary 'out of memory' message + if (!onecell_data) { + pr_err("%s: could not allocate onecell_data\n", __func__); Signed-off-by: Emil Medve --- drivers/clk/clk-ppc-corenet.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-ppc-corenet.c index a439f52..6a9dbaa 100644 --- a/drivers/clk/clk-ppc-corenet.c +++ b/drivers/clk/clk-ppc-corenet.c @@ -86,19 +86,16 @@ static void __init core_mux_init(struct device_node *np) return; } parent_names = kcalloc(count, sizeof(char *), GFP_KERNEL); - if (!parent_names) { - pr_err("%s: could not allocate parent_names\n", __func__); + if (!parent_names) return; - } for (i = 0; i < count; i++) parent_names[i] = of_clk_get_parent_name(np, i); cmux_clk = kzalloc(sizeof(*cmux_clk), GFP_KERNEL); - if (!cmux_clk) { - pr_err("%s: could not allocate cmux_clk\n", __func__); + if (!cmux_clk) goto err_name; - } + cmux_clk->reg = of_iomap(np, 0); if (!cmux_clk->reg) { pr_err("%s: could not map register\n", __func__); @@ -185,16 +182,12 @@ static void __init core_pll_init(struct device_node *np) clocks_per_pll = count; subclks = kcalloc(count, sizeof(struct clk *), GFP_KERNEL); - if (!subclks) { - pr_err("%s: could not allocate subclks\n", __func__); + if (!subclks) goto err_map; - } onecell_data = kzalloc(sizeof(*onecell_data), GFP_KERNEL); - if (!onecell_data) { - pr_err("%s: could not allocate onecell_data\n", __func__); + if (!onecell_data) goto err_clks; - } for (i = 0; i < count; i++) { rc = of_property_read_string_index(np, "clock-output-names",