Commit b5c3bf7a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: cyberjack driver: fixed __FUNCTION__ usages.

parent c1556beb
...@@ -81,7 +81,7 @@ static struct usb_serial_device_type cyberjack_device = { ...@@ -81,7 +81,7 @@ static struct usb_serial_device_type cyberjack_device = {
.num_bulk_in = 1, .num_bulk_in = 1,
.num_bulk_out = 1, .num_bulk_out = 1,
.num_ports = 1, .num_ports = 1,
.attach = cyberjack_startup, .attach = cyberjack_startup,
.shutdown = cyberjack_shutdown, .shutdown = cyberjack_shutdown,
.open = cyberjack_open, .open = cyberjack_open,
.close = cyberjack_close, .close = cyberjack_close,
...@@ -103,7 +103,7 @@ static int cyberjack_startup (struct usb_serial *serial) ...@@ -103,7 +103,7 @@ static int cyberjack_startup (struct usb_serial *serial)
{ {
struct cyberjack_private *priv; struct cyberjack_private *priv;
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
/* allocate the private data structure */ /* allocate the private data structure */
serial->port->private = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL); serial->port->private = kmalloc(sizeof(struct cyberjack_private), GFP_KERNEL);
...@@ -125,7 +125,7 @@ static void cyberjack_shutdown (struct usb_serial *serial) ...@@ -125,7 +125,7 @@ static void cyberjack_shutdown (struct usb_serial *serial)
{ {
int i; int i;
dbg (__FUNCTION__); dbg("%s", __FUNCTION__);
for (i=0; i < serial->num_ports; ++i) { for (i=0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */ /* My special items, the standard routines free my urbs */
...@@ -142,7 +142,7 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp) ...@@ -142,7 +142,7 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
if (port_paranoia_check (port, __FUNCTION__)) if (port_paranoia_check (port, __FUNCTION__))
return -ENODEV; return -ENODEV;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* force low_latency on so that our tty_push actually forces /* force low_latency on so that our tty_push actually forces
* the data through, otherwise it is scheduled, and with high * the data through, otherwise it is scheduled, and with high
...@@ -164,14 +164,14 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp) ...@@ -164,14 +164,14 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) if (result)
err(" usb_submit_urb(read int) failed"); err(" usb_submit_urb(read int) failed");
dbg(__FUNCTION__ " - usb_submit_urb(int urb)"); dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
return result; return result;
} }
static void cyberjack_close (struct usb_serial_port *port, struct file *filp) static void cyberjack_close (struct usb_serial_port *port, struct file *filp)
{ {
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (port->serial->dev) { if (port->serial->dev) {
/* shutdown any bulk reads that might be going on */ /* shutdown any bulk reads that might be going on */
...@@ -188,16 +188,16 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -188,16 +188,16 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
int result; int result;
int wrexpected; int wrexpected;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
dbg(__FUNCTION__ " - from_user %d", from_user); dbg("%s - from_user %d", __FUNCTION__, from_user);
if (count == 0) { if (count == 0) {
dbg(__FUNCTION__ " - write request of 0 bytes"); dbg("%s - write request of 0 bytes", __FUNCTION__);
return (0); return (0);
} }
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg("%s - already writing", __FUNCTION__);
return (0); return (0);
} }
...@@ -221,7 +221,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -221,7 +221,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
if( priv->wrfilled >= 3 ) { if( priv->wrfilled >= 3 ) {
wrexpected = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3; wrexpected = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
dbg(__FUNCTION__ " - expected data: %d", wrexpected); dbg("%s - expected data: %d", __FUNCTION__, wrexpected);
} else { } else {
wrexpected = sizeof(priv->wrbuf); wrexpected = sizeof(priv->wrbuf);
} }
...@@ -230,7 +230,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -230,7 +230,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* We have enough data to begin transmission */ /* We have enough data to begin transmission */
int length; int length;
dbg(__FUNCTION__ " - transmitting data (frame 1)"); dbg("%s - transmitting data (frame 1)", __FUNCTION__);
length = (wrexpected > port->bulk_out_size) ? port->bulk_out_size : wrexpected; length = (wrexpected > port->bulk_out_size) ? port->bulk_out_size : wrexpected;
memcpy (port->write_urb->transfer_buffer, priv->wrbuf, length ); memcpy (port->write_urb->transfer_buffer, priv->wrbuf, length );
...@@ -248,18 +248,18 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u ...@@ -248,18 +248,18 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
/* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
return 0; return 0;
} }
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent); dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled); dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
if( priv->wrsent>=priv->wrfilled ) { if( priv->wrsent>=priv->wrfilled ) {
dbg(__FUNCTION__ " - buffer cleaned"); dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) ); memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
...@@ -278,7 +278,7 @@ static void cyberjack_read_int_callback( struct urb *urb ) ...@@ -278,7 +278,7 @@ static void cyberjack_read_int_callback( struct urb *urb )
if (port_paranoia_check (port, __FUNCTION__)) return; if (port_paranoia_check (port, __FUNCTION__)) return;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
/* the urb might have been killed. */ /* the urb might have been killed. */
if (urb->status) if (urb->status)
...@@ -311,14 +311,14 @@ static void cyberjack_read_int_callback( struct urb *urb ) ...@@ -311,14 +311,14 @@ static void cyberjack_read_int_callback( struct urb *urb )
/* "+=" is probably more fault tollerant than "=" */ /* "+=" is probably more fault tollerant than "=" */
priv->rdtodo += size; priv->rdtodo += size;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo); dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
if( !old_rdtodo ) { if( !old_rdtodo ) {
port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if( result ) if( result )
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)"); dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
} }
} }
} }
...@@ -333,16 +333,16 @@ static void cyberjack_read_bulk_callback (struct urb *urb) ...@@ -333,16 +333,16 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
int i; int i;
int result; int result;
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer); usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status); dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -366,15 +366,15 @@ static void cyberjack_read_bulk_callback (struct urb *urb) ...@@ -366,15 +366,15 @@ static void cyberjack_read_bulk_callback (struct urb *urb)
/* Just to be sure */ /* Just to be sure */
if( priv->rdtodo<0 ) priv->rdtodo=0; if( priv->rdtodo<0 ) priv->rdtodo=0;
dbg(__FUNCTION__ " - rdtodo: %d", priv->rdtodo); dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
/* Continue to read if we have still urbs to do. */ /* Continue to read if we have still urbs to do. */
if( priv->rdtodo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) { if( priv->rdtodo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) {
port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result) if (result)
err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
dbg(__FUNCTION__ " - usb_submit_urb(read urb)"); dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
} }
} }
...@@ -384,15 +384,15 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -384,15 +384,15 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
struct cyberjack_private *priv = (struct cyberjack_private *)port->private; struct cyberjack_private *priv = (struct cyberjack_private *)port->private;
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
dbg(__FUNCTION__ " - port %d", port->number); dbg("%s - port %d", __FUNCTION__, port->number);
if (!serial) { if (!serial) {
dbg(__FUNCTION__ " - bad serial pointer, exiting"); dbg("%s - bad serial pointer, exiting", __FUNCTION__);
return; return;
} }
if (urb->status) { if (urb->status) {
dbg(__FUNCTION__ " - nonzero write bulk status received: %d", urb->status); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
return; return;
} }
...@@ -401,11 +401,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -401,11 +401,11 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
int length, blksize, result; int length, blksize, result;
if (port->write_urb->status == -EINPROGRESS) { if (port->write_urb->status == -EINPROGRESS) {
dbg (__FUNCTION__ " - already writing"); dbg("%s - already writing", __FUNCTION__);
return; return;
} }
dbg(__FUNCTION__ " - transmitting data (frame n)"); dbg("%s - transmitting data (frame n)", __FUNCTION__);
length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ? length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ?
port->bulk_out_size : (priv->wrfilled - priv->wrsent); port->bulk_out_size : (priv->wrfilled - priv->wrsent);
...@@ -426,7 +426,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -426,7 +426,7 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
/* send the data out the bulk port */ /* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) { if (result) {
err(__FUNCTION__ " - failed submitting write urb, error %d", result); err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
/* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
...@@ -435,13 +435,13 @@ static void cyberjack_write_bulk_callback (struct urb *urb) ...@@ -435,13 +435,13 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
return; return;
} }
dbg(__FUNCTION__ " - priv->wrsent=%d",priv->wrsent); dbg("%s - priv->wrsent=%d", __FUNCTION__,priv->wrsent);
dbg(__FUNCTION__ " - priv->wrfilled=%d",priv->wrfilled); dbg("%s - priv->wrfilled=%d", __FUNCTION__,priv->wrfilled);
blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3; blksize = ((int)priv->wrbuf[2]<<8)+priv->wrbuf[1]+3;
if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) { if( (priv->wrsent>=priv->wrfilled) || (priv->wrsent>=blksize) ) {
dbg(__FUNCTION__ " - buffer cleaned"); dbg("%s - buffer cleaned", __FUNCTION__);
memset( priv->wrbuf, 0, sizeof(priv->wrbuf) ); memset( priv->wrbuf, 0, sizeof(priv->wrbuf) );
priv->wrfilled=0; priv->wrfilled=0;
priv->wrsent=0; priv->wrsent=0;
......
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