All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2 RESEND] staging: dgnc: remove useless error value assignment
@ 2016-05-10  6:46 ` Daeseok Youn
  0 siblings, 0 replies; 2+ messages in thread
From: Daeseok Youn @ 2016-05-10  6:46 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

The "result" variable in dgnc_get_mstat() was initialized with
"-EIO". But if the "ch" is not null, "result" will be set to zero
and if the "ch" is null, dgnc_get_mstat() will return "-ENXIO" as
an error. So "-EIO" error value was useless in dgnc_get_mstat().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
RESEND: update subject and change log
origin patch : https://lkml.org/lkml/2016/5/4/13

 drivers/staging/dgnc/dgnc_tty.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index cff34d4..30db091 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1979,7 +1979,7 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, char c)
 static inline int dgnc_get_mstat(struct channel_t *ch)
 {
 	unsigned char mstat;
-	int result = -EIO;
+	int result = 0;
 	unsigned long flags;
 
 	if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
@@ -1991,8 +1991,6 @@ static inline int dgnc_get_mstat(struct channel_t *ch)
 
 	spin_unlock_irqrestore(&ch->ch_lock, flags);
 
-	result = 0;
-
 	if (mstat & UART_MCR_DTR)
 		result |= TIOCM_DTR;
 	if (mstat & UART_MCR_RTS)
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2 RESEND] staging: dgnc: remove useless error value assignment
@ 2016-05-10  6:46 ` Daeseok Youn
  0 siblings, 0 replies; 2+ messages in thread
From: Daeseok Youn @ 2016-05-10  6:46 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

The "result" variable in dgnc_get_mstat() was initialized with
"-EIO". But if the "ch" is not null, "result" will be set to zero
and if the "ch" is null, dgnc_get_mstat() will return "-ENXIO" as
an error. So "-EIO" error value was useless in dgnc_get_mstat().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
RESEND: update subject and change log
origin patch : https://lkml.org/lkml/2016/5/4/13

 drivers/staging/dgnc/dgnc_tty.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index cff34d4..30db091 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1979,7 +1979,7 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, char c)
 static inline int dgnc_get_mstat(struct channel_t *ch)
 {
 	unsigned char mstat;
-	int result = -EIO;
+	int result = 0;
 	unsigned long flags;
 
 	if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
@@ -1991,8 +1991,6 @@ static inline int dgnc_get_mstat(struct channel_t *ch)
 
 	spin_unlock_irqrestore(&ch->ch_lock, flags);
 
-	result = 0;
-
 	if (mstat & UART_MCR_DTR)
 		result |= TIOCM_DTR;
 	if (mstat & UART_MCR_RTS)
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-10  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10  6:46 [PATCH 2/2 RESEND] staging: dgnc: remove useless error value assignment Daeseok Youn
2016-05-10  6:46 ` Daeseok Youn

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.