Re: [PATCH] mos7840: test and propagate set_uart_reg return value

From: SL Baur
Date: Thu Apr 17 2008 - 02:58:45 EST


On 4/16/08, Roel Kluin <12o3l@xxxxxxxxxx> wrote:
> The test for an mos7840_set_uart_reg() error return value only works when
> status is signed. propagate its error value.
>
> Signed-off-by: Roel Kluin <12o3l@xxxxxxxxxx>
> ---
>
> 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;
>
> - 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/