Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3170f327 authored by Tina Johnson's avatar Tina Johnson Committed by Greg Kroah-Hartman
Browse files

Staging: media: lirc: lirc_imon: Removed unnecessary variable to simplify return variable handling



Variable rc was removed after merging its assignment statement with
immediately following return statement. Variable retval is not used
at all other that to return its initial value.Hence replaced retval
with its initial value in the return statement and removed the variable.

This patch was done using Coccinelle script and the following semantic
patch was used:

@rule1@
identifier ret;
expression e;
@@

-int ret = 0;
 ... when != ret
(
-ret = e;
+return e;
-return ret;
|
-return ret;
+return 0;
)

Signed-off-by: default avatarTina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8ad5360a
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -489,7 +489,6 @@ static void usb_tx_callback(struct urb *urb)
 */
 */
static int ir_open(void *data)
static int ir_open(void *data)
{
{
	int retval = 0;
	struct imon_context *context;
	struct imon_context *context;


	/* prevent races with disconnect */
	/* prevent races with disconnect */
@@ -506,7 +505,7 @@ static int ir_open(void *data)
	dev_info(context->driver->dev, "IR port opened\n");
	dev_info(context->driver->dev, "IR port opened\n");


	mutex_unlock(&driver_lock);
	mutex_unlock(&driver_lock);
	return retval;
	return 0;
}
}


/**
/**
@@ -1021,7 +1020,6 @@ static int imon_suspend(struct usb_interface *intf, pm_message_t message)


static int imon_resume(struct usb_interface *intf)
static int imon_resume(struct usb_interface *intf)
{
{
	int rc = 0;
	struct imon_context *context = usb_get_intfdata(intf);
	struct imon_context *context = usb_get_intfdata(intf);


	usb_fill_int_urb(context->rx_urb, context->usbdev,
	usb_fill_int_urb(context->rx_urb, context->usbdev,
@@ -1031,9 +1029,7 @@ static int imon_resume(struct usb_interface *intf)
		usb_rx_callback, context,
		usb_rx_callback, context,
		context->rx_endpoint->bInterval);
		context->rx_endpoint->bInterval);


	rc = usb_submit_urb(context->rx_urb, GFP_ATOMIC);
	return usb_submit_urb(context->rx_urb, GFP_ATOMIC);

	return rc;
}
}


module_usb_driver(imon_driver);
module_usb_driver(imon_driver);