From: SF Markus Elfring <elfring@users.sourceforge.net>
To: iommu@lists.linux-foundation.org, linux-tegra@vger.kernel.org,
"Hiroshi Doyu" <hdoyu@nvidia.com>, "Jörg Rödel" <joro@8bytes.org>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Thierry Reding" <thierry.reding@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] IOMMU-Tegra: gart: Delete two error messages for a failed memory allocation in tegra_gart_probe()
Date: Fri, 19 Jan 2018 21:50:56 +0100 [thread overview]
Message-ID: <faa84bc9-d663-f0ea-4f62-40b853c0212b@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 19 Jan 2018 21:44:31 +0100
Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/iommu/tegra-gart.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index b62f790ad1ba..1fee3a956832 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -419,10 +419,8 @@ static int tegra_gart_probe(struct platform_device *pdev)
}
gart = devm_kzalloc(dev, sizeof(*gart), GFP_KERNEL);
- if (!gart) {
- dev_err(dev, "failed to allocate gart_device\n");
+ if (!gart)
return -ENOMEM;
- }
gart_regs = devm_ioremap(dev, res->start, resource_size(res));
if (!gart_regs) {
@@ -455,10 +453,8 @@ static int tegra_gart_probe(struct platform_device *pdev)
gart->page_count = (resource_size(res_remap) >> GART_PAGE_SHIFT);
gart->savedata = vmalloc(sizeof(u32) * gart->page_count);
- if (!gart->savedata) {
- dev_err(dev, "failed to allocate context save area\n");
+ if (!gart->savedata)
return -ENOMEM;
- }
platform_set_drvdata(pdev, gart);
do_gart_setup(gart, NULL);
--
2.15.1
reply other threads:[~2018-01-19 20:51 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=faa84bc9-d663-f0ea-4f62-40b853c0212b@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=hdoyu@nvidia.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.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).