Message ID | Y5XhPJ39ipMCcctq@qemulion |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1780416wrr; Sun, 11 Dec 2022 06:05:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf58LRHHIzzmitJ7EG9HfKCQrjZ5K8bPE9ml5wDBwfMF9vB/kwwNx1owh4HAvjV/ne26r1lz X-Received: by 2002:a17:906:5f82:b0:7c0:dac7:36ea with SMTP id a2-20020a1709065f8200b007c0dac736eamr10839210eju.66.1670767554025; Sun, 11 Dec 2022 06:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670767554; cv=none; d=google.com; s=arc-20160816; b=Rj269FVpcP8gpR3KfeN6VDlEnXNddEuTOQ5sY201G9PEo8AuyKgN63AKSL12FWT06s M2mKielfqtDJvSkHEGz9Ie5Km8G4MXTWPIP4SzYonkoICiW7dBWIZ3TCp5NAXnzPNWEK 1GEiGyzR1yrOcUpwPyj5uhTxd+GMyz8V6TkiOH0P/8WcDADZ6WjpyVjWPMKCyrfG8YSl cBwGv0elZBhfZ2r9JNPghrg2jTUAsubN/EgsHzOrSzAYKBr8dFqQabYumiXvqU02XMLt SzsQs+Q/RACRoA60PIKlYe99/0OunHVGr/d8ZU7hJdf2vg/KsfScvwW6GauyVS/OumcD Vwjw== 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=Z3aLbqmT/nbwosbVma9CyWWzC4rITcyhzveYgD0OWXM=; b=i082+LBSVazDgPoUjal2I0e5SNRTrYO7HuK8MgXQz8xSxqWb5Vp08Vd8LKPfkIFbSn rm5C1zQaxHazLdhjs2zIFQgi2QCCBSuax2mK7ijX1TSe1ouOOHsJHmAWsCC4O/S4+iDr rptOucUzm708jkaVbt5N4cBviDlE/fT9pI9lu0wAciJyp2Assj7vlgJAqzoUfJzvmhsJ ST6pl5pn0RmW1/WLaFsv+t8MaqiUVDMUe9eBTnuvxOkYC20Fml79GGOPpOB21PjiuvbF JnyYrjibWQfg97sYFwB40yXZYG2MOj/SMIqTDibKHlVhOXmt5+sEIFXcgNQj2jip8IQc 82pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Lw7qSXIe; 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 qb42-20020a1709077eaa00b007c08578ed86si5105926ejc.960.2022.12.11.06.05.27; Sun, 11 Dec 2022 06:05:53 -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=Lw7qSXIe; 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 S230080AbiLKNz2 (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Sun, 11 Dec 2022 08:55:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiLKNz1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 11 Dec 2022 08:55:27 -0500 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280BDBE0F for <linux-kernel@vger.kernel.org>; Sun, 11 Dec 2022 05:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1670766913; bh=xq+tOsyd0WnEBYZsDftkiZ/K0hXxhKqmak3ozClnAhA=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=Lw7qSXIeqY0zeGmSKrp3dOZ2ty0Y08YgUu/NU5OcVnZmRzmnrbv3QgL2NPJrD69rM zqjp4YLX3kM8FyRwyTwpBfS+vT/ECHRIHWCBGJhzXIk0YPdsMGeM0+icZpxRXX6Lnw dDZZujg51h0XESzbuOdd96640l5W2EFTrqla60nI= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 11 Dec 2022 14:55:13 +0100 (CET) X-EA-Auth: 1vJpOd6xvyZUc0g7UMKSJAb/DUIrntROzP0Ci/lss0NuJBvm6qAzgGmuTPxapEaAUk3yo/Bjo0fCa7hkbNJRkqgJMiaiOOVj Date: Sun, 11 Dec 2022 19:25:08 +0530 From: Deepak R Varma <drv@mailo.com> To: David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Orson Zhai <orsonzhai@gmail.com>, Baolin Wang <baolin.wang@linux.alibaba.com>, Chunyan Zhang <zhang.lyra@gmail.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, drv@mailo.com Subject: [PATCH] drm/sprd: remove redundant error logging Message-ID: <Y5XhPJ39ipMCcctq@qemulion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751926758483312171?= X-GMAIL-MSGID: =?utf-8?q?1751926758483312171?= |
Series |
drm/sprd: remove redundant error logging
|
|
Commit Message
Deepak R Varma
Dec. 11, 2022, 1:55 p.m. UTC
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 coccicheck script.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
drivers/gpu/drm/sprd/sprd_dpu.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--
2.34.1
Comments
On Sun, Dec 11, 2022 at 07:25:08PM +0530, Deepak R Varma wrote: Hello, May I please request a review and feedback on this patch proposal? Thank you, ./drv > 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 coccicheck script. > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- > drivers/gpu/drm/sprd/sprd_dpu.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c > index 88f4259680f1..db0bcea1d9f4 100644 > --- a/drivers/gpu/drm/sprd/sprd_dpu.c > +++ b/drivers/gpu/drm/sprd/sprd_dpu.c > @@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu, > } > > ctx->irq = platform_get_irq(pdev, 0); > - if (ctx->irq < 0) { > - dev_err(dev, "failed to get dpu irq\n"); > + if (ctx->irq < 0) > return ctx->irq; > - } > > /* disable and clear interrupts before register dpu IRQ. */ > writel(0x00, ctx->base + REG_DPU_INT_EN); > -- > 2.34.1 >
Hi Am 19.12.22 um 21:55 schrieb Deepak R Varma: > On Sun, Dec 11, 2022 at 07:25:08PM +0530, Deepak R Varma wrote: > > Hello, > May I please request a review and feedback on this patch proposal? Added to drm-misc-next. Thanks for the patch. Best regards Thomas > > Thank you, > ./drv > >> 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 coccicheck script. >> >> Signed-off-by: Deepak R Varma <drv@mailo.com> >> --- >> drivers/gpu/drm/sprd/sprd_dpu.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c >> index 88f4259680f1..db0bcea1d9f4 100644 >> --- a/drivers/gpu/drm/sprd/sprd_dpu.c >> +++ b/drivers/gpu/drm/sprd/sprd_dpu.c >> @@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu, >> } >> >> ctx->irq = platform_get_irq(pdev, 0); >> - if (ctx->irq < 0) { >> - dev_err(dev, "failed to get dpu irq\n"); >> + if (ctx->irq < 0) >> return ctx->irq; >> - } >> >> /* disable and clear interrupts before register dpu IRQ. */ >> writel(0x00, ctx->base + REG_DPU_INT_EN); >> -- >> 2.34.1 >> > > -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
On Sun, 11 Dec 2022 at 21:55, Deepak R Varma <drv@mailo.com> wrote: > > 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 coccicheck script. > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- > drivers/gpu/drm/sprd/sprd_dpu.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c > index 88f4259680f1..db0bcea1d9f4 100644 > --- a/drivers/gpu/drm/sprd/sprd_dpu.c > +++ b/drivers/gpu/drm/sprd/sprd_dpu.c > @@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu, > } > > ctx->irq = platform_get_irq(pdev, 0); > - if (ctx->irq < 0) { > - dev_err(dev, "failed to get dpu irq\n"); > + if (ctx->irq < 0) Thanks for the patch, it makes sense to me, so Acked-by: Chunyan Zhang <zhang.lyra@gmail.com> > return ctx->irq; > - } > > /* disable and clear interrupts before register dpu IRQ. */ > writel(0x00, ctx->base + REG_DPU_INT_EN); > -- > 2.34.1 > > >
diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c index 88f4259680f1..db0bcea1d9f4 100644 --- a/drivers/gpu/drm/sprd/sprd_dpu.c +++ b/drivers/gpu/drm/sprd/sprd_dpu.c @@ -803,10 +803,8 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu, } ctx->irq = platform_get_irq(pdev, 0); - if (ctx->irq < 0) { - dev_err(dev, "failed to get dpu irq\n"); + if (ctx->irq < 0) return ctx->irq; - } /* disable and clear interrupts before register dpu IRQ. */ writel(0x00, ctx->base + REG_DPU_INT_EN);