From patchwork Tue Sep 6 13:17:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 75512 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp544668qgf; Tue, 6 Sep 2016 06:18:41 -0700 (PDT) X-Received: by 10.194.235.69 with SMTP id uk5mr35637273wjc.53.1473167912000; Tue, 06 Sep 2016 06:18:32 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id h6si28430849wja.135.2016.09.06.06.18.31; Tue, 06 Sep 2016 06:18:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F0863A752D; Tue, 6 Sep 2016 15:18:30 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c0EHvx9lp-S9; Tue, 6 Sep 2016 15:18:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2498A7527; Tue, 6 Sep 2016 15:17:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 50F534B9F9 for ; Tue, 6 Sep 2016 15:16:16 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 54k0X5sKCwZw for ; Tue, 6 Sep 2016 15:16:16 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by theia.denx.de (Postfix) with ESMTPS id 204204B9AD for ; Tue, 6 Sep 2016 15:16:14 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id u86DFbir013304; Tue, 6 Sep 2016 22:15:40 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com u86DFbir013304 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1473167741; bh=fnfb06E4WLvnOs1zlhtWeb9Fp8iMjTNSdpH6fEn9VHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mrwzlMu5p9iRGIsUxep0BaiRwwmxRbiNCwE3rNntQ1fDVsobP0khlVhRXHtW6Cph1 QEeoDKtZbyJIhjGNickzDcMS0fAU+Xof9LrNxI1FtVjzQHL0JoR7wyidIYR+HQnCxR TGZIZSuYACILZV1fiEgyHkBdTf5r9tv8D67IVpXRCwXsvzysP0A8ZTMzLg/VgVUlLq BfMEZBHM6hgoPs6/uHuim3pGKUftPF8t89r1UxdDuMXNmYIDqJQnnL2jo0h8e0l7Si h404KOpE13QABASLVqvjn4KXubopoBoV1GL6ta3bGszH1s5zkNX2apYkaUL7Z63fJd fcNwElnPfg1Gw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 6 Sep 2016 22:17:33 +0900 Message-Id: <1473167860-27465-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1473167860-27465-1-git-send-email-yamada.masahiro@socionext.com> References: <1473167860-27465-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Stephen Warren , Tom Warren Subject: [U-Boot] [PATCH v3 2/8] video: squash lines for immediate return X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For vidconsole_post_probe(), it is common coding style to let a probe method return the value of a register function. The others will become simple wrapper functions. Signed-off-by: Masahiro Yamada Acked-by: Anatolij Gustschin --- Changes in v3: - Two more fixes - s/resister/register/ drivers/video/bridge/ptn3460.c | 7 +------ drivers/video/broadwell_igd.c | 5 +---- drivers/video/exynos/exynos_dp_lowlevel.c | 6 +----- drivers/video/tegra124/display.c | 8 +------- drivers/video/vidconsole-uclass.c | 6 +----- 5 files changed, 5 insertions(+), 27 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/drivers/video/bridge/ptn3460.c b/drivers/video/bridge/ptn3460.c index 2e2ae7c..f9d3720 100644 --- a/drivers/video/bridge/ptn3460.c +++ b/drivers/video/bridge/ptn3460.c @@ -11,14 +11,9 @@ static int ptn3460_attach(struct udevice *dev) { - int ret; - debug("%s: %s\n", __func__, dev->name); - ret = video_bridge_set_active(dev, true); - if (ret) - return ret; - return 0; + return video_bridge_set_active(dev, true); } struct video_bridge_ops ptn3460_ops = { diff --git a/drivers/video/broadwell_igd.c b/drivers/video/broadwell_igd.c index ce4f296..4286fd0 100644 --- a/drivers/video/broadwell_igd.c +++ b/drivers/video/broadwell_igd.c @@ -323,10 +323,7 @@ err: static unsigned long gtt_read(struct broadwell_igd_priv *priv, unsigned long reg) { - u32 val; - - val = readl(priv->regs + reg); - return val; + return readl(priv->regs + reg); } static void gtt_write(struct broadwell_igd_priv *priv, unsigned long reg, diff --git a/drivers/video/exynos/exynos_dp_lowlevel.c b/drivers/video/exynos/exynos_dp_lowlevel.c index f978473..aae78a8 100644 --- a/drivers/video/exynos/exynos_dp_lowlevel.c +++ b/drivers/video/exynos/exynos_dp_lowlevel.c @@ -881,11 +881,7 @@ void exynos_dp_set_lane_count(struct exynos_dp *dp_regs, unsigned char count) unsigned int exynos_dp_get_lane_count(struct exynos_dp *dp_regs) { - unsigned int reg; - - reg = readl(&dp_regs->lane_count_set); - - return reg; + return readl(&dp_regs->lane_count_set); } unsigned char exynos_dp_get_lanex_pre_emphasis(struct exynos_dp *dp_regs, diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c index 2f1f0df..d8999c3 100644 --- a/drivers/video/tegra124/display.c +++ b/drivers/video/tegra124/display.c @@ -326,13 +326,7 @@ static int display_update_config_from_edid(struct udevice *dp_dev, int *panel_bppp, struct display_timing *timing) { - int ret; - - ret = display_read_timing(dp_dev, timing); - if (ret) - return ret; - - return 0; + return display_read_timing(dp_dev, timing); } static int display_init(struct udevice *dev, void *lcdbase, diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index c8cc05e..e9a90b1 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -190,7 +190,6 @@ static int vidconsole_post_probe(struct udevice *dev) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); struct stdio_dev *sdev = &priv->sdev; - int ret; if (!priv->tab_width_frac) priv->tab_width_frac = VID_TO_POS(priv->x_charsize) * 8; @@ -206,11 +205,8 @@ static int vidconsole_post_probe(struct udevice *dev) sdev->putc = vidconsole_putc; sdev->puts = vidconsole_puts; sdev->priv = dev; - ret = stdio_register(sdev); - if (ret) - return ret; - return 0; + return stdio_register(sdev); } UCLASS_DRIVER(vidconsole) = {