From patchwork Wed Mar 1 19:13:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 63042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3819556wrd; Wed, 1 Mar 2023 11:19:08 -0800 (PST) X-Google-Smtp-Source: AK7set/CShyqy09dCy8C8I9H6ScSDYAE52S9SZYWKHoLyFc8U2zvZXf1ANzniZpgP5zlRLz5E3L2 X-Received: by 2002:a17:907:a427:b0:8ab:a378:5f96 with SMTP id sg39-20020a170907a42700b008aba3785f96mr19776166ejc.3.1677698348517; Wed, 01 Mar 2023 11:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677698348; cv=none; d=google.com; s=arc-20160816; b=xKwa1t5msNZ+FTyDz/73V/v6g7/+P79ip010O4TaLZT1Zl/1+nR+2PAsad4NJbtjfU oTVLJIqK05MB5biErcMx+lzn6xLQsyZt5103EoZDMXB1bMxU4hIPGObN2xidWRfW3Rro abgrAzwmXqp66qmfrc1VYfozjoGR7qKyGMIB4Ys5s61ASpjVqJgptM4WdscSrWrqsNRc 3qLRVIsFqyLNFO0Rjh7tj8oc4x4waaewDRfKNP1uQphRnTYIMf4nmi0aKPGAQLoamWPN 97PoRQyAwHE70j7/v/zNjMfRJt4xhseIa41aW257tdzfGFWvNIKVdFVv7jNREggJZzpD 1QbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=t0TTXJbpMYZZi6FvHNo1ClFEbjCHzqRvo5PqqKCKW+M=; b=rd4GsWdIRyzfWt9tKYve7/sKfPpzyQYoyBZrpZ1fS6FwqIUdFmB3oOnAur16UhtaYl Q+sKXfdaWbp2wuuliC0Vi8OqmGXNaqv7K93QC1tQDbU76dA4sp5m6a/j3L7OBYowst/y IH2SsVQoy22S+tebTWPbTU9avYFqoi48nv1VEdejkRiVEexDKJgMCzX7dZUwJm+llJGs RftR0+8onN9Co8P9+xAyPTNcS2hMBUAhiDfoLNnjqm7oMV+8nHW/ZOHMD7rqO18iZFDE oyAGh6cw7qj+FRxLTDXLydnef+lF+HTCSPup5Pdf7L+mRVcDeD6adF5N5uhyTLji3MFk rwDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=CZLsHMAv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a056402088a00b004acbe54c9a1si2109954edy.546.2023.03.01.11.18.45; Wed, 01 Mar 2023 11:19:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=CZLsHMAv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbjCATOJ (ORCPT + 99 others); Wed, 1 Mar 2023 14:14:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbjCATOF (ORCPT ); Wed, 1 Mar 2023 14:14:05 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F63534015 for ; Wed, 1 Mar 2023 11:14:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1677698016; bh=eiqwtvnYck/1m0Yt7lMi6q3bdq0fyTlM8ZfdFltVRKE=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=CZLsHMAvNLBb93M64IRDSf/cIlL4QL96uIS2CGixwUwaJGSu011oomSy5JdyIn/0U YlKL1Mmgv/cbOEksgYf98K+5V53GuJwqy6DmSR1fEc5yzGPxgbFkmG+6m4jOYg0rTd xAnwRD4bEELhbIYlIv2K+IIiwn6mRdCBDQqSD64E= Received: by b221-1.in.mailobj.net [192.168.90.21] with ESMTP via ip-20.mailobj.net [213.182.54.20] Wed, 1 Mar 2023 20:13:36 +0100 (CET) X-EA-Auth: TSRsA2wbeBLpAiKN+cBrdG6+KjuRR4juq/RVwwPYl8JecVpgVWmrqxQWw9+/Q/F6wEJuDNSSKxR6LQt6f1rC4tfBn71YFHgx Date: Thu, 2 Mar 2023 00:43:31 +0530 From: Deepak R Varma To: Dinh Nguyen , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , pk.drv@ubun2204.myguest.virtualbox.org Subject: [PATCH RESEND] EDAC/altera: Remove redundant error logging Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759194223191747287?= X-GMAIL-MSGID: =?utf-8?q?1759194223191747287?= A call to platform_get_irq() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces unnecessary. Remove that as well. Issue identified using platform_get_irq.cocci coccinelle semantic patch. Signed-off-by: Deepak R Varma --- Note: The change was compile tested only. Resending the patch for a review and feedback. drivers/edac/altera_edac.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index e7e8e624a436..72fa49c44360 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -2149,10 +2149,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev) } edac->sb_irq = platform_get_irq(pdev, 0); - if (edac->sb_irq < 0) { - dev_err(&pdev->dev, "No SBERR IRQ resource\n"); + if (edac->sb_irq < 0) return edac->sb_irq; - } irq_set_chained_handler_and_data(edac->sb_irq, altr_edac_a10_irq_handler, @@ -2184,10 +2182,9 @@ static int altr_edac_a10_probe(struct platform_device *pdev) } #else edac->db_irq = platform_get_irq(pdev, 1); - if (edac->db_irq < 0) { - dev_err(&pdev->dev, "No DBERR IRQ resource\n"); + if (edac->db_irq < 0) return edac->db_irq; - } + irq_set_chained_handler_and_data(edac->db_irq, altr_edac_a10_irq_handler, edac); #endif