Received: by 10.223.176.46 with SMTP id f43csp880574wra; Sat, 20 Jan 2018 06:37:41 -0800 (PST) X-Google-Smtp-Source: AH8x2243nBm7QDbEKxtWuUufQ99k+hSQhdZsqw79NrMdh021BtTAxTS8nPSAYGBiICs/wiscu2w+ X-Received: by 2002:a17:902:6b02:: with SMTP id o2-v6mr992281plk.248.1516459061705; Sat, 20 Jan 2018 06:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516459061; cv=none; d=google.com; s=arc-20160816; b=Pnf2C0ikGEgw0f5ZHd8Qwqwm1m4PgtLYa7trwx/hfk3H0f9uyusAzGF2v51nqXR9ku YYX17rQ3/VfgXjjwKuFRgYHu/znkMYxV94FuBuNsI31y2Yx+1L3roLsr2B2ZSOmsSYGD SijWoNbgUVABbpLrmzPYbOXv5wqaq3lBOoP5TXy2P92ZGfhwkCA8Sb7TUcMx6fu7gHMZ D+Dux2F7h9c+OMdBBjl+RFeynj+/NUNx607JmCj4VzFJdGv21Uw+g4/Kyi0c/Up2+eZc o1eE2McQefuFUBiebLmo2qLdJrLLZsClhxbJtISfsvwJza4Aihe1lfsdD9E6ih+ekSdy vT5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:arc-authentication-results; bh=hnuL75w80GR9toMjyuCAjW5I9rTosMD1qu5e1OUfjlM=; b=uINsk1ejEOSJN8eIdq7qFuIUaoTXJb00D6LBEfU5r9rSkjpFxNe6tUTKCH7SnrEUHI xjObVQ280km7gYoFigL+f6Bext6hYtiRoqse7zc/kcPauk/OB4Mx44PD63+Lam9gC04H 3gSrlst4WBVwmm5/2IwHsnUwg+EOG+5aDwcWkyqnPmQ7mHlXe9zLCL2fZm2vGbOrufPf qaCtKPvJmmcQpxAakEsODgH6gF3MY4xtz1UmvHKG6N/JlFXcbMmLnuvPEGSx0+c8wr// NyN2rHSE+Gctu+XWBEJEiY7+u8NfHzZTAVFiVU3PoosWRm8RhKK54QohjUaZlbY4eAdG 2wuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si10092470pgv.654.2018.01.20.06.37.27; Sat, 20 Jan 2018 06:37:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756189AbeATOg6 (ORCPT + 99 others); Sat, 20 Jan 2018 09:36:58 -0500 Received: from mout.web.de ([212.227.17.11]:55122 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753487AbeATOgt (ORCPT ); Sat, 20 Jan 2018 09:36:49 -0500 Received: from [192.168.1.3] ([77.182.145.92]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MduAD-1eSeps0gFJ-00Pfdh; Sat, 20 Jan 2018 15:36:29 +0100 To: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?B?SsO2cmcgUsO2ZGVs?= , Robin Murphy , Will Deacon Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] ARM-SMMU: Delete error messages for a failed memory allocation in three functions Message-ID: Date: Sat, 20 Jan 2018 15:36:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:sx78pDYv4AHAH6elw3LUSEVWJR1LHaB/NWe/XDtAyWILh1Wj8ur qGmsYNfueo0BurBA8kLB0nXTJ2tEi871NbvvpzOMg4L0lsI3jnFYCCqg0syZT2YcO5+ceMg bgqh3N06L3IpKBJ+eW3Oo48zJ2xEWpbctYgnXCh4Zg/HpwMgwWqUvKibtM0phwEJGQ7kDoO Em4pOmOo5kUlLECuYErFQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:TyP0aWqiHaI=:wU9zXU0M6emMH/WLonxPrX 42ck4RSa9EPIWnHzVE5AhKyw+xgj+uy2aso6TmPsjGzLcIq34rdXUxBRKMMTBJa+mj1Dq4X0s zNjjHOPW2MahtHJ5Iw2tvCBtkYLhqDfQjQO2lxo4yGbloMrrUlSHjTSkrjmH7I34HGCHrld6C iEyJUAKi3pB7mWb8SFDn3YTJZjLWYFp4qm4w2T6nEMWHMyjFDci/UUlmS6PmeYlYP3LhrUY8T lwO2fAfz91goXdhRvGCZqaz4xKr5WwrwijiTbwA6TF77B6Enmsc6B57qQDRn83OWTMSNdLQb0 dXWFjCwSU+grzzP9lQGGez50XFC+BpjJML2GT+gvz+L5qEKgh4M2I+0rd1lpqPPq0XeKBIYZK aCqcsqwloD3FPkFMwWSu7agBFNjOfdW45NL3LwGq2+kYKJ2MJMvqqqzt6gOYqK3+T+jaYdZ0d OMEuXiBS9JOatP+4aDdJiytm9+hTDIEmZ5BBBQOEGYXqIunEI4mlMxAPutXtJgt6luKgDSOhr pRBa7MSFYxNHzR9acVhUEDoYhWcKAUHH+pbDJX+KvRvdMX+ZrIFSn4j0tjl3DWM9zb/ufwbar DJTV0fvUp9ZE/Z3hpK0bXBq3rKGFkZKySJw7mRsEg0jLCLYDamQCl6LYHi5EBxmtVp5ksOIHP DvrFPrZgW2MSMKND1+Gv9Aczh7kLOoXjG+JHWBmiXloJU/kg4UROvR2ZBzVRuIRlJI38c8l8b vlxqtWW62JoqRvLjQp417KDg1lH/B3DiBOT+ofAfWUg28pJAoNmom+bDsBEoHXS0pmAnOzpBs ZNROsjolq7KU3lgmkIdz+AoGC51Ev98UYg1W4ItJqQBy4e2Uk0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Sat, 20 Jan 2018 15:30:17 +0100 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/iommu/arm-smmu-v3.c | 9 +++------ drivers/iommu/arm-smmu.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index f122071688fd..5c2a7103d494 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -2134,10 +2134,8 @@ static int arm_smmu_init_l1_strtab(struct arm_smmu_device *smmu) void *strtab = smmu->strtab_cfg.strtab; cfg->l1_desc = devm_kzalloc(smmu->dev, size, GFP_KERNEL); - if (!cfg->l1_desc) { - dev_err(smmu->dev, "failed to allocate l1 stream table desc\n"); + if (!cfg->l1_desc) return -ENOMEM; - } for (i = 0; i < cfg->num_l1_ents; ++i) { arm_smmu_write_strtab_l1_desc(strtab, &cfg->l1_desc[i]); @@ -2828,10 +2826,9 @@ static int arm_smmu_device_probe(struct platform_device *pdev) bool bypass; smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL); - if (!smmu) { - dev_err(dev, "failed to allocate arm_smmu_device\n"); + if (!smmu) return -ENOMEM; - } + smmu->dev = dev; if (dev->of_node) { diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 78d4c6b8f1ba..a4da4a870a2e 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2048,10 +2048,9 @@ static int arm_smmu_device_probe(struct platform_device *pdev) int num_irqs, i, err; smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL); - if (!smmu) { - dev_err(dev, "failed to allocate arm_smmu_device\n"); + if (!smmu) return -ENOMEM; - } + smmu->dev = dev; if (dev->of_node) @@ -2084,10 +2083,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev) smmu->irqs = devm_kzalloc(dev, sizeof(*smmu->irqs) * num_irqs, GFP_KERNEL); - if (!smmu->irqs) { - dev_err(dev, "failed to allocate %d irqs\n", num_irqs); + if (!smmu->irqs) return -ENOMEM; - } for (i = 0; i < num_irqs; ++i) { int irq = platform_get_irq(pdev, i); -- 2.15.1