All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/8] video: squash lines for immediate return
Date: Tue,  6 Sep 2016 22:17:33 +0900	[thread overview]
Message-ID: <1473167860-27465-3-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1473167860-27465-1-git-send-email-yamada.masahiro@socionext.com>

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 <yamada.masahiro@socionext.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

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(-)

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) = {
-- 
1.9.1

  parent reply	other threads:[~2016-09-06 13:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 13:17 [U-Boot] [PATCH v3 0/8] Clean-up: squash lines for immediate return Masahiro Yamada
2016-09-06 13:17 ` [U-Boot] [PATCH v3 1/8] mmc: " Masahiro Yamada
2016-09-08 13:46   ` Jaehoon Chung
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` Masahiro Yamada [this message]
2016-09-06 14:23   ` [U-Boot] [PATCH v3 2/8] video: " Simon Glass
2016-09-06 17:25   ` Stephen Warren
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 3/8] usb: replace ehci_*_remove() with usb_deregister() Masahiro Yamada
2016-09-06 17:27   ` Stephen Warren
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 4/8] usb: squash lines for immediate return Masahiro Yamada
2016-09-24  2:27   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 5/8] x86: " Masahiro Yamada
2016-09-24  2:28   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 6/8] libfdt: simplify fdt_del_mem_rsv() Masahiro Yamada
2016-09-06 14:23   ` Simon Glass
2016-09-24  2:28   ` [U-Boot] [U-Boot,v3,6/8] " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 7/8] arch, board: squash lines for immediate return Masahiro Yamada
2016-09-06 16:37   ` Minkyu Kang
2016-09-08 21:26   ` Angelo Dureghello
2016-09-24  2:28   ` [U-Boot] [U-Boot, v3, " Tom Rini
2016-09-06 13:17 ` [U-Boot] [PATCH v3 8/8] drivers: " Masahiro Yamada
2016-09-24  2:28   ` [U-Boot] [U-Boot, v3, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473167860-27465-3-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.