dev_warn(&dev->intf->dev, "Write buffer overflow, %d bytes dropped\n",count-bytes_to_write); dbg_info(&dev->intf->dev, "%s: count = %d, bytes_to_write = %d\n", __FUNCTION__, count, bytes_to_write); 
dev_warn(&dev->intf->dev, "Write buffer overflow, %zd bytes dropped\n",count-bytes_to_write); dbg_info(&dev->intf->dev, "%s: count = %zd, bytes_to_write = %zd\n", __FUNCTION__, count, bytes_to_write); 
static ssize_t ld_usb_write(struct file *file, const char __user *buffer,			    size_t count, loff_t *ppos){	struct ld_usb *dev;	size_t bytes_to_write;	int retval = 0;	dev = file->private_data;	/* verify that we actually have some data to write */	if (count == 0)		goto exit;	/* lock this object */	if (down_interruptible(&dev->sem)) {		retval = -ERESTARTSYS;		goto exit;	}	/* verify that the device wasn't unplugged */	if (dev->intf == NULL) {		retval = -ENODEV;		err("No device or device unplugged %d\n", retval);		goto unlock_exit;	}	/* wait until previous transfer is finished */	if (dev->interrupt_out_busy) {		if (file->f_flags & O_NONBLOCK) {			retval = -EAGAIN;			goto unlock_exit;		}		retval = wait_event_interruptible(dev->write_wait, !dev->interrupt_out_busy);		if (retval < 0) {			goto unlock_exit;		}	}	/* write the data into interrupt_out_buffer from userspace */	bytes_to_write = min(count, write_buffer_size*dev->interrupt_out_endpoint_size);	if (bytes_to_write < count)		dev_warn(&dev->intf->dev, "Write buffer overflow, %d bytes dropped\n",count-bytes_to_write);	dbg_info(&dev->intf->dev, "%s: count = %d, bytes_to_write = %d\n", __FUNCTION__, count, bytes_to_write);	if (copy_from_user(dev->interrupt_out_buffer, buffer, bytes_to_write)) {		retval = -EFAULT;		goto unlock_exit;	}	if (dev->interrupt_out_endpoint == NULL) {		/* try HID_REQ_SET_REPORT=9 on control_endpoint instead of interrupt_out_endpoint */		retval = usb_control_msg(interface_to_usbdev(dev->intf),					 usb_sndctrlpipe(interface_to_usbdev(dev->intf), 0),					 9,					 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT,					 1 << 8, 0,					 dev->interrupt_out_buffer,					 bytes_to_write,					 USB_CTRL_SET_TIMEOUT * HZ);		if (retval < 0)			err("Couldn't submit HID_REQ_SET_REPORT %d\n", retval);		goto unlock_exit;	}	/* send off the urb */	usb_fill_int_urb(dev->interrupt_out_urb,			 interface_to_usbdev(dev->intf),			 usb_sndintpipe(interface_to_usbdev(dev->intf),					dev->interrupt_out_endpoint->bEndpointAddress),			 dev->interrupt_out_buffer,			 bytes_to_write,			 ld_usb_interrupt_out_callback,			 dev,			 dev->interrupt_out_interval);	dev->interrupt_out_busy = 1;	wmb();	retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL);	if (retval) {		dev->interrupt_out_busy = 0;		err("Couldn't submit interrupt_out_urb %d\n", retval);		goto unlock_exit;	}	retval = bytes_to_write;unlock_exit:	/* unlock the device */	up(&dev->sem);exit:	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/dd7d50081f5dafd9392bd79f1ec90d553a7303c9/ldusb.c/buggy/drivers/usb/misc/ldusb.c