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

Commit 18f2cbaa authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Felipe Balbi
Browse files

usb: gadget: dummy_hcd: clean up checkpatch



This patch converts checkpatch output of
|./scripts/checkpatch.pl drivers/usb/gadget/dummy_hcd.c -file

from
|total: 22 errors, 174 warnings, 2642 lines checked

to
|total: 0 errors, 0 warnings, 2632 lines checked

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 59f08e6d
Loading
Loading
Loading
Loading
+211 −221
Original line number Diff line number Diff line
@@ -42,12 +42,11 @@
#include <linux/scatterlist.h>

#include <asm/byteorder.h>
#include <asm/io.h>
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/system.h>
#include <asm/unaligned.h>


#define DRIVER_DESC	"USB Host+Gadget Emulator"
#define DRIVER_VERSION	"02 May 2005"

@@ -263,8 +262,7 @@ static void nuke (struct dummy *dum, struct dummy_ep *ep)
}

/* caller must hold lock */
static void
stop_activity (struct dummy *dum)
static void stop_activity(struct dummy *dum)
{
	struct dummy_ep	*ep;

@@ -410,8 +408,8 @@ static void set_link_state(struct dummy_hcd *dum_hcd)
#define is_enabled(dum) \
	(dum->port_status & USB_PORT_STAT_ENABLE)

static int
dummy_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
static int dummy_enable(struct usb_ep *_ep,
		const struct usb_endpoint_descriptor *desc)
{
	struct dummy		*dum;
	struct dummy_hcd	*dum_hcd;
@@ -579,8 +577,8 @@ static int dummy_disable (struct usb_ep *_ep)
	return retval;
}

static struct usb_request *
dummy_alloc_request (struct usb_ep *_ep, gfp_t mem_flags)
static struct usb_request *dummy_alloc_request(struct usb_ep *_ep,
		gfp_t mem_flags)
{
	struct dummy_ep		*ep;
	struct dummy_request	*req;
@@ -596,8 +594,7 @@ dummy_alloc_request (struct usb_ep *_ep, gfp_t mem_flags)
	return &req->req;
}

static void
dummy_free_request (struct usb_ep *_ep, struct usb_request *_req)
static void dummy_free_request(struct usb_ep *_ep, struct usb_request *_req)
{
	struct dummy_ep		*ep;
	struct dummy_request	*req;
@@ -611,13 +608,11 @@ dummy_free_request (struct usb_ep *_ep, struct usb_request *_req)
	kfree(req);
}

static void
fifo_complete (struct usb_ep *ep, struct usb_request *req)
static void fifo_complete(struct usb_ep *ep, struct usb_request *req)
{
}

static int
dummy_queue (struct usb_ep *_ep, struct usb_request *_req,
static int dummy_queue(struct usb_ep *_ep, struct usb_request *_req,
		gfp_t mem_flags)
{
	struct dummy_ep		*ep;
@@ -643,7 +638,6 @@ dummy_queue (struct usb_ep *_ep, struct usb_request *_req,
	dev_dbg(udc_dev(dum), "ep %p queue req %p to %s, len %d buf %p\n",
			ep, _req, _ep->name, _req->length, _req->buf);
#endif

	_req->status = -EINPROGRESS;
	_req->actual = 0;
	spin_lock_irqsave(&dum->lock, flags);
@@ -805,7 +799,7 @@ static int dummy_set_selfpowered (struct usb_gadget *_gadget, int value)
{
	struct dummy	*dum;

	dum = (gadget_to_dummy_hcd(_gadget))->dum;
	dum = gadget_to_dummy_hcd(_gadget)->dum;
	if (value)
		dum->devstatus |= (1 << USB_DEVICE_SELF_POWERED);
	else
@@ -872,8 +866,8 @@ static const struct usb_gadget_ops dummy_ops = {
/*-------------------------------------------------------------------------*/

/* "function" sysfs attribute */
static ssize_t
show_function (struct device *dev, struct device_attribute *attr, char *buf)
static ssize_t show_function(struct device *dev, struct device_attribute *attr,
		char *buf)
{
	struct dummy	*dum = gadget_dev_to_dummy(dev);

@@ -940,8 +934,7 @@ static int dummy_udc_stop(struct usb_gadget *g,

/* The gadget structure is stored inside the hcd structure and will be
 * released along with it. */
static void
dummy_gadget_release (struct device *dev)
static void dummy_gadget_release(struct device *dev)
{
	return;
}
@@ -1343,7 +1336,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb,
			/* not enough bandwidth left? */
			if (limit < ep->ep.maxpacket && limit < len)
				break;
			len = min (len, (unsigned) limit);
			len = min_t(unsigned, len, limit);
			if (len == 0)
				break;

@@ -1849,7 +1842,6 @@ static void dummy_timer(unsigned long _dum_hcd)
			limit = max(limit, periodic_bytes(dum, ep));
			/* FALLTHROUGH */

		// case PIPE_BULK:  case PIPE_CONTROL:
		default:
treat_control_like_bulk:
			ep->last_io = jiffies;
@@ -1938,8 +1930,7 @@ ss_hub_descriptor(struct usb_hub_descriptor *desc)
	desc->u.ss.DeviceRemovable = 0xffff;
}

static inline void
hub_descriptor (struct usb_hub_descriptor *desc)
static inline void hub_descriptor(struct usb_hub_descriptor *desc)
{
	memset(desc, 0, sizeof *desc);
	desc->bDescriptorType = 0x29;
@@ -2236,8 +2227,7 @@ static int dummy_bus_resume (struct usb_hcd *hcd)

/*-------------------------------------------------------------------------*/

static inline ssize_t
show_urb (char *buf, size_t size, struct urb *urb)
static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb)
{
	int ep = usb_pipeendpoint(urb->pipe);

@@ -2281,8 +2271,8 @@ show_urb (char *buf, size_t size, struct urb *urb)
		urb->actual_length, urb->transfer_buffer_length);
}

static ssize_t
show_urbs (struct device *dev, struct device_attribute *attr, char *buf)
static ssize_t show_urbs(struct device *dev, struct device_attribute *attr,
		char *buf)
{
	struct usb_hcd		*hcd = dev_get_drvdata(dev);
	struct dummy_hcd	*dum_hcd = hcd_to_dummy_hcd(hcd);
@@ -2360,7 +2350,7 @@ static void dummy_stop (struct usb_hcd *hcd)
{
	struct dummy		*dum;

	dum = (hcd_to_dummy_hcd(hcd))->dum;
	dum = hcd_to_dummy_hcd(hcd)->dum;
	device_remove_file(dummy_dev(hcd_to_dummy_hcd(hcd)), &dev_attr_urbs);
	usb_gadget_unregister_driver(dum->driver);
	dev_info(dummy_dev(hcd_to_dummy_hcd(hcd)), "stopped\n");
@@ -2546,7 +2536,7 @@ static int dummy_hcd_remove(struct platform_device *pdev)
{
	struct dummy		*dum;

	dum = (hcd_to_dummy_hcd(platform_get_drvdata(pdev)))->dum;
	dum = hcd_to_dummy_hcd(platform_get_drvdata(pdev))->dum;

	if (dum->ss_hcd) {
		usb_remove_hcd(dummy_hcd_to_hcd(dum->ss_hcd));