From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBF47C433E0 for ; Wed, 24 Jun 2020 21:18:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3F3C2081A for ; Wed, 24 Jun 2020 21:18:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dvKEppls" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3F3C2081A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 745F26E2D5; Wed, 24 Jun 2020 21:18:53 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84B8D6E2D5 for ; Wed, 24 Jun 2020 21:18:52 +0000 (UTC) Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F38FA2A8; Wed, 24 Jun 2020 23:18:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593033530; bh=NcYC22Tgplzt+QFJCY6b3NweU1WExHNM69P0i8o2K2k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dvKEpplsS2GMLBRJLS2cmP2KIV7Hea2BG8YeIbL7Xe7e9dAZQ5I+eSHbvBoGet6Ge AF6UWrpcT3C4BGI7k6OLnQ5vYXQXI/6BFwkF5UfnVXq2UKRnJG6dPsTADF75Sa2NkZ UmlobDvVCP4bnOlRzEVLj0BrouPHycCvF0ukgpyQ= Date: Thu, 25 Jun 2020 00:18:49 +0300 From: Laurent Pinchart To: Andrzej Hajda Subject: Re: [RESEND PATCH v5 5/5] drm/bridge: lvds-codec: simplify error handling code Message-ID: <20200624211849.GB29023@pendragon.ideasonboard.com> References: <20200624114127.3016-1-a.hajda@samsung.com> <20200624114127.3016-6-a.hajda@samsung.com> <20200624133312.GC5980@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andy.shevchenko@gmail.com, Jernej Skrabec , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, "open list:DRM DRIVERS" , Russell King - ARM Linux , Neil Armstrong , Jonas Karlman , Mark Brown , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Andrzej, On Wed, Jun 24, 2020 at 04:03:30PM +0200, Andrzej Hajda wrote: > On 24.06.2020 15:33, Laurent Pinchart wrote: > > On Wed, Jun 24, 2020 at 01:41:27PM +0200, Andrzej Hajda wrote: > >> Using probe_err code has following advantages: > >> - shorter code, > >> - recorded defer probe reason for debugging, > >> - uniform error code logging. > >> > >> Signed-off-by: Andrzej Hajda > >> --- > >> drivers/gpu/drm/bridge/lvds-codec.c | 9 ++------- > >> 1 file changed, 2 insertions(+), 7 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c > >> index 24fb1befdfa2..c76fa0239e39 100644 > >> --- a/drivers/gpu/drm/bridge/lvds-codec.c > >> +++ b/drivers/gpu/drm/bridge/lvds-codec.c > >> @@ -71,13 +71,8 @@ static int lvds_codec_probe(struct platform_device *pdev) > >> lvds_codec->connector_type = (uintptr_t)of_device_get_match_data(dev); > >> lvds_codec->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", > >> GPIOD_OUT_HIGH); > >> - if (IS_ERR(lvds_codec->powerdown_gpio)) { > >> - int err = PTR_ERR(lvds_codec->powerdown_gpio); > >> - > >> - if (err != -EPROBE_DEFER) > >> - dev_err(dev, "powerdown GPIO failure: %d\n", err); > >> - return err; > >> - } > >> + if (IS_ERR(lvds_codec->powerdown_gpio)) > >> + return probe_err(dev, lvds_codec->powerdown_gpio, "powerdown GPIO failure\n"); > > > > Line wrap please. > > I hoped that with latest checkpatch line length limit increase from 80 > to 100 it is acceptable :) but apparently not [1]. I'm all for using longer lines when that improves readability, but in this case I think it's easy enough to split the line. A longer line limit doesn't mean we're forced to generate longer lines :-) On a side note, I've been working on a C++ userspace project where we had to decide on a coding style. Line length was one parameter, and we went for a soft limit of 80 columns, and a hard limit of 120 columns. This works quite well so far. The only pain point is that clang-format (we use it, wrapped in a python script, to detect coding style violations) doesn't understand soft and hard limits for line lengths. > [1]: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144 > > > It bothers me that the common pattern of writing the error code at the > > end of the message isn't possible anymore. Maybe I'll get used to it, > > but it removes some flexibility. > > Yes, but it gives uniformity :) and now with %pe printk format it > changes anyway. > > >> /* Locate the panel DT node. */ > >> panel_node = of_graph_get_remote_node(dev->of_node, 1, 0); -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel