Commit cdc97792 authored by Ming Lei's avatar Ming Lei Committed by Greg Kroah-Hartman
Browse files

USB: remove unnecessary type casting of urb->context



urb->context code cleanup
Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a5b6f60c
......@@ -444,7 +444,7 @@ CXACRU_ALL_FILES(INIT);
/* the following three functions are stolen from drivers/usb/core/message.c */
static void cxacru_blocking_completion(struct urb *urb)
{
complete((struct completion *)urb->context);
complete(urb->context);
}
static void cxacru_timeout_kill(unsigned long data)
......
......@@ -443,7 +443,7 @@ urbs:
static void acm_write_bulk(struct urb *urb)
{
struct acm *acm;
struct acm_wb *wb = (struct acm_wb *)urb->context;
struct acm_wb *wb = urb->context;
dbg("Entering acm_write_bulk with status %d", urb->status);
......
......@@ -284,7 +284,7 @@ static void auerchain_complete (struct urb * urb)
int result;
/* get pointer to element and to chain */
pauerchainelement_t acep = (pauerchainelement_t) urb->context;
pauerchainelement_t acep = urb->context;
pauerchain_t acp = acep->chain;
/* restore original entries in urb */
......@@ -594,7 +594,7 @@ ac_fail:/* free the elements */
/* completion handler for synchronous chained URBs */
static void auerchain_blocking_completion (struct urb *urb)
{
pauerchain_chs_t pchs = (pauerchain_chs_t)urb->context;
pauerchain_chs_t pchs = urb->context;
pchs->done = 1;
wmb();
wake_up (&pchs->wqh);
......@@ -847,7 +847,7 @@ static int auerswald_status_retry (int status)
/* Completion of asynchronous write block */
static void auerchar_ctrlwrite_complete (struct urb * urb)
{
pauerbuf_t bp = (pauerbuf_t) urb->context;
pauerbuf_t bp = urb->context;
pauerswald_t cp = ((pauerswald_t)((char *)(bp->list)-(unsigned long)(&((pauerswald_t)0)->bufctl)));
dbg ("auerchar_ctrlwrite_complete called");
......@@ -860,7 +860,7 @@ static void auerchar_ctrlwrite_complete (struct urb * urb)
/* Completion handler for dummy retry packet */
static void auerswald_ctrlread_wretcomplete (struct urb * urb)
{
pauerbuf_t bp = (pauerbuf_t) urb->context;
pauerbuf_t bp = urb->context;
pauerswald_t cp;
int ret;
int status = urb->status;
......@@ -904,7 +904,7 @@ static void auerswald_ctrlread_complete (struct urb * urb)
unsigned int serviceid;
pauerswald_t cp;
pauerscon_t scp;
pauerbuf_t bp = (pauerbuf_t) urb->context;
pauerbuf_t bp = urb->context;
int status = urb->status;
int ret;
......@@ -981,7 +981,7 @@ static void auerswald_int_complete (struct urb * urb)
int ret;
int status = urb->status;
pauerbuf_t bp = NULL;
pauerswald_t cp = (pauerswald_t) urb->context;
pauerswald_t cp = urb->context;
dbg ("%s called", __func__);
......
......@@ -746,7 +746,7 @@ static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
static void ftdi_elan_write_bulk_callback(struct urb *urb)
{
struct usb_ftdi *ftdi = (struct usb_ftdi *)urb->context;
struct usb_ftdi *ftdi = urb->context;
int status = urb->status;
if (status && !(status == -ENOENT || status == -ECONNRESET ||
......
......@@ -154,7 +154,7 @@ MODULE_DEVICE_TABLE(usb, iowarrior_ids);
*/
static void iowarrior_callback(struct urb *urb)
{
struct iowarrior *dev = (struct iowarrior *)urb->context;
struct iowarrior *dev = urb->context;
int intr_idx;
int read_idx;
int aux_idx;
......@@ -230,7 +230,7 @@ static void iowarrior_write_callback(struct urb *urb)
struct iowarrior *dev;
int status = urb->status;
dev = (struct iowarrior *)urb->context;
dev = urb->context;
/* sync/async unlink faults aren't errors */
if (status &&
!(status == -ENOENT ||
......
......@@ -753,7 +753,7 @@ exit:
*/
static void tower_interrupt_in_callback (struct urb *urb)
{
struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
struct lego_usb_tower *dev = urb->context;
int status = urb->status;
int retval;
......@@ -810,7 +810,7 @@ exit:
*/
static void tower_interrupt_out_callback (struct urb *urb)
{
struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
struct lego_usb_tower *dev = urb->context;
int status = urb->status;
dbg(4, "%s: enter, status %d", __func__, status);
......
......@@ -185,7 +185,7 @@ static void lcd_write_bulk_callback(struct urb *urb)
struct usb_lcd *dev;
int status = urb->status;
dev = (struct usb_lcd *)urb->context;
dev = urb->context;
/* sync/async unlink faults aren't errors */
if (status &&
......
......@@ -201,7 +201,7 @@ found:
static void simple_callback (struct urb *urb)
{
complete ((struct completion *) urb->context);
complete(urb->context);
}
static struct urb *simple_alloc_urb (
......@@ -1046,7 +1046,7 @@ static void unlink1_callback (struct urb *urb)
status = usb_submit_urb (urb, GFP_ATOMIC);
if (status) {
urb->status = status;
complete ((struct completion *) urb->context);
complete(urb->context);
}
}
......
......@@ -248,7 +248,7 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
static void belkin_sa_read_int_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct belkin_sa_private *priv;
unsigned char *data = urb->transfer_buffer;
int retval;
......
......@@ -300,7 +300,7 @@ static int cyberjack_write_room( struct usb_serial_port *port )
static void cyberjack_read_int_callback( struct urb *urb )
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
int status = urb->status;
......@@ -357,7 +357,7 @@ resubmit:
static void cyberjack_read_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
......@@ -409,7 +409,7 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
static void cyberjack_write_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
int status = urb->status;
......
......@@ -1209,7 +1209,7 @@ static void cypress_unthrottle (struct usb_serial_port *port)
static void cypress_read_int_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct cypress_private *priv = usb_get_serial_port_data(port);
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
......@@ -1361,7 +1361,7 @@ continue_read:
static void cypress_write_int_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct cypress_private *priv = usb_get_serial_port_data(port);
int result;
int status = urb->status;
......
......@@ -1227,7 +1227,7 @@ static int digi_write(struct usb_serial_port *port, const unsigned char *buf, in
static void digi_write_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct usb_serial *serial;
struct digi_port *priv;
struct digi_serial *serial_priv;
......@@ -1605,7 +1605,7 @@ static void digi_shutdown(struct usb_serial *serial)
static void digi_read_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct digi_port *priv;
struct digi_serial *serial_priv;
int ret;
......@@ -1664,7 +1664,7 @@ static void digi_read_bulk_callback(struct urb *urb)
static int digi_read_inb_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct tty_struct *tty = port->tty;
struct digi_port *priv = usb_get_serial_port_data(port);
int opcode = ((unsigned char *)urb->transfer_buffer)[0];
......@@ -1754,7 +1754,7 @@ static int digi_read_inb_callback(struct urb *urb)
static int digi_read_oob_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct usb_serial *serial = port->serial;
struct digi_port *priv = usb_get_serial_port_data(port);
int opcode, line, status, val;
......
......@@ -340,7 +340,7 @@ static void empeg_write_bulk_callback (struct urb *urb)
static void empeg_read_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
......
......@@ -1377,7 +1377,7 @@ error_no_buffer:
static void ftdi_write_bulk_callback (struct urb *urb)
{
unsigned long flags;
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct ftdi_private *priv;
int data_offset; /* will be 1 for the SIO and 0 otherwise */
unsigned long countback;
......@@ -1460,7 +1460,7 @@ static int ftdi_chars_in_buffer (struct usb_serial_port *port)
static void ftdi_read_bulk_callback (struct urb *urb)
{ /* ftdi_read_bulk_callback */
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct tty_struct *tty;
struct ftdi_private *priv;
unsigned long countread;
......
......@@ -1046,7 +1046,7 @@ static void garmin_close (struct usb_serial_port *port, struct file * filp)
static void garmin_write_bulk_callback (struct urb *urb)
{
unsigned long flags;
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
int status = urb->status;
if (port) {
......@@ -1286,7 +1286,7 @@ static void garmin_read_process(struct garmin_data * garmin_data_p,
static void garmin_read_bulk_callback (struct urb *urb)
{
unsigned long flags;
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct usb_serial *serial = port->serial;
struct garmin_data * garmin_data_p = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
......@@ -1344,7 +1344,7 @@ static void garmin_read_int_callback (struct urb *urb)
{
unsigned long flags;
int retval;
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct usb_serial *serial = port->serial;
struct garmin_data * garmin_data_p = usb_get_serial_port_data(port);
unsigned char *data = urb->transfer_buffer;
......
......@@ -331,7 +331,7 @@ static void flush_and_resubmit_read_urb (struct usb_serial_port *port)
void usb_serial_generic_read_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
unsigned char *data = urb->transfer_buffer;
int status = urb->status;
unsigned long flags;
......@@ -359,7 +359,7 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);
void usb_serial_generic_write_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
int status = urb->status;
dbg("%s - port %d", __func__, port->number);
......
......@@ -589,7 +589,7 @@ static int get_epic_descriptor(struct edgeport_serial *ep)
*****************************************************************************/
static void edge_interrupt_callback (struct urb *urb)
{
struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context;
struct edgeport_serial *edge_serial = urb->context;
struct edgeport_port *edge_port;
struct usb_serial_port *port;
unsigned char *data = urb->transfer_buffer;
......@@ -689,7 +689,7 @@ exit:
*****************************************************************************/
static void edge_bulk_in_callback (struct urb *urb)
{
struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context;
struct edgeport_serial *edge_serial = urb->context;
unsigned char *data = urb->transfer_buffer;
int retval;
__u16 raw_data_length;
......@@ -749,7 +749,7 @@ static void edge_bulk_in_callback (struct urb *urb)
*****************************************************************************/
static void edge_bulk_out_data_callback (struct urb *urb)
{
struct edgeport_port *edge_port = (struct edgeport_port *)urb->context;
struct edgeport_port *edge_port = urb->context;
struct tty_struct *tty;
int status = urb->status;
......@@ -782,7 +782,7 @@ static void edge_bulk_out_data_callback (struct urb *urb)
*****************************************************************************/
static void edge_bulk_out_cmd_callback (struct urb *urb)
{
struct edgeport_port *edge_port = (struct edgeport_port *)urb->context;
struct edgeport_port *edge_port = urb->context;
struct tty_struct *tty;
int status = urb->status;
......
......@@ -1710,7 +1710,7 @@ static void handle_new_lsr (struct edgeport_port *edge_port, int lsr_data, __u8
static void edge_interrupt_callback (struct urb *urb)
{
struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context;
struct edgeport_serial *edge_serial = urb->context;
struct usb_serial_port *port;
struct edgeport_port *edge_port;
unsigned char *data = urb->transfer_buffer;
......@@ -1803,7 +1803,7 @@ exit:
static void edge_bulk_in_callback (struct urb *urb)
{
struct edgeport_port *edge_port = (struct edgeport_port *)urb->context;
struct edgeport_port *edge_port = urb->context;
unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty;
int retval = 0;
......@@ -1897,7 +1897,7 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c
static void edge_bulk_out_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
int status = urb->status;
......
......@@ -729,7 +729,7 @@ static void ipaq_close(struct usb_serial_port *port, struct file *filp)
static void ipaq_read_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
......@@ -869,7 +869,7 @@ static void ipaq_write_gather(struct usb_serial_port *port)
static void ipaq_write_bulk_callback(struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct ipaq_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
int result;
......
......@@ -393,7 +393,7 @@ static int ir_write (struct usb_serial_port *port, const unsigned char *buf, int
static void ir_write_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
int status = urb->status;
dbg("%s - port %d", __func__, port->number);
......@@ -417,7 +417,7 @@ static void ir_write_bulk_callback (struct urb *urb)
static void ir_read_bulk_callback (struct urb *urb)
{
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct usb_serial_port *port = urb->context;
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment