From: zhong jiang <zhongjiang@huawei.com>
To: <tony.luck@intel.com>, <fenghua.yu@intel.com>
Cc: <linux-ia64@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] ia64:tioce_provider: Use kmemdup rather than implement the function
Date: Fri, 10 Aug 2018 10:38:50 +0800 [thread overview]
Message-ID: <1533868730-65425-1-git-send-email-zhongjiang@huawei.com> (raw)
The kmemdup has implemented the function that kmalloc() + memcpy will
do. So just replace them to make the code concise.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
arch/ia64/sn/pci/tioce_provider.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index 3bd9abc..9ba61bc 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -1000,11 +1000,11 @@
* Allocate kernel bus soft and copy from prom.
*/
- tioce_common = kzalloc(sizeof(struct tioce_common), GFP_KERNEL);
+ tioce_common = kmemdup(prom_bussoft, sizeof(struct tioce_common),
+ GFP_KERNEL);
if (!tioce_common)
return NULL;
- memcpy(tioce_common, prom_bussoft, sizeof(struct tioce_common));
tioce_common->ce_pcibus.bs_base = (unsigned long)
ioremap(REGION_OFFSET(tioce_common->ce_pcibus.bs_base),
sizeof(struct tioce_common));
--
1.7.12.4
reply other threads:[~2018-08-10 2:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1533868730-65425-1-git-send-email-zhongjiang@huawei.com \
--to=zhongjiang@huawei.com \
--cc=fenghua.yu@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).