All of lore.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-clk@vger.kernel.org,
	Jiancheng Xue <xuejiancheng@hisilicon.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 2/6] clk: hisilicon: Delete error messages for failed memory allocations in hisi_clk_init()
Date: Tue, 18 Apr 2017 09:39:16 +0000	[thread overview]
Message-ID: <362845e2-00da-9631-a049-1a53749a1fcf@users.sourceforge.net> (raw)
In-Reply-To: <7a649967-8ff1-8682-2f87-43871172fc28@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 18 Apr 2017 10:12:32 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/clk/hisilicon/clk.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
index 9268e80b7566..eca4c66e316c 100644
--- a/drivers/clk/hisilicon/clk.c
+++ b/drivers/clk/hisilicon/clk.c
@@ -80,16 +80,14 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np,
 	}
 
 	clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
-	if (!clk_data) {
-		pr_err("%s: could not allocate clock data\n", __func__);
+	if (!clk_data)
 		goto err;
-	}
+
 	clk_data->base = base;
 	clk_table = kcalloc(nr_clks, sizeof(*clk_table), GFP_KERNEL);
-	if (!clk_table) {
-		pr_err("%s: could not allocate clock lookup table\n", __func__);
+	if (!clk_table)
 		goto err_data;
-	}
+
 	clk_data->clk_data.clks = clk_table;
 	clk_data->clk_data.clk_num = nr_clks;
 	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data->clk_data);
-- 
2.12.2


WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-clk@vger.kernel.org,
	Jiancheng Xue <xuejiancheng@hisilicon.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 2/6] clk: hisilicon: Delete error messages for failed memory allocations in hisi_clk_init()
Date: Tue, 18 Apr 2017 11:39:16 +0200	[thread overview]
Message-ID: <362845e2-00da-9631-a049-1a53749a1fcf@users.sourceforge.net> (raw)
In-Reply-To: <7a649967-8ff1-8682-2f87-43871172fc28@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 18 Apr 2017 10:12:32 +0200

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/clk/hisilicon/clk.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
index 9268e80b7566..eca4c66e316c 100644
--- a/drivers/clk/hisilicon/clk.c
+++ b/drivers/clk/hisilicon/clk.c
@@ -80,16 +80,14 @@ struct hisi_clock_data *hisi_clk_init(struct device_node *np,
 	}
 
 	clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
-	if (!clk_data) {
-		pr_err("%s: could not allocate clock data\n", __func__);
+	if (!clk_data)
 		goto err;
-	}
+
 	clk_data->base = base;
 	clk_table = kcalloc(nr_clks, sizeof(*clk_table), GFP_KERNEL);
-	if (!clk_table) {
-		pr_err("%s: could not allocate clock lookup table\n", __func__);
+	if (!clk_table)
 		goto err_data;
-	}
+
 	clk_data->clk_data.clks = clk_table;
 	clk_data->clk_data.clk_num = nr_clks;
 	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data->clk_data);
-- 
2.12.2

  parent reply	other threads:[~2017-04-18  9:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  9:34 [PATCH 0/6] clk-Hisilicon: Fine-tuning for some function implementations SF Markus Elfring
2017-04-18  9:34 ` SF Markus Elfring
2017-04-18  9:37 ` [PATCH 1/6] clk: hisilicon: Use kcalloc() in hisi_clk_init() SF Markus Elfring
2017-04-18  9:37   ` SF Markus Elfring
2017-04-19 18:31   ` Stephen Boyd
2017-04-19 18:31     ` Stephen Boyd
2017-04-18  9:39 ` SF Markus Elfring [this message]
2017-04-18  9:39   ` [PATCH 2/6] clk: hisilicon: Delete error messages for failed memory allocations " SF Markus Elfring
2017-04-19 18:31   ` [PATCH 2/6] clk: hisilicon: Delete error messages for failed memory allocations in hisi_clk_init Stephen Boyd
2017-04-19 18:31     ` [PATCH 2/6] clk: hisilicon: Delete error messages for failed memory allocations in hisi_clk_init() Stephen Boyd
2017-04-18  9:40 ` [PATCH 3/6] clk: hisilicon: Use devm_kmalloc_array() in hisi_clk_alloc() SF Markus Elfring
2017-04-18  9:40   ` SF Markus Elfring
2017-04-19 18:31   ` Stephen Boyd
2017-04-19 18:31     ` Stephen Boyd
2017-04-18  9:41 ` [PATCH 4/6] clk: hi3620: Use kcalloc() in hi3620_mmc_clk_init() SF Markus Elfring
2017-04-18  9:41   ` SF Markus Elfring
2017-04-19 18:31   ` Stephen Boyd
2017-04-19 18:31     ` Stephen Boyd
2017-04-18  9:43 ` [PATCH 5/6] clk: hi3620: Delete error messages for a failed memory allocation in two functions SF Markus Elfring
2017-04-18  9:43   ` SF Markus Elfring
2017-04-19 18:31   ` Stephen Boyd
2017-04-19 18:31     ` Stephen Boyd
2017-04-18  9:44 ` [PATCH 6/6] clk: hi3620: Fix a typo in one variable name SF Markus Elfring
2017-04-18  9:44   ` SF Markus Elfring
2017-04-19 18:31   ` Stephen Boyd
2017-04-19 18:31     ` Stephen Boyd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=362845e2-00da-9631-a049-1a53749a1fcf@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    --cc=wsa@the-dreams.de \
    --cc=xuejiancheng@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.