Skip to contentSkip to conversation

mos7840: test and propagate set_uart_reg return value

PATCH Applied Roel Kluin 3 participants 8 messages Apr 17, 2008 – May 1, 2008

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 mos7840: test and propagate set_uart_reg return value

The test for an mos7840_set_uart_reg() error return value only works when status is signed. propagate its error value.

---

drivers/usb/serial/mos7840.c +2 -3
index aeeb9cb..ef1ede2 100644
@@ -1713,7 +1713,7 @@ static int mos7840_tiocmset(struct usb_serial_port *port, struct file *file,
 {
 	struct moschip_port *mos7840_port;
 	unsigned int mcr;
-	unsigned int status;
+	int status;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -1739,11 +1739,10 @@ static int mos7840_tiocmset(struct usb_serial_port *port, struct file *file,
 
 	mos7840_port->shadowMCR = mcr;
 
-	status = 0;
 	status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr);
 	if (status < 0) {
 		dbg("setting MODEM_CONTROL_REGISTER Failed\n");
-		return -1;
+		return status;
 	}
 
 	return 0;
#1 lore raw
Quoted 23 lines · Roel Kluin

The test for an mos7840_set_uart_reg() error return value only works when
status is signed. propagate its error value.

---

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index aeeb9cb..ef1ede2 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1713,7 +1713,7 @@ static int mos7840_tiocmset(struct usb_serial_port *port, struct file *file,

  {
        struct moschip_port *mos7840_port;
        unsigned int mcr;

- unsigned int status;
+ int status;

        dbg("%s - port %d", __FUNCTION__, port->number);

@@ -1739,11 +1739,10 @@ static int mos7840_tiocmset(struct usb_serial_port *port, struct file *file,

        mos7840_port->shadowMCR = mcr;
Quoted 9 lines
 -       status = 0;
        status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr);
        if (status < 0) {
                dbg("setting MODEM_CONTROL_REGISTER Failed\n");
 -               return -1;
 +               return status;
        }

        return 0;

O.K. I can see you're changing types to properly match the function return values. May I ask why you didn't change mos7840_tiocmget the same way?

-sb

#2 lore raw

patch usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch added to gregkh-2.6 tree

In reply to Roel Kluin

This is a note to let you know that I've just added the patch titled

Subject: USB: mos7840: test and propagate set_uart_reg return value

to my gregkh-2.6 tree. Its filename is

usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch

This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/

Quoted 1 line

From [email protected] Wed Apr 16 21:16:30 2008

From: Roel Kluin <[email protected]>
Date: Thu, 17 Apr 2008 06:16:24 +0200
Subject: USB: mos7840: test and propagate set_uart_reg return value
To: Greg KH <[email protected]>, [email protected], lkml <[email protected]>
Message-ID: <[email protected]>

The test for an mos7840_set_uart_reg() error return value only works when status is signed. propagate its error value.

---
 drivers/usb/serial/mos7840.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/serial/mos7840.c +2 -3
@@ -1713,7 +1713,7 @@ static int mos7840_tiocmset(struct usb_s
 {
 	struct moschip_port *mos7840_port;
 	unsigned int mcr;
-	unsigned int status;
+	int status;
 
 	dbg("%s - port %d", __func__, port->number);
 
@@ -1740,11 +1740,10 @@ static int mos7840_tiocmset(struct usb_s
 
 	mos7840_port->shadowMCR = mcr;
 
-	status = 0;
 	status = mos7840_set_uart_reg(port, MODEM_CONTROL_REGISTER, mcr);
 	if (status < 0) {
 		dbg("setting MODEM_CONTROL_REGISTER Failed\n");
-		return -1;
+		return status;
 	}
 
 	return 0;

Patches currently in gregkh-2.6 which might be from [email protected] are

usb/usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch

#3 lore raw

Re: patch usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch added to gregkh-2.6 tree

Quoted 8 lines · On 4/28/08, [email protected] <[email protected]> wrote:

This is a note to let you know that I've just added the patch titled

Subject: USB: mos7840: test and propagate set_uart_reg return value

to my gregkh-2.6 tree. Its filename is

usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch

NAK. Reviewer's question was never answered.

-sb

#4 lore raw

Re: patch usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch added to gregkh-2.6 tree

Quoted 11 lines · SL Baur
Quoted 8 lines · On 4/28/08, [email protected] <[email protected]> wrote:

This is a note to let you know that I've just added the patch titled

Subject: USB: mos7840: test and propagate set_uart_reg return value

to my gregkh-2.6 tree. Its filename is

usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch

NAK. Reviewer's question was never answered.

Does that mean that the original patch is invalid? Or just that your question was never answered?

thanks,

greg k-h

#5 lore raw

Re: patch usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch added to gregkh-2.6 tree

Quoted 4 lines · Greg KH

On Mon, Apr 28, 2008 at 11:31:07PM -0700, SL Baur wrote:

Does that mean that the original patch is invalid? Or just that your
question was never answered?

I think there are more of the same issues that the patch addressed in the same file and the patcher never responded back about that.

-sb

#6 lore raw

Re: patch usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch added to gregkh-2.6 tree

Quoted 9 lines · SL Baur
Quoted 4 lines · Greg KH

On Mon, Apr 28, 2008 at 11:31:07PM -0700, SL Baur wrote:

Does that mean that the original patch is invalid? Or just that your
question was never answered?

I think there are more of the same issues that the patch addressed in the same file and the patcher never responded back about that.

But again, is the current patch somehow not valid?

thanks,

greg k-h

#7 lore raw

Re: patch usb-mos7840-test-and-propagate-set_uart_reg-return-value.patch added to gregkh-2.6 tree

Quoted 7 lines · Greg KH
Quoted 6 lines · SL Baur
Quoted 4 lines · Greg KH

On Mon, Apr 28, 2008 at 11:31:07PM -0700, SL Baur wrote:

Does that mean that the original patch is invalid? Or just that your
question was never answered?

Quoted 6 lines
Quoted 3 lines

I think there are more of the same issues that the patch addressed in the same file and the patcher never responded back about that.

But again, is the current patch somehow not valid?

No, it's fine.

-sb