mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
staging: usbip: stub_main.c: coding style cleanup
Fix alignment for consistency and remove extraneous lines. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
b744a45f45
commit
6c033b46ce
@ -34,7 +34,6 @@ struct kmem_cache *stub_priv_cache;
|
|||||||
|
|
||||||
/* Define sysfs entries for the usbip driver */
|
/* Define sysfs entries for the usbip driver */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* busid_tables defines matching busids that usbip can grab. A user can change
|
* busid_tables defines matching busids that usbip can grab. A user can change
|
||||||
* dynamically what device is locally used and what device is exported to a
|
* dynamically what device is locally used and what device is exported to a
|
||||||
@ -44,7 +43,6 @@ struct kmem_cache *stub_priv_cache;
|
|||||||
static struct bus_id_priv busid_table[MAX_BUSID];
|
static struct bus_id_priv busid_table[MAX_BUSID];
|
||||||
static spinlock_t busid_table_lock;
|
static spinlock_t busid_table_lock;
|
||||||
|
|
||||||
|
|
||||||
int match_busid(const char *busid)
|
int match_busid(const char *busid)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -148,11 +146,11 @@ int del_match_busid(char *busid)
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_busid_table(void)
|
static void init_busid_table(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < MAX_BUSID; i++) {
|
for (i = 0; i < MAX_BUSID; i++) {
|
||||||
memset(busid_table[i].name, 0, BUSID_SIZE);
|
memset(busid_table[i].name, 0, BUSID_SIZE);
|
||||||
busid_table[i].status = STUB_BUSID_OTHER;
|
busid_table[i].status = STUB_BUSID_OTHER;
|
||||||
@ -160,6 +158,7 @@ static void init_busid_table(void)
|
|||||||
busid_table[i].sdev = NULL;
|
busid_table[i].sdev = NULL;
|
||||||
busid_table[i].shutdown_busid = 0;
|
busid_table[i].shutdown_busid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_init(&busid_table_lock);
|
spin_lock_init(&busid_table_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,7 +180,6 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
|
|||||||
|
|
||||||
strncpy(busid, buf + 4, BUSID_SIZE);
|
strncpy(busid, buf + 4, BUSID_SIZE);
|
||||||
|
|
||||||
|
|
||||||
if (!strncmp(buf, "add ", 4)) {
|
if (!strncmp(buf, "add ", 4)) {
|
||||||
if (add_match_busid(busid) < 0)
|
if (add_match_busid(busid) < 0)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -199,12 +197,9 @@ static ssize_t store_match_busid(struct device_driver *dev, const char *buf,
|
|||||||
} else
|
} else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DRIVER_ATTR(match_busid, S_IRUSR|S_IWUSR, show_match_busid,
|
static DRIVER_ATTR(match_busid, S_IRUSR|S_IWUSR, show_match_busid,
|
||||||
store_match_busid);
|
store_match_busid);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/* Cleanup functions used to free private data */
|
/* Cleanup functions used to free private data */
|
||||||
@ -265,14 +260,12 @@ void stub_device_cleanup_urbs(struct stub_device *sdev)
|
|||||||
kmem_cache_free(stub_priv_cache, priv);
|
kmem_cache_free(stub_priv_cache, priv);
|
||||||
|
|
||||||
kfree(urb->transfer_buffer);
|
kfree(urb->transfer_buffer);
|
||||||
|
|
||||||
kfree(urb->setup_packet);
|
kfree(urb->setup_packet);
|
||||||
|
|
||||||
usb_free_urb(urb);
|
usb_free_urb(urb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
static int __init usb_stub_init(void)
|
static int __init usb_stub_init(void)
|
||||||
@ -296,8 +289,8 @@ static int __init usb_stub_init(void)
|
|||||||
goto error_usb_register;
|
goto error_usb_register;
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(KERN_INFO KBUILD_MODNAME ":"
|
printk(KERN_INFO KBUILD_MODNAME ":" DRIVER_DESC ":" DRIVER_VERSION
|
||||||
DRIVER_DESC ":" DRIVER_VERSION "\n");
|
"\n");
|
||||||
|
|
||||||
init_busid_table();
|
init_busid_table();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user