dev_warn(&dev->intf->dev, "Read buffer overflow, %d bytes dropped\n", 
dev_warn(&dev->intf->dev, "Read buffer overflow, %zd bytes dropped\n", 
static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,			   loff_t *ppos){	struct ld_usb *dev;	size_t *actual_buffer;	size_t bytes_to_read;	int retval = 0;	dev = file->private_data;	/* verify that we actually have some data to read */	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 for data */	if (dev->ring_head == dev->ring_tail) {		if (file->f_flags & O_NONBLOCK) {			retval = -EAGAIN;			goto unlock_exit;		}		retval = wait_event_interruptible(dev->read_wait, dev->interrupt_in_done);		if (retval < 0)			goto unlock_exit;	}	/* actual_buffer contains actual_length + interrupt_in_buffer */	actual_buffer = (size_t*)(dev->ring_buffer + dev->ring_tail*(sizeof(size_t)+dev->interrupt_in_endpoint_size));	bytes_to_read = min(count, *actual_buffer);	if (bytes_to_read < *actual_buffer)		dev_warn(&dev->intf->dev, "Read buffer overflow, %d bytes dropped\n",			 *actual_buffer-bytes_to_read);	/* copy one interrupt_in_buffer from ring_buffer into userspace */	if (copy_to_user(buffer, actual_buffer+1, bytes_to_read)) {		retval = -EFAULT;		goto unlock_exit;	}	dev->ring_tail = (dev->ring_tail+1) % ring_buffer_size;	retval = bytes_to_read;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