Re: [PATCH] Removed useless retval variables in usb-serial.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Trevor Pace wrote:

Removed useless return value variables.

   Are you sure gcc doesn't optimize them away? :-)

Signed-off By: Trevor Pace <trevor.pace@xxxxxx>

================================================================================

diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index bd7581b..faec1d1 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c

[...]

@@ -437,11 +432,9 @@ static int serial_ioctl(struct tty_struct *tty, struct file
*file,

 	/* pass on to the driver specific version of this function
 	   if it is available */
-	if (port->serial->type->ioctl) {
-		retval = port->serial->type->ioctl(tty, file, cmd, arg);
-	} else
-		retval = -ENOIOCTLCMD;
-	return retval;
+	if (port->serial->type->ioctl)
+		return port->serial->type->ioctl(tty, file, cmd, arg);
+        return -ENOIOCTLCMD;

   Spaces instead of tab here...

@@ -1185,24 +1178,21 @@ int usb_serial_suspend(struct usb_interface *intf,
pm_message_t message)
 	}

 	if (serial->type->suspend)
-		r = serial->type->suspend(serial, message);
+		return serial->type->suspend(serial, message);

-	return r;
+	return 0;
 }
 EXPORT_SYMBOL(usb_serial_suspend);

 int usb_serial_resume(struct usb_interface *intf)
 {
 	struct usb_serial *serial = usb_get_intfdata(intf);
-	int rv;

 	serial->suspending = 0;
-	if (serial->type->resume)
-		rv = serial->type->resume(serial);
-	else
-		rv = usb_serial_generic_resume(serial);

-	return rv;
+	return (serial->type->resume)

   Parens totally not needed here.

+		? serial->type->resume(serial)
+		: usb_serial_generic_resume(serial);
 }
 EXPORT_SYMBOL(usb_serial_resume);

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux