Message ID | 20210511121856.5996-1-thunder.leizhen@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/1] EDAC, mellanox: Remove redundant error printing in bluefield_edac_mc_probe() | expand |
On Tue, May 11, 2021 at 08:18:56PM +0800, Zhen Lei wrote: > When devm_ioremap_resource() fails, a clear enough error message will be > printed by its subfunction __devm_ioremap_resource(). In every possible failure case or is there a case where an error won't be printed and keeping the dev_err() in the driver doesn't hurt at all?
On 2021/5/31 23:05, Borislav Petkov wrote: > On Tue, May 11, 2021 at 08:18:56PM +0800, Zhen Lei wrote: >> When devm_ioremap_resource() fails, a clear enough error message will be >> printed by its subfunction __devm_ioremap_resource(). > > In every possible failure case or is there a case where an error won't > be printed and keeping the dev_err() in the driver doesn't hurt at all? I had sent a patch for the missing case in __devm_ioremap_resource(), but it seems I was wrong. Please refer to: https://lkml.org/lkml/2021/5/17/95 >
diff --git a/drivers/edac/bluefield_edac.c b/drivers/edac/bluefield_edac.c index e4736eb37bfb33d..962d9f889923820 100644 --- a/drivers/edac/bluefield_edac.c +++ b/drivers/edac/bluefield_edac.c @@ -283,7 +283,6 @@ static int bluefield_edac_mc_probe(struct platform_device *pdev) priv->dimm_per_mc = dimm_count; priv->emi_base = devm_ioremap_resource(dev, emi_res); if (IS_ERR(priv->emi_base)) { - dev_err(dev, "failed to map EMI IO resource\n"); ret = PTR_ERR(priv->emi_base); goto err; }
When devm_ioremap_resource() fails, a clear enough error message will be printed by its subfunction __devm_ioremap_resource(). The error information contains the device name, failure cause, and possibly resource information. Therefore, remove the error printing here to simplify code and reduce the binary size. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> --- drivers/edac/bluefield_edac.c | 1 - 1 file changed, 1 deletion(-)