firewire: standardize a variable name
"ret" is the new "retval". Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
parent
c490a6dec6
commit
2dbd7d7e23
4 changed files with 57 additions and 58 deletions
|
@ -169,13 +169,13 @@ dequeue_event(struct client *client, char __user *buffer, size_t count)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct event *event;
|
struct event *event;
|
||||||
size_t size, total;
|
size_t size, total;
|
||||||
int i, retval;
|
int i, ret;
|
||||||
|
|
||||||
retval = wait_event_interruptible(client->wait,
|
ret = wait_event_interruptible(client->wait,
|
||||||
!list_empty(&client->event_list) ||
|
!list_empty(&client->event_list) ||
|
||||||
fw_device_is_shutdown(client->device));
|
fw_device_is_shutdown(client->device));
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
return retval;
|
return ret;
|
||||||
|
|
||||||
if (list_empty(&client->event_list) &&
|
if (list_empty(&client->event_list) &&
|
||||||
fw_device_is_shutdown(client->device))
|
fw_device_is_shutdown(client->device))
|
||||||
|
@ -190,17 +190,17 @@ dequeue_event(struct client *client, char __user *buffer, size_t count)
|
||||||
for (i = 0; i < ARRAY_SIZE(event->v) && total < count; i++) {
|
for (i = 0; i < ARRAY_SIZE(event->v) && total < count; i++) {
|
||||||
size = min(event->v[i].size, count - total);
|
size = min(event->v[i].size, count - total);
|
||||||
if (copy_to_user(buffer + total, event->v[i].data, size)) {
|
if (copy_to_user(buffer + total, event->v[i].data, size)) {
|
||||||
retval = -EFAULT;
|
ret = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
total += size;
|
total += size;
|
||||||
}
|
}
|
||||||
retval = total;
|
ret = total;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
kfree(event);
|
kfree(event);
|
||||||
|
|
||||||
return retval;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t
|
static ssize_t
|
||||||
|
@ -958,7 +958,7 @@ static int
|
||||||
dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
|
dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
|
||||||
{
|
{
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
int retval;
|
int ret;
|
||||||
|
|
||||||
if (_IOC_TYPE(cmd) != '#' ||
|
if (_IOC_TYPE(cmd) != '#' ||
|
||||||
_IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers))
|
_IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers))
|
||||||
|
@ -970,9 +970,9 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = ioctl_handlers[_IOC_NR(cmd)](client, buffer);
|
ret = ioctl_handlers[_IOC_NR(cmd)](client, buffer);
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
return retval;
|
return ret;
|
||||||
|
|
||||||
if (_IOC_DIR(cmd) & _IOC_READ) {
|
if (_IOC_DIR(cmd) & _IOC_READ) {
|
||||||
if (_IOC_SIZE(cmd) > sizeof(buffer) ||
|
if (_IOC_SIZE(cmd) > sizeof(buffer) ||
|
||||||
|
@ -980,7 +980,7 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long
|
static long
|
||||||
|
@ -1014,7 +1014,7 @@ static int fw_device_op_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
struct client *client = file->private_data;
|
struct client *client = file->private_data;
|
||||||
enum dma_data_direction direction;
|
enum dma_data_direction direction;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
int page_count, retval;
|
int page_count, ret;
|
||||||
|
|
||||||
if (fw_device_is_shutdown(client->device))
|
if (fw_device_is_shutdown(client->device))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@ -1040,16 +1040,16 @@ static int fw_device_op_mmap(struct file *file, struct vm_area_struct *vma)
|
||||||
else
|
else
|
||||||
direction = DMA_FROM_DEVICE;
|
direction = DMA_FROM_DEVICE;
|
||||||
|
|
||||||
retval = fw_iso_buffer_init(&client->buffer, client->device->card,
|
ret = fw_iso_buffer_init(&client->buffer, client->device->card,
|
||||||
page_count, direction);
|
page_count, direction);
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
return retval;
|
return ret;
|
||||||
|
|
||||||
retval = fw_iso_buffer_map(&client->buffer, vma);
|
ret = fw_iso_buffer_map(&client->buffer, vma);
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
fw_iso_buffer_destroy(&client->buffer, client->device->card);
|
fw_iso_buffer_destroy(&client->buffer, client->device->card);
|
||||||
|
|
||||||
return retval;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shutdown_resource(int id, void *p, void *data)
|
static int shutdown_resource(int id, void *p, void *data)
|
||||||
|
|
|
@ -32,7 +32,7 @@ int
|
||||||
fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
|
fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
|
||||||
int page_count, enum dma_data_direction direction)
|
int page_count, enum dma_data_direction direction)
|
||||||
{
|
{
|
||||||
int i, j, retval = -ENOMEM;
|
int i, j;
|
||||||
dma_addr_t address;
|
dma_addr_t address;
|
||||||
|
|
||||||
buffer->page_count = page_count;
|
buffer->page_count = page_count;
|
||||||
|
@ -69,19 +69,19 @@ fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
|
||||||
kfree(buffer->pages);
|
kfree(buffer->pages);
|
||||||
out:
|
out:
|
||||||
buffer->pages = NULL;
|
buffer->pages = NULL;
|
||||||
return retval;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma)
|
int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
unsigned long uaddr;
|
unsigned long uaddr;
|
||||||
int i, retval;
|
int i, ret;
|
||||||
|
|
||||||
uaddr = vma->vm_start;
|
uaddr = vma->vm_start;
|
||||||
for (i = 0; i < buffer->page_count; i++) {
|
for (i = 0; i < buffer->page_count; i++) {
|
||||||
retval = vm_insert_page(vma, uaddr, buffer->pages[i]);
|
ret = vm_insert_page(vma, uaddr, buffer->pages[i]);
|
||||||
if (retval)
|
if (ret)
|
||||||
return retval;
|
return ret;
|
||||||
uaddr += PAGE_SIZE;
|
uaddr += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1209,7 +1209,7 @@ static void
|
||||||
at_context_transmit(struct context *ctx, struct fw_packet *packet)
|
at_context_transmit(struct context *ctx, struct fw_packet *packet)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int retval;
|
int ret;
|
||||||
|
|
||||||
spin_lock_irqsave(&ctx->ohci->lock, flags);
|
spin_lock_irqsave(&ctx->ohci->lock, flags);
|
||||||
|
|
||||||
|
@ -1220,10 +1220,10 @@ at_context_transmit(struct context *ctx, struct fw_packet *packet)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = at_context_queue_packet(ctx, packet);
|
ret = at_context_queue_packet(ctx, packet);
|
||||||
spin_unlock_irqrestore(&ctx->ohci->lock, flags);
|
spin_unlock_irqrestore(&ctx->ohci->lock, flags);
|
||||||
|
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
packet->callback(packet, &ctx->ohci->card, packet->ack);
|
packet->callback(packet, &ctx->ohci->card, packet->ack);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1595,7 +1595,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
|
||||||
{
|
{
|
||||||
struct fw_ohci *ohci;
|
struct fw_ohci *ohci;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int retval = -EBUSY;
|
int ret = -EBUSY;
|
||||||
__be32 *next_config_rom;
|
__be32 *next_config_rom;
|
||||||
dma_addr_t uninitialized_var(next_config_rom_bus);
|
dma_addr_t uninitialized_var(next_config_rom_bus);
|
||||||
|
|
||||||
|
@ -1649,7 +1649,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
|
||||||
|
|
||||||
reg_write(ohci, OHCI1394_ConfigROMmap,
|
reg_write(ohci, OHCI1394_ConfigROMmap,
|
||||||
ohci->next_config_rom_bus);
|
ohci->next_config_rom_bus);
|
||||||
retval = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&ohci->lock, flags);
|
spin_unlock_irqrestore(&ohci->lock, flags);
|
||||||
|
@ -1661,13 +1661,13 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
|
||||||
* controller could need to access it before the bus reset
|
* controller could need to access it before the bus reset
|
||||||
* takes effect.
|
* takes effect.
|
||||||
*/
|
*/
|
||||||
if (retval == 0)
|
if (ret == 0)
|
||||||
fw_core_initiate_bus_reset(&ohci->card, 1);
|
fw_core_initiate_bus_reset(&ohci->card, 1);
|
||||||
else
|
else
|
||||||
dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
|
dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
|
||||||
next_config_rom, next_config_rom_bus);
|
next_config_rom, next_config_rom_bus);
|
||||||
|
|
||||||
return retval;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ohci_send_request(struct fw_card *card, struct fw_packet *packet)
|
static void ohci_send_request(struct fw_card *card, struct fw_packet *packet)
|
||||||
|
@ -1689,7 +1689,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
|
||||||
struct fw_ohci *ohci = fw_ohci(card);
|
struct fw_ohci *ohci = fw_ohci(card);
|
||||||
struct context *ctx = &ohci->at_request_ctx;
|
struct context *ctx = &ohci->at_request_ctx;
|
||||||
struct driver_data *driver_data = packet->driver_data;
|
struct driver_data *driver_data = packet->driver_data;
|
||||||
int retval = -ENOENT;
|
int ret = -ENOENT;
|
||||||
|
|
||||||
tasklet_disable(&ctx->tasklet);
|
tasklet_disable(&ctx->tasklet);
|
||||||
|
|
||||||
|
@ -1704,12 +1704,11 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
|
||||||
driver_data->packet = NULL;
|
driver_data->packet = NULL;
|
||||||
packet->ack = RCODE_CANCELLED;
|
packet->ack = RCODE_CANCELLED;
|
||||||
packet->callback(packet, &ohci->card, packet->ack);
|
packet->callback(packet, &ohci->card, packet->ack);
|
||||||
retval = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
tasklet_enable(&ctx->tasklet);
|
tasklet_enable(&ctx->tasklet);
|
||||||
|
|
||||||
return retval;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1720,7 +1719,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
|
||||||
#else
|
#else
|
||||||
struct fw_ohci *ohci = fw_ohci(card);
|
struct fw_ohci *ohci = fw_ohci(card);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int n, retval = 0;
|
int n, ret = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: Make sure this bitmask is cleared when we clear the busReset
|
* FIXME: Make sure this bitmask is cleared when we clear the busReset
|
||||||
|
@ -1730,7 +1729,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
|
||||||
spin_lock_irqsave(&ohci->lock, flags);
|
spin_lock_irqsave(&ohci->lock, flags);
|
||||||
|
|
||||||
if (ohci->generation != generation) {
|
if (ohci->generation != generation) {
|
||||||
retval = -ESTALE;
|
ret = -ESTALE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1748,7 +1747,8 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation)
|
||||||
flush_writes(ohci);
|
flush_writes(ohci);
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(&ohci->lock, flags);
|
spin_unlock_irqrestore(&ohci->lock, flags);
|
||||||
return retval;
|
|
||||||
|
return ret;
|
||||||
#endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */
|
#endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1892,7 +1892,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)
|
||||||
descriptor_callback_t callback;
|
descriptor_callback_t callback;
|
||||||
u32 *mask, regs;
|
u32 *mask, regs;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int index, retval = -ENOMEM;
|
int index, ret = -ENOMEM;
|
||||||
|
|
||||||
if (type == FW_ISO_CONTEXT_TRANSMIT) {
|
if (type == FW_ISO_CONTEXT_TRANSMIT) {
|
||||||
mask = &ohci->it_context_mask;
|
mask = &ohci->it_context_mask;
|
||||||
|
@ -1928,8 +1928,8 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)
|
||||||
if (ctx->header == NULL)
|
if (ctx->header == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
retval = context_init(&ctx->context, ohci, regs, callback);
|
ret = context_init(&ctx->context, ohci, regs, callback);
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
goto out_with_header;
|
goto out_with_header;
|
||||||
|
|
||||||
return &ctx->base;
|
return &ctx->base;
|
||||||
|
@ -1941,7 +1941,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size)
|
||||||
*mask |= 1 << index;
|
*mask |= 1 << index;
|
||||||
spin_unlock_irqrestore(&ohci->lock, flags);
|
spin_unlock_irqrestore(&ohci->lock, flags);
|
||||||
|
|
||||||
return ERR_PTR(retval);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ohci_start_iso(struct fw_iso_context *base,
|
static int ohci_start_iso(struct fw_iso_context *base,
|
||||||
|
@ -2291,21 +2291,20 @@ ohci_queue_iso(struct fw_iso_context *base,
|
||||||
{
|
{
|
||||||
struct iso_context *ctx = container_of(base, struct iso_context, base);
|
struct iso_context *ctx = container_of(base, struct iso_context, base);
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int retval;
|
int ret;
|
||||||
|
|
||||||
spin_lock_irqsave(&ctx->context.ohci->lock, flags);
|
spin_lock_irqsave(&ctx->context.ohci->lock, flags);
|
||||||
if (base->type == FW_ISO_CONTEXT_TRANSMIT)
|
if (base->type == FW_ISO_CONTEXT_TRANSMIT)
|
||||||
retval = ohci_queue_iso_transmit(base, packet, buffer, payload);
|
ret = ohci_queue_iso_transmit(base, packet, buffer, payload);
|
||||||
else if (ctx->context.ohci->use_dualbuffer)
|
else if (ctx->context.ohci->use_dualbuffer)
|
||||||
retval = ohci_queue_iso_receive_dualbuffer(base, packet,
|
ret = ohci_queue_iso_receive_dualbuffer(base, packet,
|
||||||
buffer, payload);
|
buffer, payload);
|
||||||
else
|
else
|
||||||
retval = ohci_queue_iso_receive_packet_per_buffer(base, packet,
|
ret = ohci_queue_iso_receive_packet_per_buffer(base, packet,
|
||||||
buffer,
|
buffer, payload);
|
||||||
payload);
|
|
||||||
spin_unlock_irqrestore(&ctx->context.ohci->lock, flags);
|
spin_unlock_irqrestore(&ctx->context.ohci->lock, flags);
|
||||||
|
|
||||||
return retval;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct fw_card_driver ohci_driver = {
|
static const struct fw_card_driver ohci_driver = {
|
||||||
|
|
|
@ -943,11 +943,11 @@ static struct fw_descriptor model_id_descriptor = {
|
||||||
|
|
||||||
static int __init fw_core_init(void)
|
static int __init fw_core_init(void)
|
||||||
{
|
{
|
||||||
int retval;
|
int ret;
|
||||||
|
|
||||||
retval = bus_register(&fw_bus_type);
|
ret = bus_register(&fw_bus_type);
|
||||||
if (retval < 0)
|
if (ret < 0)
|
||||||
return retval;
|
return ret;
|
||||||
|
|
||||||
fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops);
|
fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops);
|
||||||
if (fw_cdev_major < 0) {
|
if (fw_cdev_major < 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue