diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-12-14 15:45:45 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-03-24 15:56:39 -0400 |
commit | 2dbd7d7e2327b0c2cc4e2de903e1cfa19980a504 (patch) | |
tree | c0efb5bbd26bc2e18a61bf44d0c53db9494a096c /drivers | |
parent | c490a6dec6cc1b7f0eab56b9fbd565129b3dea2e (diff) |
firewire: standardize a variable name
"ret" is the new "retval".
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firewire/fw-cdev.c | 44 | ||||
-rw-r--r-- | drivers/firewire/fw-iso.c | 12 | ||||
-rw-r--r-- | drivers/firewire/fw-ohci.c | 51 | ||||
-rw-r--r-- | drivers/firewire/fw-transaction.c | 8 |
4 files changed, 57 insertions, 58 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c index 44af45205dcd..07c32a4bada2 100644 --- a/drivers/firewire/fw-cdev.c +++ b/drivers/firewire/fw-cdev.c | |||
@@ -169,13 +169,13 @@ dequeue_event(struct client *client, char __user *buffer, size_t count) | |||
169 | unsigned long flags; | 169 | unsigned long flags; |
170 | struct event *event; | 170 | struct event *event; |
171 | size_t size, total; | 171 | size_t size, total; |
172 | int i, retval; | 172 | int i, ret; |
173 | 173 | ||
174 | retval = wait_event_interruptible(client->wait, | 174 | ret = wait_event_interruptible(client->wait, |
175 | !list_empty(&client->event_list) || | 175 | !list_empty(&client->event_list) || |
176 | fw_device_is_shutdown(client->device)); | 176 | fw_device_is_shutdown(client->device)); |
177 | if (retval < 0) | 177 | if (ret < 0) |
178 | return retval; | 178 | return ret; |
179 | 179 | ||
180 | if (list_empty(&client->event_list) && | 180 | if (list_empty(&client->event_list) && |
181 | fw_device_is_shutdown(client->device)) | 181 | fw_device_is_shutdown(client->device)) |
@@ -190,17 +190,17 @@ dequeue_event(struct client *client, char __user *buffer, size_t count) | |||
190 | for (i = 0; i < ARRAY_SIZE(event->v) && total < count; i++) { | 190 | for (i = 0; i < ARRAY_SIZE(event->v) && total < count; i++) { |
191 | size = min(event->v[i].size, count - total); | 191 | size = min(event->v[i].size, count - total); |
192 | if (copy_to_user(buffer + total, event->v[i].data, size)) { | 192 | if (copy_to_user(buffer + total, event->v[i].data, size)) { |
193 | retval = -EFAULT; | 193 | ret = -EFAULT; |
194 | goto out; | 194 | goto out; |
195 | } | 195 | } |
196 | total += size; | 196 | total += size; |
197 | } | 197 | } |
198 | retval = total; | 198 | ret = total; |
199 | 199 | ||
200 | out: | 200 | out: |
201 | kfree(event); | 201 | kfree(event); |
202 | 202 | ||
203 | return retval; | 203 | return ret; |
204 | } | 204 | } |
205 | 205 | ||
206 | static ssize_t | 206 | static ssize_t |
@@ -958,7 +958,7 @@ static int | |||
958 | dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg) | 958 | dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg) |
959 | { | 959 | { |
960 | char buffer[256]; | 960 | char buffer[256]; |
961 | int retval; | 961 | int ret; |
962 | 962 | ||
963 | if (_IOC_TYPE(cmd) != '#' || | 963 | if (_IOC_TYPE(cmd) != '#' || |
964 | _IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers)) | 964 | _IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers)) |
@@ -970,9 +970,9 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg) | |||
970 | return -EFAULT; | 970 | return -EFAULT; |
971 | } | 971 | } |
972 | 972 | ||
973 | retval = ioctl_handlers[_IOC_NR(cmd)](client, buffer); | 973 | ret = ioctl_handlers[_IOC_NR(cmd)](client, buffer); |
974 | if (retval < 0) | 974 | if (ret < 0) |
975 | return retval; | 975 | return ret; |
976 | 976 | ||
977 | if (_IOC_DIR(cmd) & _IOC_READ) { | 977 | if (_IOC_DIR(cmd) & _IOC_READ) { |
978 | if (_IOC_SIZE(cmd) > sizeof(buffer) || | 978 | if (_IOC_SIZE(cmd) > sizeof(buffer) || |
@@ -980,7 +980,7 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg) | |||
980 | return -EFAULT; | 980 | return -EFAULT; |
981 | } | 981 | } |
982 | 982 | ||
983 | return retval; | 983 | return ret; |
984 | } | 984 | } |
985 | 985 | ||
986 | static long | 986 | static long |
@@ -1014,7 +1014,7 @@ static int fw_device_op_mmap(struct file *file, struct vm_area_struct *vma) | |||
1014 | struct client *client = file->private_data; | 1014 | struct client *client = file->private_data; |
1015 | enum dma_data_direction direction; | 1015 | enum dma_data_direction direction; |
1016 | unsigned long size; | 1016 | unsigned long size; |
1017 | int page_count, retval; | 1017 | int page_count, ret; |
1018 | 1018 | ||
1019 | if (fw_device_is_shutdown(client->device)) | 1019 | if (fw_device_is_shutdown(client->device)) |
1020 | return -ENODEV; | 1020 | return -ENODEV; |
@@ -1040,16 +1040,16 @@ static int fw_device_op_mmap(struct file *file, struct vm_area_struct *vma) | |||
1040 | else | 1040 | else |
1041 | direction = DMA_FROM_DEVICE; | 1041 | direction = DMA_FROM_DEVICE; |
1042 | 1042 | ||
1043 | retval = fw_iso_buffer_init(&client->buffer, client->device->card, | 1043 | ret = fw_iso_buffer_init(&client->buffer, client->device->card, |
1044 | page_count, direction); | 1044 | page_count, direction); |
1045 | if (retval < 0) | 1045 | if (ret < 0) |
1046 | return retval; | 1046 | return ret; |
1047 | 1047 | ||
1048 | retval = fw_iso_buffer_map(&client->buffer, vma); | 1048 | ret = fw_iso_buffer_map(&client->buffer, vma); |
1049 | if (retval < 0) | 1049 | if (ret < 0) |
1050 | fw_iso_buffer_destroy(&client->buffer, client->device->card); | 1050 | fw_iso_buffer_destroy(&client->buffer, client->device->card); |
1051 | 1051 | ||
1052 | return retval; | 1052 | return ret; |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | static int shutdown_resource(int id, void *p, void *data) | 1055 | static int shutdown_resource(int id, void *p, void *data) |
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c index e14c03dc0065..cb32b20da9a0 100644 --- a/drivers/firewire/fw-iso.c +++ b/drivers/firewire/fw-iso.c | |||
@@ -32,7 +32,7 @@ int | |||
32 | fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | 32 | fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, |
33 | int page_count, enum dma_data_direction direction) | 33 | int page_count, enum dma_data_direction direction) |
34 | { | 34 | { |
35 | int i, j, retval = -ENOMEM; | 35 | int i, j; |
36 | dma_addr_t address; | 36 | dma_addr_t address; |
37 | 37 | ||
38 | buffer->page_count = page_count; | 38 | buffer->page_count = page_count; |
@@ -69,19 +69,19 @@ fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | |||
69 | kfree(buffer->pages); | 69 | kfree(buffer->pages); |
70 | out: | 70 | out: |
71 | buffer->pages = NULL; | 71 | buffer->pages = NULL; |
72 | return retval; | 72 | return -ENOMEM; |
73 | } | 73 | } |
74 | 74 | ||
75 | int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma) | 75 | int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma) |
76 | { | 76 | { |
77 | unsigned long uaddr; | 77 | unsigned long uaddr; |
78 | int i, retval; | 78 | int i, ret; |
79 | 79 | ||
80 | uaddr = vma->vm_start; | 80 | uaddr = vma->vm_start; |
81 | for (i = 0; i < buffer->page_count; i++) { | 81 | for (i = 0; i < buffer->page_count; i++) { |
82 | retval = vm_insert_page(vma, uaddr, buffer->pages[i]); | 82 | ret = vm_insert_page(vma, uaddr, buffer->pages[i]); |
83 | if (retval) | 83 | if (ret) |
84 | return retval; | 84 | return ret; |
85 | uaddr += PAGE_SIZE; | 85 | uaddr += PAGE_SIZE; |
86 | } | 86 | } |
87 | 87 | ||
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c index bbfd6cdac668..b941ab3da18e 100644 --- a/drivers/firewire/fw-ohci.c +++ b/drivers/firewire/fw-ohci.c | |||
@@ -1209,7 +1209,7 @@ static void | |||
1209 | at_context_transmit(struct context *ctx, struct fw_packet *packet) | 1209 | at_context_transmit(struct context *ctx, struct fw_packet *packet) |
1210 | { | 1210 | { |
1211 | unsigned long flags; | 1211 | unsigned long flags; |
1212 | int retval; | 1212 | int ret; |
1213 | 1213 | ||
1214 | spin_lock_irqsave(&ctx->ohci->lock, flags); | 1214 | spin_lock_irqsave(&ctx->ohci->lock, flags); |
1215 | 1215 | ||
@@ -1220,10 +1220,10 @@ at_context_transmit(struct context *ctx, struct fw_packet *packet) | |||
1220 | return; | 1220 | return; |
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | retval = at_context_queue_packet(ctx, packet); | 1223 | ret = at_context_queue_packet(ctx, packet); |
1224 | spin_unlock_irqrestore(&ctx->ohci->lock, flags); | 1224 | spin_unlock_irqrestore(&ctx->ohci->lock, flags); |
1225 | 1225 | ||
1226 | if (retval < 0) | 1226 | if (ret < 0) |
1227 | packet->callback(packet, &ctx->ohci->card, packet->ack); | 1227 | packet->callback(packet, &ctx->ohci->card, packet->ack); |
1228 | 1228 | ||
1229 | } | 1229 | } |
@@ -1595,7 +1595,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length) | |||
1595 | { | 1595 | { |
1596 | struct fw_ohci *ohci; | 1596 | struct fw_ohci *ohci; |
1597 | unsigned long flags; | 1597 | unsigned long flags; |
1598 | int retval = -EBUSY; | 1598 | int ret = -EBUSY; |
1599 | __be32 *next_config_rom; | 1599 | __be32 *next_config_rom; |
1600 | dma_addr_t uninitialized_var(next_config_rom_bus); | 1600 | dma_addr_t uninitialized_var(next_config_rom_bus); |
1601 | 1601 | ||
@@ -1649,7 +1649,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length) | |||
1649 | 1649 | ||
1650 | reg_write(ohci, OHCI1394_ConfigROMmap, | 1650 | reg_write(ohci, OHCI1394_ConfigROMmap, |
1651 | ohci->next_config_rom_bus); | 1651 | ohci->next_config_rom_bus); |
1652 | retval = 0; | 1652 | ret = 0; |
1653 | } | 1653 | } |
1654 | 1654 | ||
1655 | spin_unlock_irqrestore(&ohci->lock, flags); | 1655 | spin_unlock_irqrestore(&ohci->lock, flags); |
@@ -1661,13 +1661,13 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length) | |||
1661 | * controller could need to access it before the bus reset | 1661 | * controller could need to access it before the bus reset |
1662 | * takes effect. | 1662 | * takes effect. |
1663 | */ | 1663 | */ |
1664 | if (retval == 0) | 1664 | if (ret == 0) |
1665 | fw_core_initiate_bus_reset(&ohci->card, 1); | 1665 | fw_core_initiate_bus_reset(&ohci->card, 1); |
1666 | else | 1666 | else |
1667 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | 1667 | dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, |
1668 | next_config_rom, next_config_rom_bus); | 1668 | next_config_rom, next_config_rom_bus); |
1669 | 1669 | ||
1670 | return retval; | 1670 | return ret; |
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | static void ohci_send_request(struct fw_card *card, struct fw_packet *packet) | 1673 | 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) | |||
1689 | struct fw_ohci *ohci = fw_ohci(card); | 1689 | struct fw_ohci *ohci = fw_ohci(card); |
1690 | struct context *ctx = &ohci->at_request_ctx; | 1690 | struct context *ctx = &ohci->at_request_ctx; |
1691 | struct driver_data *driver_data = packet->driver_data; | 1691 | struct driver_data *driver_data = packet->driver_data; |
1692 | int retval = -ENOENT; | 1692 | int ret = -ENOENT; |
1693 | 1693 | ||
1694 | tasklet_disable(&ctx->tasklet); | 1694 | tasklet_disable(&ctx->tasklet); |
1695 | 1695 | ||
@@ -1704,12 +1704,11 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) | |||
1704 | driver_data->packet = NULL; | 1704 | driver_data->packet = NULL; |
1705 | packet->ack = RCODE_CANCELLED; | 1705 | packet->ack = RCODE_CANCELLED; |
1706 | packet->callback(packet, &ohci->card, packet->ack); | 1706 | packet->callback(packet, &ohci->card, packet->ack); |
1707 | retval = 0; | 1707 | ret = 0; |
1708 | |||
1709 | out: | 1708 | out: |
1710 | tasklet_enable(&ctx->tasklet); | 1709 | tasklet_enable(&ctx->tasklet); |
1711 | 1710 | ||
1712 | return retval; | 1711 | return ret; |
1713 | } | 1712 | } |
1714 | 1713 | ||
1715 | static int | 1714 | static int |
@@ -1720,7 +1719,7 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) | |||
1720 | #else | 1719 | #else |
1721 | struct fw_ohci *ohci = fw_ohci(card); | 1720 | struct fw_ohci *ohci = fw_ohci(card); |
1722 | unsigned long flags; | 1721 | unsigned long flags; |
1723 | int n, retval = 0; | 1722 | int n, ret = 0; |
1724 | 1723 | ||
1725 | /* | 1724 | /* |
1726 | * FIXME: Make sure this bitmask is cleared when we clear the busReset | 1725 | * 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) | |||
1730 | spin_lock_irqsave(&ohci->lock, flags); | 1729 | spin_lock_irqsave(&ohci->lock, flags); |
1731 | 1730 | ||
1732 | if (ohci->generation != generation) { | 1731 | if (ohci->generation != generation) { |
1733 | retval = -ESTALE; | 1732 | ret = -ESTALE; |
1734 | goto out; | 1733 | goto out; |
1735 | } | 1734 | } |
1736 | 1735 | ||
@@ -1748,7 +1747,8 @@ ohci_enable_phys_dma(struct fw_card *card, int node_id, int generation) | |||
1748 | flush_writes(ohci); | 1747 | flush_writes(ohci); |
1749 | out: | 1748 | out: |
1750 | spin_unlock_irqrestore(&ohci->lock, flags); | 1749 | spin_unlock_irqrestore(&ohci->lock, flags); |
1751 | return retval; | 1750 | |
1751 | return ret; | ||
1752 | #endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ | 1752 | #endif /* CONFIG_FIREWIRE_OHCI_REMOTE_DMA */ |
1753 | } | 1753 | } |
1754 | 1754 | ||
@@ -1892,7 +1892,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size) | |||
1892 | descriptor_callback_t callback; | 1892 | descriptor_callback_t callback; |
1893 | u32 *mask, regs; | 1893 | u32 *mask, regs; |
1894 | unsigned long flags; | 1894 | unsigned long flags; |
1895 | int index, retval = -ENOMEM; | 1895 | int index, ret = -ENOMEM; |
1896 | 1896 | ||
1897 | if (type == FW_ISO_CONTEXT_TRANSMIT) { | 1897 | if (type == FW_ISO_CONTEXT_TRANSMIT) { |
1898 | mask = &ohci->it_context_mask; | 1898 | mask = &ohci->it_context_mask; |
@@ -1928,8 +1928,8 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size) | |||
1928 | if (ctx->header == NULL) | 1928 | if (ctx->header == NULL) |
1929 | goto out; | 1929 | goto out; |
1930 | 1930 | ||
1931 | retval = context_init(&ctx->context, ohci, regs, callback); | 1931 | ret = context_init(&ctx->context, ohci, regs, callback); |
1932 | if (retval < 0) | 1932 | if (ret < 0) |
1933 | goto out_with_header; | 1933 | goto out_with_header; |
1934 | 1934 | ||
1935 | return &ctx->base; | 1935 | return &ctx->base; |
@@ -1941,7 +1941,7 @@ ohci_allocate_iso_context(struct fw_card *card, int type, size_t header_size) | |||
1941 | *mask |= 1 << index; | 1941 | *mask |= 1 << index; |
1942 | spin_unlock_irqrestore(&ohci->lock, flags); | 1942 | spin_unlock_irqrestore(&ohci->lock, flags); |
1943 | 1943 | ||
1944 | return ERR_PTR(retval); | 1944 | return ERR_PTR(ret); |
1945 | } | 1945 | } |
1946 | 1946 | ||
1947 | static int ohci_start_iso(struct fw_iso_context *base, | 1947 | static int ohci_start_iso(struct fw_iso_context *base, |
@@ -2291,21 +2291,20 @@ ohci_queue_iso(struct fw_iso_context *base, | |||
2291 | { | 2291 | { |
2292 | struct iso_context *ctx = container_of(base, struct iso_context, base); | 2292 | struct iso_context *ctx = container_of(base, struct iso_context, base); |
2293 | unsigned long flags; | 2293 | unsigned long flags; |
2294 | int retval; | 2294 | int ret; |
2295 | 2295 | ||
2296 | spin_lock_irqsave(&ctx->context.ohci->lock, flags); | 2296 | spin_lock_irqsave(&ctx->context.ohci->lock, flags); |
2297 | if (base->type == FW_ISO_CONTEXT_TRANSMIT) | 2297 | if (base->type == FW_ISO_CONTEXT_TRANSMIT) |
2298 | retval = ohci_queue_iso_transmit(base, packet, buffer, payload); | 2298 | ret = ohci_queue_iso_transmit(base, packet, buffer, payload); |
2299 | else if (ctx->context.ohci->use_dualbuffer) | 2299 | else if (ctx->context.ohci->use_dualbuffer) |
2300 | retval = ohci_queue_iso_receive_dualbuffer(base, packet, | 2300 | ret = ohci_queue_iso_receive_dualbuffer(base, packet, |
2301 | buffer, payload); | 2301 | buffer, payload); |
2302 | else | 2302 | else |
2303 | retval = ohci_queue_iso_receive_packet_per_buffer(base, packet, | 2303 | ret = ohci_queue_iso_receive_packet_per_buffer(base, packet, |
2304 | buffer, | 2304 | buffer, payload); |
2305 | payload); | ||
2306 | spin_unlock_irqrestore(&ctx->context.ohci->lock, flags); | 2305 | spin_unlock_irqrestore(&ctx->context.ohci->lock, flags); |
2307 | 2306 | ||
2308 | return retval; | 2307 | return ret; |
2309 | } | 2308 | } |
2310 | 2309 | ||
2311 | static const struct fw_card_driver ohci_driver = { | 2310 | static const struct fw_card_driver ohci_driver = { |
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c index 058f5ed24390..e17ebc42f12c 100644 --- a/drivers/firewire/fw-transaction.c +++ b/drivers/firewire/fw-transaction.c | |||
@@ -943,11 +943,11 @@ static struct fw_descriptor model_id_descriptor = { | |||
943 | 943 | ||
944 | static int __init fw_core_init(void) | 944 | static int __init fw_core_init(void) |
945 | { | 945 | { |
946 | int retval; | 946 | int ret; |
947 | 947 | ||
948 | retval = bus_register(&fw_bus_type); | 948 | ret = bus_register(&fw_bus_type); |
949 | if (retval < 0) | 949 | if (ret < 0) |
950 | return retval; | 950 | return ret; |
951 | 951 | ||
952 | fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops); | 952 | fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops); |
953 | if (fw_cdev_major < 0) { | 953 | if (fw_cdev_major < 0) { |