* device/ds_routines.c: Coding style changes. --- device/ds_routines.c | 80 ++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 40 deletions(-)
diff --git a/device/ds_routines.c b/device/ds_routines.c index 73571dc..12b0fa9 100644 --- a/device/ds_routines.c +++ b/device/ds_routines.c @@ -326,8 +326,8 @@ ds_notify (mach_msg_header_t *msg) device_t dev; mach_no_senders_notification_t *ns; - ns = (mach_no_senders_notification_t *) msg; - dev = dev_port_lookup((ipc_port_t) ns->not_header.msgh_remote_port); + ns = (mach_no_senders_notification_t *)msg; + dev = dev_port_lookup((ipc_port_t)ns->not_header.msgh_remote_port); assert(dev); if (dev->emul_ops->no_senders) (*dev->emul_ops->no_senders) (ns); @@ -421,7 +421,7 @@ device_open(reply_port, reply_port_type, mode, name, device_p) ipc_port_t reply_port; mach_msg_type_name_t reply_port_type; dev_mode_t mode; - char * name; + char *name; device_t *device_p; /* out */ { mach_device_t device; @@ -529,7 +529,7 @@ device_open(reply_port, reply_port_type, mode, name, device_p) * Return result via ds_open_done. */ ior->io_error = result; - (void) ds_open_done(ior); + (void)ds_open_done(ior); io_req_free(ior); @@ -586,10 +586,10 @@ ds_open_done(ior) * (thus cannot get translation). */ if (IP_VALID(ior->io_reply_port)) { - (void) ds_device_open_reply(ior->io_reply_port, - ior->io_reply_port_type, - result, - mach_convert_device_to_port(device)); + (void)ds_device_open_reply(ior->io_reply_port, + ior->io_reply_port_type, + result, + mach_convert_device_to_port(device)); } else mach_device_deallocate(device); @@ -857,7 +857,7 @@ device_write_get(ior, wait) if (ior->io_op & IO_INBAND) { assert(ior->io_count <= sizeof (io_buf_ptr_inband_t)); new_addr = kmem_cache_alloc(&io_inband_cache); - memcpy((void*)new_addr, ior->io_data, ior->io_count); + memcpy((void *)new_addr, ior->io_data, ior->io_count); ior->io_data = (io_buf_ptr_t)new_addr; ior->io_alloc_size = sizeof (io_buf_ptr_inband_t); @@ -875,19 +875,19 @@ device_write_get(ior, wait) D_INFO_BLOCK_SIZE, &bsize); - if (result != KERN_SUCCESS || ior->io_count < (vm_size_t) bsize) - min_size = (vm_size_t) ior->io_count; + if (result != KERN_SUCCESS || ior->io_count < (vm_size_t)bsize) + min_size = (vm_size_t)ior->io_count; else - min_size = (vm_size_t) bsize; + min_size = (vm_size_t)bsize; /* * Map the pages from this page list into memory. * io_data records location of data. * io_alloc_size is the vm size of the region to deallocate. */ - io_copy = (vm_map_copy_t) ior->io_data; + io_copy = (vm_map_copy_t)ior->io_data; result = kmem_io_map_copyout(device_io_map, - (vm_offset_t*)&ior->io_data, &new_addr, + (vm_offset_t *)&ior->io_data, &new_addr, &ior->io_alloc_size, io_copy, min_size); if (result != KERN_SUCCESS) return (result); @@ -1007,7 +1007,7 @@ device_write_dealloc(ior) */ vm_map_copy_discard(ior->io_copy); ior->io_copy = VM_MAP_COPY_NULL; - ior->io_data = (char *) new_copy; + ior->io_data = (char *)new_copy; /* * Return FALSE if there's more IO to do. @@ -1049,13 +1049,13 @@ ds_write_done(ior) */ if (IP_VALID(ior->io_reply_port)) { - (void) (*((ior->io_op & IO_INBAND) ? + (void)(*((ior->io_op & IO_INBAND) ? ds_device_write_reply_inband : ds_device_write_reply))(ior->io_reply_port, ior->io_reply_port_type, ior->io_error, - (int) (ior->io_total - - ior->io_residual)); + (int)(ior->io_total - + ior->io_residual)); } mach_device_deallocate(ior->io_device); @@ -1138,7 +1138,7 @@ device_read(device, reply_port, reply_port_type, mode, recnum, * Return result via ds_read_done. */ ior->io_error = result; - (void) ds_read_done(ior); + (void)ds_read_done(ior); io_req_free(ior); return (MIG_NO_REPLY); /* reply has already been sent. */ @@ -1222,7 +1222,7 @@ device_read_inband(device, reply_port, reply_port_type, mode, recnum, * Return result, via ds_read_done. */ ior->io_error = result; - (void) ds_read_done(ior); + (void)ds_read_done(ior); io_req_free(ior); return (MIG_NO_REPLY); /* reply has already been sent. */ @@ -1312,7 +1312,7 @@ boolean_t ds_read_done(ior) (void)ds_device_read_reply_inband(ior->io_reply_port, ior->io_reply_port_type, ior->io_error, - (char *) start_data, + (char *)start_data, size_read); } else { vm_map_copy_t copy; @@ -1328,7 +1328,7 @@ boolean_t ds_read_done(ior) (void)ds_device_read_reply(ior->io_reply_port, ior->io_reply_port_type, ior->io_error, - (char *) copy, + (char *)copy, size_read); } @@ -1344,9 +1344,9 @@ boolean_t ds_read_done(ior) end_alloc = start_sent + round_page(ior->io_alloc_size); if (end_alloc > end_sent) - (void) vm_deallocate(kernel_map, - end_sent, - end_alloc - end_sent); + (void)vm_deallocate(kernel_map, + end_sent, + end_alloc - end_sent); } } @@ -1438,7 +1438,7 @@ device_map(device, protection, offset, size, pager, unmap) /* XXX note that a CLOSE may proceed at any point */ return (device_pager_setup(device, protection, offset, size, - (mach_port_t*)pager)); + (mach_port_t *)pager)); } /* @@ -1505,7 +1505,7 @@ void io_done_thread_continue() simple_lock(&io_done_list_lock); while ((ior = (io_req_t)dequeue_head(&io_done_list)) != 0) { simple_unlock(&io_done_list_lock); - (void) splx(s); + (void)splx(s); if ((*ior->io_done)(ior)) { /* @@ -1521,7 +1521,7 @@ void io_done_thread_continue() assert_wait(&io_done_list, FALSE); simple_unlock(&io_done_list_lock); - (void) splx(s); + (void)splx(s); counter(c_io_done_thread_block++); thread_block(io_done_thread_continue); } @@ -1586,10 +1586,10 @@ void iowait(ior) s = splio(); ior_lock(ior); - while ((ior->io_op&IO_DONE)==0) { + while ((ior->io_op & IO_DONE) == 0) { assert_wait((event_t)ior, FALSE); ior_unlock(ior); - thread_block((void (*)()) 0); + thread_block((void (*)())0); ior_lock(ior); } ior_unlock(ior); @@ -1632,7 +1632,7 @@ mach_device_trap_init(void) io_req_t ds_trap_req_alloc(mach_device_t device, vm_size_t data_size) { - return (io_req_t) kmem_cache_alloc(&io_trap_cache); + return (io_req_t)kmem_cache_alloc(&io_trap_cache); } /* @@ -1648,7 +1648,7 @@ ds_trap_write_done(io_req_t ior) /* * Should look at reply port and maybe send a message. */ - kmem_cache_free(&io_trap_cache, (vm_offset_t) ior); + kmem_cache_free(&io_trap_cache, (vm_offset_t)ior); /* * Give up device reference from ds_write_trap. @@ -1724,7 +1724,7 @@ device_write_trap (mach_device_t device, dev_mode_t mode, */ mach_device_deallocate(device); - kmem_cache_free(&io_trap_cache, (vm_offset_t) ior); + kmem_cache_free(&io_trap_cache, (vm_offset_t)ior); return (result); } @@ -1787,8 +1787,8 @@ device_writev_trap (mach_device_t device, dev_mode_t mode, p = (vm_offset_t) ior->io_data; for (i = 0; i < iocount; i++) { - copyin((char *) stack_iovec[i].data, - (char *) p, + copyin((char *)stack_iovec[i].data, + (char *)p, stack_iovec[i].count); p += stack_iovec[i].count; } @@ -1821,9 +1821,9 @@ device_writev_trap (mach_device_t device, dev_mode_t mode, struct device_emulation_ops mach_device_emulation_ops = { - (void*) mach_device_reference, - (void*) mach_device_deallocate, - (void*) mach_convert_device_to_port, + (void *)mach_device_reference, + (void *)mach_device_deallocate, + (void *)mach_convert_device_to_port, device_open, device_close, device_write, @@ -1835,6 +1835,6 @@ struct device_emulation_ops mach_device_emulation_ops = device_set_filter, device_map, ds_no_senders, - (void*) device_write_trap, - (void*) device_writev_trap + (void *)device_write_trap, + (void *)device_writev_trap }; -- 1.8.1.4