Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334496

[PATCH 5/7] serial: clps711x: fix IS_ERR_VALUE usage

From Andrzej Hajda <a.hajda@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 5/7] serial: clps711x: fix IS_ERR_VALUE usage
Date 2016-02-15 15:40 +0100
Message-ID <r2stJ-2fA-49@gated-at.bofh.it> (permalink)
References <r2stH-2fA-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


IS_ERR_VALUE macro should be used only with unsigned long type.
For signed types comparison 'ret < 0' should be used.

The patch follows conclusion from discussion on LKML [1][2].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
[2]: http://permalink.gmane.org/gmane.linux.kernel/2150581

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/tty/serial/clps711x.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index b3a4e0c..0096ebe 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -467,13 +467,15 @@ static int uart_clps711x_probe(struct platform_device *pdev)
 	if (IS_ERR(s->port.membase))
 		return PTR_ERR(s->port.membase);
 
-	s->port.irq = platform_get_irq(pdev, 0);
-	if (IS_ERR_VALUE(s->port.irq))
-		return s->port.irq;
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
+		return ret;
+	s->port.irq = ret;
 
-	s->rx_irq = platform_get_irq(pdev, 1);
-	if (IS_ERR_VALUE(s->rx_irq))
-		return s->rx_irq;
+	ret = platform_get_irq(pdev, 1);
+	if (ret < 0)
+		return ret;
+	s->rx_irq = ret;
 
 	if (!np) {
 		char syscon_name[9];
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 5/7] serial: clps711x: fix IS_ERR_VALUE usage Andrzej Hajda <a.hajda@samsung.com> - 2016-02-15 15:40 +0100
  Re: [PATCH 5/7] serial: clps711x: fix IS_ERR_VALUE usage Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-17 03:40 +0100

csiph-web