[PATCH 08/45] staging: unisys: visorbus: visorbus_main.c: cleanup and consolidate comments
Use all 80 characters of the line for comments to help reduce the number of extra lines in the code. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 44 +++-- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 2bc7ff7..f8236da 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -198,7 +198,7 @@ static void visorbus_release_device(struct device *xdev) } /* - * begin implementation of specific channel attributes to appear under + * BUS specific channel attributes to appear under * /sys/bus/visorbus/dev/channel */ @@ -284,8 +284,6 @@ static ssize_t typename_show(struct device *dev, struct device_attribute *attr, ATTRIBUTE_GROUPS(channel); -/* end implementation of specific channel attributes */ - /* * BUS instance attributes * @@ -546,8 +544,7 @@ void visorbus_unregister_visor_driver(struct visor_driver *drv) * @dest: the destination buffer that is written into from the channel * @nbytes: the number of bytes to read from the channel * - * If receiving a message, use the visorchannel_signalremove() - * function instead. + * If receiving a message, use the visorchannel_signalremove() function instead. * * Return: integer indicating success (zero) or failure (non-zero) */ @@ -566,8 +563,7 @@ int visorbus_read_channel(struct visor_device *dev, unsigned long offset, * @src:the source buffer that is written into the channel * @nbytes: the number of bytes to write into the channel * - * If sending a message, use the visorchannel_signalinsert() - * function instead. + * If sending a message, use the visorchannel_signalinsert() function instead. * * Return: integer indicating success (zero) or failure (non-zero) */ @@ -618,17 +614,16 @@ void visorbus_disable_channel_interrupts(struct visor_device *dev) * * This is how everything starts from the device end. * This function is called when a channel first appears via a ControlVM - * message. In response, this function allocates a visor_device to - * correspond to the new channel, and attempts to connect it the appropriate - * driver. If the appropriate driver is found, the visor_driver.probe() - * function for that driver will be called, and will be passed the new - * visor_device that we just created. + * message. In response, this function allocates a visor_device to correspond + * to the new channel, and attempts to connect it the appropriate * driver. If + * the appropriate driver is found, the visor_driver.probe() function for that + * driver will be called, and will be passed the new * visor_device that we + * just created. * * It's ok if the appropriate driver is not yet loaded, because in that case * the new device struct will just stick around in the bus' list of devices. * When the appropriate driver calls visorbus_register_visor_driver(), the - * visor_driver.probe() for the new driver will be called with the new - * device. + * visor_driver.probe() for the new driver will be called with the new device. * * Return: 0 if successful, otherwise the negative value returned by * device_add() indicating the reason for failure @@ -649,9 +644,9 @@ int create_visor_device(struct visor_device *dev) setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev); /* -* bus_id must be a unique name with respect to this bus TYPE -* (NOT bus instance). That's why we need to include the bus -* number within the name. +* bus_id must be a unique name with respect to this bus TYPE (NOT bus +* instance). That's why we need to include the bus number within the +* name. */ err = dev_set_name(&dev->device, "vbus%u:dev%u", chipset_bus_no, chipset_dev_no); @@ -671,9 +666,9 @@ int create_visor_device(struct visor_device *dev) * if (!drv.probe(dev)) [visordriver_probe_device] *dev.drv = NULL * -* Note that device_add does NOT fail if no driver failed to -* claim the device. The device will be linked onto -* bus_type.klist_devices regardless (use bus_for_each_dev). +* Note that device_add does NOT fail if no driver failed to claim the +* device. The device will be linked onto bus_type.klist_devices +* regardless (use bus_for_each_dev). */ err = device_add(&dev->device); if (err < 0) @@ -914,14 +909,13 @@ static int visordriver_probe_device(struct device *xdev) } /* - * visorbus_register_visor_driver() - registers the provided visor driver - *for handling one or more visor device + * visorbus_register_vi
[PATCH 02/45] staging: unisys: visorbus: don't need local variable cmd
The local variable cmd was just being used to dereference a field inside of it. Get rid of the variable and just derefernce the parameter being passed in. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 315000f..b7865b1 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -595,9 +595,8 @@ static int visorbus_create(struct controlvm_message *inmsg) static int visorbus_destroy(struct controlvm_message *inmsg) { - struct controlvm_message_packet *cmd = &inmsg->cmd; struct controlvm_message_header *pmsg_hdr = NULL; - u32 bus_no = cmd->destroy_bus.bus_no; + u32 bus_no = inmsg->cmd.destroy_bus.bus_no; struct visor_device *bus_info; int err; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/45] staging: unisys; visorbus: visorbus_main.c: remove extraneous newline
Use all 80 characters when calling functions. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index aa82508..589dff3 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1023,9 +1023,8 @@ int visorbus_create_instance(struct visor_device *dev) dev->debugfs_dir = debugfs_create_dir(dev_name(&dev->device), visorbus_debugfs_dir); dev->debugfs_client_bus_info = - debugfs_create_file("client_bus_info", 0440, - dev->debugfs_dir, dev, - &client_bus_info_debugfs_fops); + debugfs_create_file("client_bus_info", 0440, dev->debugfs_dir, + dev, &client_bus_info_debugfs_fops); dev_set_drvdata(&dev->device, dev); err = get_vbus_header_info(dev->visorchannel, &dev->device, hdr_info); @@ -1040,10 +1039,8 @@ int visorbus_create_instance(struct visor_device *dev) dev->state.created = 1; dev->vbus_hdr_info = (void *)hdr_info; - write_vbus_chp_info(dev->visorchannel, hdr_info, - &chipset_driverinfo); - write_vbus_bus_info(dev->visorchannel, hdr_info, - &clientbus_driverinfo); + write_vbus_chp_info(dev->visorchannel, hdr_info, &chipset_driverinfo); + write_vbus_bus_info(dev->visorchannel, hdr_info, &clientbus_driverinfo); visorbus_response(dev, err, CONTROLVM_BUS_CREATE); @@ -1126,7 +1123,6 @@ static void resume_state_change_complete(struct visor_device *dev, int status) return; dev->resuming = false; - /* * Notify the chipset driver that the resume is complete, * which will presumably want to send some sort of response to -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/45] staging: unisys: visorbus: visorchannel: use 80 characters for comments
In the file visorhcannel.c use all 80 characters for comments instead of shortening them. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchannel.c | 35 +- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 2a000fe..7665858 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -41,8 +41,8 @@ struct visorchannel { struct channel_header chan_hdr; guid_t guid; /* -* channel creator knows if more than one -* thread will be inserting or removing +* channel creator knows if more than one thread will be inserting or +* removing */ bool needs_lock; /* protect head writes in chan_hdr */ @@ -173,8 +173,8 @@ static int sig_data_offset(struct channel_header *chan_hdr, int q, } /* - * Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back - * into host memory + * Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back into + * host memory */ #define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ visorchannel_write(channel, \ @@ -240,8 +240,8 @@ static int signalremove_inner(struct visorchannel *channel, u32 queue, sig_hdr.num_received++; /* -* For each data field in SIGNAL_QUEUE_HEADER that was modified, -* update host memory. Required for channel sync. +* For each data field in SIGNAL_QUEUE_HEADER that was modified, update +* host memory. Required for channel sync. */ mb(); @@ -293,8 +293,8 @@ static bool queue_empty(struct visorchannel *channel, u32 queue) } /** - * visorchannel_signalempty() - checks if the designated channel/queue - * contains any messages + * visorchannel_signalempty() - checks if the designated channel/queue contains + * any messages * @channel: the channel to query * @queue: the queue in the channel to query * @@ -343,8 +343,8 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue, sig_hdr.num_sent++; /* -* For each data field in SIGNAL_QUEUE_HEADER that was modified, -* update host memory. Required for channel sync. +* For each data field in SIGNAL_QUEUE_HEADER that was modified, update +* host memory. Required for channel sync. */ mb(); @@ -359,9 +359,9 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue, } /* - * visorchannel_create_guts() - creates the struct visorchannel abstraction - * for a data area in memory, but does NOT modify - * this data area + * visorchannel_create_guts() - creates the struct visorchannel abstraction for + * a data area in memory, but does NOT modify this + * data area * @physaddr: physical address of start of channel * @gfp: gfp_t to use when allocating memory for the data struct * @guid: GUID that identifies channel type; @@ -392,11 +392,10 @@ static struct visorchannel *visorchannel_create_guts(u64 physaddr, gfp_t gfp, spin_lock_init(&channel->remove_lock); /* -* Video driver constains the efi framebuffer so it will get a -* conflict resource when requesting its full mem region. Since -* we are only using the efi framebuffer for video we can ignore -* this. Remember that we haven't requested it so we don't try to -* release later on. +* Video driver constains the efi framebuffer so it will get a conflict +* resource when requesting its full mem region. Since we are only +* using the efi framebuffer for video we can ignore this. Remember that +* we haven't requested it so we don't try to release later on. */ channel->requested = request_mem_region(physaddr, size, VISOR_DRV_NAME); if (!channel->requested && !guid_equal(guid, &visor_video_guid)) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/45] staging: unisys: visorbus: clean up formatting of function definitions
Consolidate function parameters onto the same line if they can fit. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 27 + 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 4a128dc..a085713 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -69,12 +69,9 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, * Note that is only needed for callers in the EFI environment, and * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages. */ -int visor_check_channel(struct channel_header *ch, - struct device *dev, - const guid_t *expected_guid, - char *chname, - u64 expected_min_bytes, - u32 expected_version, +int visor_check_channel(struct channel_header *ch, struct device *dev, + const guid_t *expected_guid, char *chname, + u64 expected_min_bytes, u32 expected_version, u64 expected_signature) { if (!guid_is_null(expected_guid)) { @@ -293,8 +290,7 @@ static ssize_t typename_show(struct device *dev, struct device_attribute *attr, */ static ssize_t partition_handle_show(struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, char *buf) { struct visor_device *vdev = to_visor_device(dev); u64 handle = visorchannel_get_clientpartition(vdev->visorchannel); @@ -304,8 +300,7 @@ static ssize_t partition_handle_show(struct device *dev, static DEVICE_ATTR_RO(partition_handle); static ssize_t partition_guid_show(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, char *buf) { struct visor_device *vdev = to_visor_device(dev); @@ -314,8 +309,7 @@ static ssize_t partition_guid_show(struct device *dev, static DEVICE_ATTR_RO(partition_guid); static ssize_t partition_name_show(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, char *buf) { struct visor_device *vdev = to_visor_device(dev); @@ -324,8 +318,7 @@ static ssize_t partition_name_show(struct device *dev, static DEVICE_ATTR_RO(partition_name); static ssize_t channel_addr_show(struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, char *buf) { struct visor_device *vdev = to_visor_device(dev); u64 addr = visorchannel_get_physaddr(vdev->visorchannel); @@ -335,8 +328,7 @@ static ssize_t channel_addr_show(struct device *dev, static DEVICE_ATTR_RO(channel_addr); static ssize_t channel_bytes_show(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, char *buf) { struct visor_device *vdev = to_visor_device(dev); u64 nbytes = visorchannel_get_nbytes(vdev->visorchannel); @@ -346,8 +338,7 @@ static ssize_t channel_bytes_show(struct device *dev, static DEVICE_ATTR_RO(channel_bytes); static ssize_t channel_id_show(struct device *dev, - struct device_attribute *attr, - char *buf) + struct device_attribute *attr, char *buf) { struct visor_device *vdev = to_visor_device(dev); int len = 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/45] staging: unisys; visorbus: visorchipset.c: remove extraneous newline
Use all 80 characters when calling functions. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 31 ++ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index ff275d0..7e494e1 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -392,8 +392,7 @@ static int chipset_init(struct controlvm_message *inmsg) } static int controlvm_respond(struct controlvm_message_header *msg_hdr, -int response, -struct visor_segment_state *state) +int response, struct visor_segment_state *state) { struct controlvm_message outmsg; @@ -452,8 +451,7 @@ static int save_crash_message(struct controlvm_message *msg, case CRASH_DEV: local_crash_msg_offset += sizeof(struct controlvm_message); err = visorchannel_write(chipset_dev->controlvm_channel, -local_crash_msg_offset, -msg, +local_crash_msg_offset, msg, sizeof(struct controlvm_message)); if (err) { dev_err(&chipset_dev->acpi_device->dev, @@ -463,8 +461,7 @@ static int save_crash_message(struct controlvm_message *msg, break; case CRASH_BUS: err = visorchannel_write(chipset_dev->controlvm_channel, -local_crash_msg_offset, -msg, +local_crash_msg_offset, msg, sizeof(struct controlvm_message)); if (err) { dev_err(&chipset_dev->acpi_device->dev, @@ -549,8 +546,7 @@ static int visorbus_create(struct controlvm_message *inmsg) } if (inmsg->hdr.flags.response_expected == 1) { - pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), - GFP_KERNEL); + pmsg_hdr = kzalloc(sizeof(*pmsg_hdr), GFP_KERNEL); if (!pmsg_hdr) { err = -ENOMEM; goto err_free_bus_info; @@ -1010,13 +1006,13 @@ static int parahotplug_request_complete(int id, u16 active) { struct list_head *pos; struct list_head *tmp; + struct parahotplug_request *req; spin_lock(¶hotplug_request_list_lock); /* Look for a request matching "id". */ list_for_each_safe(pos, tmp, ¶hotplug_request_list) { - struct parahotplug_request *req = - list_entry(pos, struct parahotplug_request, list); + req = list_entry(pos, struct parahotplug_request, list); if (req->id == id) { /* * Found a match. Remove it from the list and @@ -1216,9 +1212,7 @@ static int chipset_ready_uevent(struct controlvm_message_header *msg_hdr) { int res; - res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj, -KOBJ_ONLINE); - + res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj, KOBJ_ONLINE); if (msg_hdr->flags.response_expected) controlvm_respond(msg_hdr, res, NULL); @@ -1343,8 +1337,7 @@ static void setup_crash_devices_work_queue(struct work_struct *work) } if (local_crash_msg_count != CONTROLVM_CRASHMSG_MAX) { - dev_err(&chipset_dev->acpi_device->dev, - "invalid count\n"); + dev_err(&chipset_dev->acpi_device->dev, "invalid count\n"); return; } @@ -1409,8 +1402,8 @@ void visorbus_device_changestate_response(struct visor_device *dev_info, int response, struct visor_segment_state state) { - device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, -dev_info, response, state); + device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, dev_info, +response, state); kfree(dev_info->pending_msg_hdr); dev_info->pending_msg_hdr = NULL; @@ -1434,8 +1427,8 @@ static struct parser_context *parser_init_stream(u64 addr, u32 bytes, /* alloc an extra byte to ensure payload is \0 terminated */ allocbytes = bytes + 1 + (sizeof(struct parser_context) - sizeof(struct visor_controlvm_parameters_header)); - if ((chipset_dev->controlvm_payload_bytes_buffered + byte
[PATCH 01/45] staging: unisys: visorbus: simplify commenting in controlvm_init
During the process of udpating the features bits, put a block comment for all updates instead of a separate comment for each one. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 74cce4f..315000f 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -377,15 +377,11 @@ static int chipset_init(struct controlvm_message *inmsg) /* * Set features to indicate we support parahotplug (if Command also -* supports it). +* supports it). Set the "reply" bit so Command knows this is a +* features-aware driver. */ features = inmsg->cmd.init_chipset.features & VISOR_CHIPSET_FEATURE_PARA_HOTPLUG; - - /* -* Set the "reply" bit so Command knows this is a features-aware -* driver. -*/ features |= VISOR_CHIPSET_FEATURE_REPLY; out_respond: -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/45] staging: unisys: visorbus: keep the success path on the left
The code was indenting for the successful path and then combining the error and success path for the rest of the function. Correct it so the success path is not indented. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index ea12499..308372e 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -888,7 +888,7 @@ static void publish_vbus_dev_info(struct visor_device *visordev) */ static int visordriver_probe_device(struct device *xdev) { - int res; + int err; struct visor_driver *drv; struct visor_device *dev; @@ -898,15 +898,17 @@ static int visordriver_probe_device(struct device *xdev) mutex_lock(&dev->visordriver_callback_lock); dev->being_removed = false; - res = drv->probe(dev); - if (res >= 0) { - /* success: reference kept via unmatched get_device() */ - get_device(&dev->device); - publish_vbus_dev_info(dev); + err = drv->probe(dev); + if (err) { + mutex_unlock(&dev->visordriver_callback_lock); + return err; } + /* success: reference kept via unmatched get_device() */ + get_device(&dev->device); + publish_vbus_dev_info(dev); mutex_unlock(&dev->visordriver_callback_lock); - return res; + return 0; } /* -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/45] staging: unisys: visorbus: Remove unneeded initialization
No need to set drv to NULL. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index d10af23..56d1c16 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1138,7 +1138,7 @@ static int visorchipset_initiate_device_pause_resume(struct visor_device *dev, bool is_pause) { int err; - struct visor_driver *drv = NULL; + struct visor_driver *drv; /* If no driver associated with the device nothing to pause/resume */ if (!dev->device.driver) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/45] staging: unisys: visorbus: don't put code in declaration.
Simplify the code by not putting the assignment in the declaration. Define it and then assign it, so the function doesn't get bunched up on the right. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index b187581..7bfccc8 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1083,9 +1083,9 @@ static void remove_all_visor_devices(void) struct list_head *listentry, *listtmp; list_for_each_safe(listentry, listtmp, &list_all_device_instances) { - struct visor_device *dev = list_entry(listentry, - struct visor_device, - list_all); + struct visor_device *dev; + + dev = list_entry(listentry, struct visor_device, list_all); remove_visor_device(dev); } } @@ -1170,7 +1170,6 @@ static int visorchipset_initiate_device_pause_resume(struct visor_device *dev, dev->resuming = true; err = drv->resume(dev, resume_state_change_complete); } - return err; } @@ -1191,7 +1190,6 @@ int visorchipset_device_pause(struct visor_device *dev_info) dev_info->pausing = false; return err; } - return 0; } @@ -1243,9 +1241,9 @@ void visorbus_exit(void) remove_all_visor_devices(); list_for_each_safe(listentry, listtmp, &list_all_bus_instances) { - struct visor_device *dev = list_entry(listentry, - struct visor_device, - list_all); + struct visor_device *dev; + + dev = list_entry(listentry, struct visor_device, list_all); visorbus_remove_instance(dev); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/45] staging: unisys: visorbus: clean up parser_string_get function
The function parser_string_get was writing its own strnlen function, use the kernel version instead. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index b7865b1..ff275d0 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -641,36 +641,20 @@ static const guid_t *parser_id_get(struct parser_context *ctx) return &ctx->data.id; } -static void *parser_string_get(struct parser_context *ctx) +static void *parser_string_get(u8 *pscan, int nscan) { - u8 *pscan; - unsigned long nscan; int value_length; void *value; - int i; - pscan = ctx->curr; - if (!pscan) - return NULL; - nscan = ctx->bytes_remaining; if (nscan == 0) return NULL; - for (i = 0, value_length = -1; i < nscan; i++) - if (pscan[i] == '\0') { - value_length = i; - break; - } - /* '\0' was not included in the length */ - if (value_length < 0) - value_length = nscan; - - value = kmalloc(value_length + 1, GFP_KERNEL); + value_length = strnlen(pscan, nscan); + value = kzalloc(value_length + 1, GFP_KERNEL); if (!value) return NULL; if (value_length > 0) memcpy(value, pscan, value_length); - ((u8 *)(value))[value_length] = '\0'; return value; } @@ -685,7 +669,7 @@ static void *parser_name_get(struct parser_context *ctx) ctx->curr = (char *)&phdr + phdr->name_offset; ctx->bytes_remaining = phdr->name_length; - return parser_string_get(ctx); + return parser_string_get(ctx->curr, phdr->name_length); } static int visorbus_configure(struct controlvm_message *inmsg, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/45] staging: unisys: visorbus: visorbus_private.h remove extra blank lines
Remvoe several unneeded blank lines. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_private.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index e878d65..91f788a 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -29,11 +29,9 @@ void remove_visor_device(struct visor_device *dev_info); int visorchipset_device_pause(struct visor_device *dev_info); int visorchipset_device_resume(struct visor_device *dev_info); - void visorbus_response(struct visor_device *p, int response, int controlvm_id); void visorbus_device_changestate_response(struct visor_device *p, int response, struct visor_segment_state state); - int visorbus_init(void); void visorbus_exit(void); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/45] staging: unisys: fix up device_destroy
Visorbus_remove_instance calls device_unregister which in turn will call visorbus_release_busdevice. The function visorbus_release_busdevice was freeing the visor_device. The code in visorbus_remove_instance was then trying to reference the visor_device. This patch cleans up the code so the visor_device is not referenced after the unregister. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index b35b8a6..aa82508 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -181,6 +181,7 @@ static void visorbus_release_busdevice(struct device *xdev) debugfs_remove(dev->debugfs_client_bus_info); debugfs_remove_recursive(dev->debugfs_dir); + visorchannel_destroy(dev->visorchannel); kfree(dev); } @@ -1069,11 +1070,11 @@ void visorbus_remove_instance(struct visor_device *dev) * successfully been able to trace thru the code to see where/how * release() gets called. But I know it does. */ - visorchannel_destroy(dev->visorchannel); kfree(dev->vbus_hdr_info); list_del(&dev->list_all); + if (dev->pending_msg_hdr) + visorbus_response(dev, 0, CONTROLVM_BUS_DESTROY); device_unregister(&dev->device); - visorbus_response(dev, 0, CONTROLVM_BUS_DESTROY); } /* -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/45] staging: unisys: visorbus: NULL pending_msg_hdr not an error
A NULL pending_msg_hdr is not an error, it just means that the firmware does not want an error response for that message. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 3 ++- drivers/staging/unisys/visorbus/visorchipset.c | 13 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 7bfccc8..b35b8a6 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -690,8 +690,9 @@ void remove_visor_device(struct visor_device *dev) { list_del(&dev->list_all); put_device(&dev->device); + if (dev->pending_msg_hdr) + visorbus_response(dev, 0, CONTROLVM_DEVICE_DESTROY); device_unregister(&dev->device); - visorbus_response(dev, 0, CONTROLVM_DEVICE_DESTROY); } static int get_vbus_header_info(struct visorchannel *chan, diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 14bc219..df7429d 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -481,9 +481,6 @@ static int controlvm_responder(enum controlvm_id cmd_id, struct controlvm_message_header *pending_msg_hdr, int response) { - if (!pending_msg_hdr) - return -EIO; - if (pending_msg_hdr->id != (u32)cmd_id) return -EINVAL; @@ -497,8 +494,6 @@ static int device_changestate_responder( { struct controlvm_message outmsg; - if (!p->pending_msg_hdr) - return -EIO; if (p->pending_msg_hdr->id != cmd_id) return -EINVAL; @@ -1391,8 +1386,10 @@ static void setup_crash_devices_work_queue(struct work_struct *work) void visorbus_response(struct visor_device *bus_info, int response, int controlvm_id) { - controlvm_responder(controlvm_id, bus_info->pending_msg_hdr, response); + if (!bus_info->pending_msg_hdr) + return; + controlvm_responder(controlvm_id, bus_info->pending_msg_hdr, response); kfree(bus_info->pending_msg_hdr); bus_info->pending_msg_hdr = NULL; } @@ -1401,9 +1398,11 @@ void visorbus_device_changestate_response(struct visor_device *dev_info, int response, struct visor_segment_state state) { + if (!dev_info->pending_msg_hdr) + return; + device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, dev_info, response, state); - kfree(dev_info->pending_msg_hdr); dev_info->pending_msg_hdr = NULL; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/45] staging: unisys: visorbus: to_visor_device/to_visor_driver move up
The macros to_visor_device and to_visor_driver are fairly small; move them up to the declaration block to save some space. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 740a36a..46e6a4c 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -490,11 +490,8 @@ static void dev_stop_periodic_work(struct visor_device *dev) */ static int visordriver_remove_device(struct device *xdev) { - struct visor_device *dev; - struct visor_driver *drv; - - dev = to_visor_device(xdev); - drv = to_visor_driver(xdev->driver); + struct visor_device *dev = to_visor_device(xdev); + struct visor_driver *drv = to_visor_driver(xdev->driver); mutex_lock(&dev->visordriver_callback_lock); dev->being_removed = true; @@ -863,11 +860,8 @@ static void publish_vbus_dev_info(struct visor_device *visordev) static int visordriver_probe_device(struct device *xdev) { int err; - struct visor_driver *drv; - struct visor_device *dev; - - dev = to_visor_device(xdev); - drv = to_visor_driver(xdev->driver); + struct visor_driver *drv = to_visor_driver(xdev->driver); + struct visor_device *dev = to_visor_device(xdev); mutex_lock(&dev->visordriver_callback_lock); dev->being_removed = false; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/45] staging: unisys: visorbus: fix newlines for visorchannel
Remove extraneous blank lines and add some lines that are needed. General philosophy -- declaration, space, pre-conditions (if needed), space, then rest of function. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchannel.c | 28 +- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 7665858..44eab70 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -57,6 +57,7 @@ void visorchannel_destroy(struct visorchannel *channel) { if (!channel) return; + if (channel->mapped) { memunmap(channel->mapped); if (channel->requested) @@ -122,7 +123,6 @@ int visorchannel_read(struct visorchannel *channel, ulong offset, void *dest, return -EIO; memcpy(dest, channel->mapped + offset, nbytes); - return 0; } @@ -140,9 +140,7 @@ int visorchannel_write(struct visorchannel *channel, ulong offset, void *dest, memcpy(((char *)(&channel->chan_hdr)) + offset, dest, copy_size); } - memcpy(channel->mapped + offset, dest, nbytes); - return 0; } @@ -226,32 +224,25 @@ static int signalremove_inner(struct visorchannel *channel, u32 queue, error = sig_read_header(channel, queue, &sig_hdr); if (error) return error; - /* No signals to remove; have caller try again. */ if (sig_hdr.head == sig_hdr.tail) return -EAGAIN; - sig_hdr.tail = (sig_hdr.tail + 1) % sig_hdr.max_slots; - error = sig_read_data(channel, queue, &sig_hdr, sig_hdr.tail, msg); if (error) return error; - sig_hdr.num_received++; - /* * For each data field in SIGNAL_QUEUE_HEADER that was modified, update * host memory. Required for channel sync. */ mb(); - error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, tail); if (error) return error; error = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_received); if (error) return error; - return 0; } @@ -288,7 +279,6 @@ static bool queue_empty(struct visorchannel *channel, u32 queue) if (sig_read_header(channel, queue, &sig_hdr)) return true; - return (sig_hdr.head == sig_hdr.tail); } @@ -308,11 +298,9 @@ bool visorchannel_signalempty(struct visorchannel *channel, u32 queue) if (!channel->needs_lock) return queue_empty(channel, queue); - spin_lock_irqsave(&channel->remove_lock, flags); rc = queue_empty(channel, queue); spin_unlock_irqrestore(&channel->remove_lock, flags); - return rc; } EXPORT_SYMBOL_GPL(visorchannel_signalempty); @@ -326,7 +314,6 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue, err = sig_read_header(channel, queue, &sig_hdr); if (err) return err; - sig_hdr.head = (sig_hdr.head + 1) % sig_hdr.max_slots; if (sig_hdr.head == sig_hdr.tail) { sig_hdr.num_overflows++; @@ -335,26 +322,21 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue, return err; return -EIO; } - err = sig_write_data(channel, queue, &sig_hdr, sig_hdr.head, msg); if (err) return err; - sig_hdr.num_sent++; - /* * For each data field in SIGNAL_QUEUE_HEADER that was modified, update * host memory. Required for channel sync. */ mb(); - err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, head); if (err) return err; err = SIG_WRITE_FIELD(channel, queue, &sig_hdr, num_sent); if (err) return err; - return 0; } @@ -386,11 +368,9 @@ static struct visorchannel *visorchannel_create_guts(u64 physaddr, gfp_t gfp, channel = kzalloc(sizeof(*channel), gfp); if (!channel) return NULL; - channel->needs_lock = needs_lock; spin_lock_init(&channel->insert_lock); spin_lock_init(&channel->remove_lock); - /* * Video driver constains the efi framebuffer so it will get a conflict * resource when requesting its full mem region. Since we are only @@ -401,21 +381,17 @@ static struct visorchannel *visorchannel_create_guts(u64 physaddr, gfp_t gfp, if (!channel->requested && !guid_equal(guid, &visor_video_guid)) /* we only care about errors if this is not the video channel */ goto err_destr
[PATCH 00/45] staging: unisys: more updates to clean up the code.
Here are some more updates to clean up the code. David Binder (3): staging: unisys: include: Rename channel.h to visorchannel.h staging: unisys: include: Remove unnecessary macro to generate signature staging: unisys: include: Remove unused enum David Kershner (37): staging: unisys: visorbus: simplify commenting in controlvm_init staging: unisys: visorbus: don't need local variable cmd staging: unisys: visorbus: clean up parser_string_get function staging: unisys: visorbus: visorchannel: use 80 characters for comments staging: unisys; visorbus: visorchipset.c: remove extraneous newline staging: unisys: visorbus: fix alignment of paranethesis staging: unisys: visorbus: visorbus_private.h remove extra blank lines staging: unisys: visorbus: visorbus_main.c: cleanup and consolidate comments staging: unisys: visorbus: use guid_is_equal instead of memcmp staging: unisys: visorbus: don't put code in declaration. staging: unisys: visorbus: NULL pending_msg_hdr not an error staging: unisys: fix up device_destroy staging: unisys; visorbus: visorbus_main.c: remove extraneous newline staging: unisys: visorbus: clean up initializations staging: unisys: visorbus: keep the success path on the left staging: unisys: shrink the name of a variable staging: unisys: visorbus: clean up formatting of function definitions staging: unisys: visorbus: simplify debugfs print statment staging: unisys: visorbus: Remove unneeded initialization staging: unisys: visorbus: fix newlines for visorchannel staging: unisys: visorbus: visorchipset: clean up blank lines in visorchipset staging: unisys: visorbus: visorbus_main.c: remove blank lines staging: unisys: visorbus: to_visor_device/to_visor_driver move up staging: unisys: only include a file where it is used. staging: unisys: include: remove io.h from channel.h staging: unisys: visorbus: vbuschannel doesn't use ctypes staging: unisys: include: reorder to avoid forward declaration staging: unisys: include: remove signature_32 staging: unisys: include: consolidate a comment staging: unisys: visorbus: keep the success path on the left side staging: unisys: remove visorbus_type extern staging: unisys: visorbus: visorchipset.c: Remove useless initializations staging: unisys: visorbus: shrink name of POLLJIFFIES_CONTROLVMCHANNEL_XXX staging: unisys: visorbus: clean up parameter formatting staging: unisys: visorbus: Fix extraneous parenthesis staging: unisys: visorhba: clean up parenthesis staging: unisys: visornic: clean up parenthesis Sameer Wadgaonkar (5): staging: unisys: check the whole channel instead of just guid for match staging: unisys: visorbus: simplify visorchannel_create_guts staging: unisys: visorbus: fix line over 80 characters checkpatch warning staging: unisys: include: fix comments and spacing issues in visorbus.h staging: unisys: visorbus: fix comments in vbuschannel.h drivers/staging/unisys/include/iochannel.h | 9 +- drivers/staging/unisys/include/visorbus.h | 159 +-- .../unisys/include/{channel.h => visorchannel.h} | 12 +- drivers/staging/unisys/visorbus/controlvmchannel.h | 3 +- drivers/staging/unisys/visorbus/vbuschannel.h | 12 +- drivers/staging/unisys/visorbus/visorbus_main.c| 269 +-- drivers/staging/unisys/visorbus/visorbus_private.h | 8 +- drivers/staging/unisys/visorbus/visorchannel.c | 81 ++ drivers/staging/unisys/visorbus/visorchipset.c | 298 + drivers/staging/unisys/visorhba/visorhba_main.c| 12 +- drivers/staging/unisys/visorinput/visorinput.c | 6 +- drivers/staging/unisys/visornic/visornic_main.c| 10 +- 12 files changed, 318 insertions(+), 561 deletions(-) rename drivers/staging/unisys/include/{channel.h => visorchannel.h} (95%) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/45] staging: unisys: visorbus: visorbus_main.c: remove blank lines
Removes several extraneous blank lines in visorbus_main.c. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 44 ++--- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 56d1c16..740a36a 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -122,7 +122,6 @@ static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env) dev = to_visor_device(xdev); guid = visorchannel_get_guid(dev->visorchannel); - return add_uevent_var(env, "MODALIAS=visorbus:%pUl", guid); } @@ -147,11 +146,9 @@ static int visorbus_match(struct device *xdev, struct device_driver *xdrv) drv = to_visor_driver(xdrv); if (!drv->channel_types) return 0; - for (i = 0; !guid_is_null(&drv->channel_types[i].guid); i++) if (guid_equal(&drv->channel_types[i].guid, channel_type)) return i + 1; - return 0; } @@ -288,7 +285,6 @@ static ssize_t typename_show(struct device *dev, struct device_attribute *attr, * define & implement display of bus attributes under * /sys/bus/visorbus/devices/visorbus. */ - static ssize_t partition_handle_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -346,7 +342,6 @@ static ssize_t channel_id_show(struct device *dev, visorchannel_id(vdev->visorchannel, buf); len = strlen(buf); buf[len++] = '\n'; - return len; } static DEVICE_ATTR_RO(channel_id); @@ -386,13 +381,11 @@ static void vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo, /* uninitialized vbus device entry */ if (!isprint(devinfo->devtype[0])) return; - if (devix >= 0) seq_printf(seq, "[%d]", devix); else /* vbus device entry is for bus or chipset */ seq_puts(seq, " "); - /* * Note: because the s-Par back-end is free to scribble in this area, * we never assume '\0'-termination. @@ -420,7 +413,6 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v) "Client device/driver info for %s partition (vbus #%u):\n", ((vdev->name) ? (char *)(vdev->name) : ""), vdev->chipset_bus_no); - if (visorchannel_read(channel, offsetof(struct visor_vbus_channel, chp_info), &dev_info, sizeof(dev_info)) >= 0) @@ -438,7 +430,6 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v) off += sizeof(dev_info); i++; } - return 0; } @@ -468,6 +459,7 @@ static int dev_start_periodic_work(struct visor_device *dev) { if (dev->being_removed || dev->timer_active) return -EINVAL; + /* now up by at least 2 */ get_device(&dev->device); dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL; @@ -480,6 +472,7 @@ static void dev_stop_periodic_work(struct visor_device *dev) { if (!dev->timer_active) return; + del_timer_sync(&dev->timer); dev->timer_active = false; put_device(&dev->device); @@ -507,10 +500,8 @@ static int visordriver_remove_device(struct device *xdev) dev->being_removed = true; drv->remove(dev); mutex_unlock(&dev->visordriver_callback_lock); - dev_stop_periodic_work(dev); put_device(&dev->device); - return 0; } @@ -633,7 +624,6 @@ int create_visor_device(struct visor_device *dev) /* keep a reference just for us (now 2) */ get_device(&dev->device); setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev); - /* * bus_id must be a unique name with respect to this bus TYPE (NOT bus * instance). That's why we need to include the bus number within the @@ -643,7 +633,6 @@ int create_visor_device(struct visor_device *dev) chipset_bus_no, chipset_dev_no); if (err) goto err_put; - /* * device_add does this: *bus_add_device(dev) @@ -664,7 +653,6 @@ int create_visor_device(struct visor_device *dev) err = device_add(&dev->device); if (err < 0) goto err_put; - list_add_tail(&dev->list_all, &list_all_device_instances); dev->state.created = 1; visorbus_response(dev, err, CONTROLVM_DEVICE_CREATE); @@ -705,14 +693,
[PATCH 09/45] staging: unisys: visorbus: use guid_is_equal instead of memcmp
The function publish_vbus_dev_info was doing a memcmp of guids. It should be using the kernel provided guid_equal function instead. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index f8236da..b187581 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -855,9 +855,8 @@ static void publish_vbus_dev_info(struct visor_device *visordev) * type name */ for (i = 0; visordrv->channel_types[i].name; i++) { - if (memcmp(&visordrv->channel_types[i].guid, - &visordev->channel_type_guid, - sizeof(visordrv->channel_types[i].guid)) == 0) { + if (guid_equal(&visordrv->channel_types[i].guid, + &visordev->channel_type_guid)) { chan_type_name = visordrv->channel_types[i].name; break; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/45] staging: unisys: visorbus: simplify debugfs print statment
Simplify debugfs statement so it is clearer and more compact. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index a085713..d10af23 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -417,7 +417,7 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v) return 0; seq_printf(seq, - "Client device / client driver info for %s partition (vbus #%u):\n", + "Client device/driver info for %s partition (vbus #%u):\n", ((vdev->name) ? (char *)(vdev->name) : ""), vdev->chipset_bus_no); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/45] staging: unisys: shrink the name of a variable
The field debugfs_client_bus_info can be reduced to debugfs_bus_info. The word client is extraneous in this context. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 2 +- drivers/staging/unisys/visorbus/visorbus_main.c | 20 +--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index e4ee38c..ea01a21 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -161,7 +161,7 @@ struct visor_device { void *vbus_hdr_info; guid_t partition_guid; struct dentry *debugfs_dir; - struct dentry *debugfs_client_bus_info; + struct dentry *debugfs_bus_info; }; #define to_visor_device(x) container_of(x, struct visor_device, device) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 308372e..4a128dc 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -179,7 +179,7 @@ static void visorbus_release_busdevice(struct device *xdev) { struct visor_device *dev = dev_get_drvdata(xdev); - debugfs_remove(dev->debugfs_client_bus_info); + debugfs_remove(dev->debugfs_bus_info); debugfs_remove_recursive(dev->debugfs_dir); visorchannel_destroy(dev->visorchannel); kfree(dev); @@ -414,7 +414,7 @@ static void vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo, devinfo->infostrs); } -static int client_bus_info_debugfs_show(struct seq_file *seq, void *v) +static int bus_info_debugfs_show(struct seq_file *seq, void *v) { int i = 0; unsigned long off; @@ -451,15 +451,14 @@ static int client_bus_info_debugfs_show(struct seq_file *seq, void *v) return 0; } -static int client_bus_info_debugfs_open(struct inode *inode, struct file *file) +static int bus_info_debugfs_open(struct inode *inode, struct file *file) { - return single_open(file, client_bus_info_debugfs_show, - inode->i_private); + return single_open(file, bus_info_debugfs_show, inode->i_private); } -static const struct file_operations client_bus_info_debugfs_fops = { +static const struct file_operations bus_info_debugfs_fops = { .owner = THIS_MODULE, - .open = client_bus_info_debugfs_open, + .open = bus_info_debugfs_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, @@ -1024,10 +1023,9 @@ int visorbus_create_instance(struct visor_device *dev) dev->debugfs_dir = debugfs_create_dir(dev_name(&dev->device), visorbus_debugfs_dir); - dev->debugfs_client_bus_info = - debugfs_create_file("client_bus_info", 0440, dev->debugfs_dir, - dev, &client_bus_info_debugfs_fops); - + dev->debugfs_bus_info = debugfs_create_file("client_bus_info", 0440, + dev->debugfs_dir, dev, + &bus_info_debugfs_fops); dev_set_drvdata(&dev->device, dev); err = get_vbus_header_info(dev->visorchannel, &dev->device, hdr_info); if (err < 0) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/45] staging: unisys: visorbus: fix alignment of paranethesis
Correct indenting of parameters when calling the functions in the file visorchipset.c. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 7e494e1..14bc219 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -691,9 +691,8 @@ static int visorbus_configure(struct controlvm_message *inmsg, goto err_respond; } - err = visorchannel_set_clientpartition - (bus_info->visorchannel, -cmd->configure_bus.guest_handle); + err = visorchannel_set_clientpartition(bus_info->visorchannel, + cmd->configure_bus.guest_handle); if (err) goto err_respond; @@ -1252,7 +1251,7 @@ static int chipset_selftest_uevent(struct controlvm_message_header *msg_hdr) static int chipset_notready_uevent(struct controlvm_message_header *msg_hdr) { int res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj, -KOBJ_OFFLINE); +KOBJ_OFFLINE); if (msg_hdr->flags.response_expected) controlvm_respond(msg_hdr, res, NULL); @@ -1275,7 +1274,7 @@ static int unisys_vmcall(unsigned long tuple, unsigned long param) return -EPERM; __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) : - "a"(tuple), "b"(reg_ebx), "c"(reg_ecx)); +"a"(tuple), "b"(reg_ebx), "c"(reg_ecx)); if (result) goto error; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/45] staging: unisys: visorbus: visorchipset: clean up blank lines in visorchipset
Remove extraneous blank lines and get consistency of blank lines. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 98 +- 1 file changed, 3 insertions(+), 95 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index df7429d..416e741 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -128,7 +128,6 @@ static ssize_t toolaction_show(struct device *dev, &tool_action, sizeof(u8)); if (err) return err; - return sprintf(buf, "%u\n", tool_action); } @@ -141,7 +140,6 @@ static ssize_t toolaction_store(struct device *dev, if (kstrtou8(buf, 10, &tool_action)) return -EINVAL; - err = visorchannel_write(chipset_dev->controlvm_channel, offsetof(struct visor_controlvm_channel, tool_action), @@ -178,7 +176,6 @@ static ssize_t boottotool_store(struct device *dev, if (kstrtoint(buf, 10, &val)) return -EINVAL; - efi_visor_indication.boot_to_tool = val; err = visorchannel_write(chipset_dev->controlvm_channel, offsetof(struct visor_controlvm_channel, @@ -214,7 +211,6 @@ static ssize_t error_store(struct device *dev, struct device_attribute *attr, if (kstrtou32(buf, 10, &error)) return -EINVAL; - err = visorchannel_write(chipset_dev->controlvm_channel, offsetof(struct visor_controlvm_channel, installation_error), @@ -237,7 +233,6 @@ static ssize_t textid_show(struct device *dev, struct device_attribute *attr, &text_id, sizeof(u32)); if (err) return err; - return sprintf(buf, "%u\n", text_id); } @@ -249,7 +244,6 @@ static ssize_t textid_store(struct device *dev, struct device_attribute *attr, if (kstrtou32(buf, 10, &text_id)) return -EINVAL; - err = visorchannel_write(chipset_dev->controlvm_channel, offsetof(struct visor_controlvm_channel, installation_text_id), @@ -272,7 +266,6 @@ static ssize_t remaining_steps_show(struct device *dev, &remaining_steps, sizeof(u16)); if (err) return err; - return sprintf(buf, "%hu\n", remaining_steps); } @@ -285,7 +278,6 @@ static ssize_t remaining_steps_store(struct device *dev, if (kstrtou16(buf, 10, &remaining_steps)) return -EINVAL; - err = visorchannel_write(chipset_dev->controlvm_channel, offsetof(struct visor_controlvm_channel, installation_remaining_steps), @@ -309,7 +301,6 @@ static int match_visorbus_dev_by_id(struct device *dev, void *data) if ((vdev->chipset_bus_no == id->bus_no) && (vdev->chipset_dev_no == id->dev_no)) return 1; - return 0; } @@ -374,7 +365,6 @@ static int chipset_init(struct controlvm_message *inmsg) goto out_respond; } chipset_inited = 1; - /* * Set features to indicate we support parahotplug (if Command also * supports it). Set the "reply" bit so Command knows this is a @@ -399,12 +389,10 @@ static int controlvm_respond(struct controlvm_message_header *msg_hdr, controlvm_init_response(&outmsg, msg_hdr, response); if (outmsg.hdr.flags.test_message == 1) return -EINVAL; - if (state) { outmsg.cmd.device_change_state.state = *state; outmsg.cmd.device_change_state.flags.phys_device = 1; } - return visorchannel_signalinsert(chipset_dev->controlvm_channel, CONTROLVM_QUEUE_REQUEST, &outmsg); } @@ -430,13 +418,11 @@ static int save_crash_message(struct controlvm_message *msg, "failed to read message count\n"); return err; } - if (local_crash_msg_count != CONTROLVM_CRASHMSG_MAX) { dev_err(&chipset_dev->acpi_device->dev, "invalid number of messages\n"); return -EIO; } - err = visorchannel_read(chipset_dev->controlvm_channel, offsetof(struct visor_controlvm_channel, saved_crash_message_offset), @@ -446,7 +432,6 @@ static int save_crash_message(struct controlvm_mess
[PATCH 26/45] staging: unisys: visorbus: vbuschannel doesn't use ctypes
Don't include ctypes in vbuschannel.h, it isn't used by ctypes, but it is used by visorbus_main.c so include it there. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/controlvmchannel.h | 1 + drivers/staging/unisys/visorbus/vbuschannel.h | 1 - drivers/staging/unisys/visorbus/visorbus_main.c| 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h b/drivers/staging/unisys/visorbus/controlvmchannel.h index 32ff5c1..4735ed8 100644 --- a/drivers/staging/unisys/visorbus/controlvmchannel.h +++ b/drivers/staging/unisys/visorbus/controlvmchannel.h @@ -17,6 +17,7 @@ #define __CONTROLVMCHANNEL_H__ #include + #include "channel.h" /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */ diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h index 27e04de..6eae58d 100644 --- a/drivers/staging/unisys/visorbus/vbuschannel.h +++ b/drivers/staging/unisys/visorbus/vbuschannel.h @@ -26,7 +26,6 @@ */ #include -#include #include "channel.h" /* {193b331b-c58f-11da-95a9-00e08161165f} */ diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index baae38f..c455784 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -13,6 +13,7 @@ * details. */ +#include #include #include #include -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/45] staging: unisys: visorbus: clean up initializations
Don't compute value of offset during initialization. Assigning a value to offset should happen after we have verified all of its components. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 589dff3..ea12499 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -743,11 +743,12 @@ static void write_vbus_chp_info(struct visorchannel *chan, struct visor_vbus_headerinfo *hdr_info, struct visor_vbus_deviceinfo *info) { - int off = sizeof(struct channel_header) + hdr_info->chp_info_offset; + int off; if (hdr_info->chp_info_offset == 0) return; + off = sizeof(struct channel_header) + hdr_info->chp_info_offset; visorchannel_write(chan, off, info, sizeof(*info)); } @@ -768,11 +769,11 @@ static void write_vbus_bus_info(struct visorchannel *chan, struct visor_vbus_headerinfo *hdr_info, struct visor_vbus_deviceinfo *info) { - int off = sizeof(struct channel_header) + hdr_info->bus_info_offset; + int off; if (hdr_info->bus_info_offset == 0) return; - + off = sizeof(struct channel_header) + hdr_info->bus_info_offset; visorchannel_write(chan, off, info, sizeof(*info)); } @@ -795,13 +796,12 @@ static void write_vbus_dev_info(struct visorchannel *chan, struct visor_vbus_deviceinfo *info, unsigned int devix) { - int off = - (sizeof(struct channel_header) + hdr_info->dev_info_offset) + - (hdr_info->device_info_struct_bytes * devix); + int off; if (hdr_info->dev_info_offset == 0) return; - + off = (sizeof(struct channel_header) + hdr_info->dev_info_offset) + + (hdr_info->device_info_struct_bytes * devix); visorchannel_write(chan, off, info, sizeof(*info)); } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 30/45] staging: unisys: visorbus: keep the success path on the left side
If you can't find the dev, it is an error. Indent for the error, instead of the success. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 416e741..80a0781 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -309,7 +309,6 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, { struct device *dev; struct device *dev_start = NULL; - struct visor_device *vdev = NULL; struct visor_busdev id = { .bus_no = bus_no, .dev_no = dev_no @@ -319,9 +318,9 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, dev_start = &from->device; dev = bus_find_device(&visorbus_type, dev_start, (void *)&id, match_visorbus_dev_by_id); - if (dev) - vdev = to_visor_device(dev); - return vdev; + if (!dev) + return NULL; + return to_visor_device(dev); } static void controlvm_init_response(struct controlvm_message *msg, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/45] staging: unisys: include: remove signature_32
Remove signature_32 since it was only being referenced in one location. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index 59b71a6..6cb8b4d 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -21,9 +21,8 @@ #include #define SIGNATURE_16(A, B) ((A) | ((B) << 8)) -#define SIGNATURE_32(A, B, C, D) \ - (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16)) -#define VISOR_CHANNEL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L') +#define VISOR_CHANNEL_SIGNATURE \ + (SIGNATURE_16('E', 'C') | (SIGNATURE_16('N', 'L') << 16)) /* * enum channel_serverstate -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/45] staging: unisys: include: consolidate a comment
Use all 80 characters of the line to consolidate a comment. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/iochannel.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index a70760f..69dd9c3 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -348,10 +348,9 @@ struct sense_data { * the start of the NETWORK LAYER HEADER. * * NOTE: - * The full packet is described in frags but the ethernet header is - * separately kept in ethhdr so that uisnic doesn't have "MAP" the - * guest memory to get to the header. uisnic needs ethhdr to - * determine how to route the packet. + * The full packet is described in frags but the ethernet header is separately + * kept in ethhdr so that uisnic doesn't have "MAP" the guest memory to get to + * the header. uisnic needs ethhdr to determine how to route the packet. */ struct net_pkt_xmt { int len; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/45] staging: unisys: include: reorder to avoid forward declaration
The include file visorbus.h has a forward declaration of visor_device. A simple reorder of the file removed the need for the forward declaration. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 125 +++--- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 163..6f27e00 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -31,12 +31,8 @@ #include "channel.h" -struct visor_device; extern struct bus_type visorbus_type; -typedef void (*visorbus_state_complete_func) (struct visor_device *dev, - int status); - struct visorchipset_state { u32 created:1; u32 attached:1; @@ -46,64 +42,6 @@ struct visorchipset_state { /* Remaining bits in this 32-bit word are unused. */ }; -/* - * This struct describes a specific Supervisor channel, by providing its - * GUID, name, and sizes. - */ -struct visor_channeltype_descriptor { - const guid_t guid; - const char *name; -}; - -/** - * struct visor_driver - Information provided by each visor driver when it - * registers with the visorbus driver. - * @name: Name of the visor driver. - * @owner: The module owner. - * @channel_types: Types of channels handled by this driver, ending with - * a zero GUID. Our specialized BUS.match() method knows - * about this list, and uses it to determine whether this - * driver will in fact handle a new device that it has - * detected. - * @probe: Called when a new device comes online, by our probe() - * function specified by driver.probe() (triggered - * ultimately by some call to driver_register(), - * bus_add_driver(), or driver_attach()). - * @remove:Called when a new device is removed, by our remove() - * function specified by driver.remove() (triggered - * ultimately by some call to device_release_driver()). - * @channel_interrupt: Called periodically, whenever there is a possiblity - * that "something interesting" may have happened to the - * channel. - * @pause: Called to initiate a change of the device's state. If - * the return valu`e is < 0, there was an error and the - * state transition will NOT occur. If the return value - * is >= 0, then the state transition was INITIATED - * successfully, and complete_func() will be called (or - * was just called) with the final status when either the - * state transition fails or completes successfully. - * @resume:Behaves similar to pause. - * @driver:Private reference to the device driver. For use by bus - * driver only. - */ -struct visor_driver { - const char *name; - struct module *owner; - struct visor_channeltype_descriptor *channel_types; - int (*probe)(struct visor_device *dev); - void (*remove)(struct visor_device *dev); - void (*channel_interrupt)(struct visor_device *dev); - int (*pause)(struct visor_device *dev, -visorbus_state_complete_func complete_func); - int (*resume)(struct visor_device *dev, - visorbus_state_complete_func complete_func); - - /* These fields are for private use by the bus driver only. */ - struct device_driver driver; -}; - -#define to_visor_driver(x) (container_of(x, struct visor_driver, driver)) - /** * struct visor_device - A device type for things "plugged" into the visorbus * bus @@ -164,6 +102,69 @@ struct visor_device { #define to_visor_device(x) container_of(x, struct visor_device, device) +typedef void (*visorbus_state_complete_func) (struct visor_device *dev, + int status); + +/* + * This struct describes a specific Supervisor channel, by providing its + * GUID, name, and sizes. + */ +struct visor_channeltype_descriptor { + const guid_t guid; + const char *name; + u64 min_bytes; + u32 version; +}; + +/** + * struct visor_driver - Information provided by each visor driver when it + * registers with the visorbus driver. + * @name: Name of the visor driver. + * @owner: The module owner. + * @channel_types: Types of channels handled by this driver, ending with + * a zero GUID. Our specialized BUS.match() method knows + * about this list, and uses it to determine whether this + *
[PATCH 25/45] staging: unisys: include: remove io.h from channel.h
Channel.h was including io.h and not using it. Remove the #include. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index 2babe93..59b71a6 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -18,7 +18,6 @@ #define __CHANNEL_H__ #include -#include #include #define SIGNATURE_16(A, B) ((A) | ((B) << 8)) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/45] staging: unisys: only include a file where it is used.
The header file visorbus.h included several linux headers that were used by the source files that include it. Move the includes to the files that actually use them. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 2 -- drivers/staging/unisys/visorbus/visorbus_main.c | 2 ++ drivers/staging/unisys/visorbus/visorchannel.c | 1 + drivers/staging/unisys/visorhba/visorhba_main.c | 1 + drivers/staging/unisys/visorinput/visorinput.c | 1 + drivers/staging/unisys/visornic/visornic_main.c | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index ea01a21..163 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -28,8 +28,6 @@ #define __VISORBUS_H__ #include -#include -#include #include "channel.h" diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 46e6a4c..baae38f 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -14,6 +14,8 @@ */ #include +#include +#include #include #include "visorbus.h" diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 44eab70..68cfd95 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -20,6 +20,7 @@ #include #include +#include #include "visorbus.h" #include "visorbus_private.h" diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 419dba8..b84b40e 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c index 9d8cbc5..1b58663 100644 --- a/drivers/staging/unisys/visorinput/visorinput.c +++ b/drivers/staging/unisys/visorinput/visorinput.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "visorbus.h" diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index dc390ea..c5f0b01 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/45] staging: unisys: remove visorbus_type extern
The variable visorbus_type could be contained to the visorbus_main.c file by moving the two functions that referenced it visorchipset.c. This allowed us to remove the incorrect extern from the include file visorbus.h. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 2 -- drivers/staging/unisys/visorbus/visorbus_main.c| 37 +- drivers/staging/unisys/visorbus/visorbus_private.h | 2 ++ drivers/staging/unisys/visorbus/visorchipset.c | 35 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 6f27e00..6d379e6 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -31,8 +31,6 @@ #include "channel.h" -extern struct bus_type visorbus_type; - struct visorchipset_state { u32 created:1; u32 attached:1; diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index c455784..3b11fb0 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -159,13 +159,48 @@ static int visorbus_match(struct device *xdev, struct device_driver *xdrv) * This describes the TYPE of bus. * (Don't confuse this with an INSTANCE of the bus.) */ -struct bus_type visorbus_type = { +static struct bus_type visorbus_type = { .name = "visorbus", .match = visorbus_match, .uevent = visorbus_uevent, .dev_groups = visorbus_dev_groups, }; +struct visor_busdev { + u32 bus_no; + u32 dev_no; +}; + +static int match_visorbus_dev_by_id(struct device *dev, void *data) +{ + struct visor_device *vdev = to_visor_device(dev); + struct visor_busdev *id = data; + + if ((vdev->chipset_bus_no == id->bus_no) && + (vdev->chipset_dev_no == id->dev_no)) + return 1; + return 0; +} + +struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, + struct visor_device *from) +{ + struct device *dev; + struct device *dev_start = NULL; + struct visor_busdev id = { + .bus_no = bus_no, + .dev_no = dev_no + }; + + if (from) + dev_start = &from->device; + dev = bus_find_device(&visorbus_type, dev_start, (void *)&id, + match_visorbus_dev_by_id); + if (!dev) + return NULL; + return to_visor_device(dev); +} + /* * visorbus_release_busdevice() - called when device_unregister() is called for *the bus device instance, after all other tasks diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index 91f788a..841437f 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -23,6 +23,8 @@ #include "vbuschannel.h" #include "visorbus.h" +struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, + struct visor_device *from); int visorbus_create_instance(struct visor_device *dev); void visorbus_remove_instance(struct visor_device *bus_info); int create_visor_device(struct visor_device *dev_info); diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 80a0781..ab5c5c2 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -288,41 +288,6 @@ static ssize_t remaining_steps_store(struct device *dev, } static DEVICE_ATTR_RW(remaining_steps); -struct visor_busdev { - u32 bus_no; - u32 dev_no; -}; - -static int match_visorbus_dev_by_id(struct device *dev, void *data) -{ - struct visor_device *vdev = to_visor_device(dev); - struct visor_busdev *id = data; - - if ((vdev->chipset_bus_no == id->bus_no) && - (vdev->chipset_dev_no == id->dev_no)) - return 1; - return 0; -} - -struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, - struct visor_device *from) -{ - struct device *dev; - struct device *dev_start = NULL; - struct visor_busdev id = { - .bus_no = bus_no, - .dev_no = dev_no - }; - - if (from) - dev_start = &from->device; - dev = bus_find_device(&visorbus_type, dev_start, (void *)&id, - match_visorbus_dev_by_id); - if (!dev) - return NULL; - return to_visor_device(dev); -} - static void control
[PATCH 37/45] staging: unisys: include: Remove unused enum
From: David Binder Removes unused enum that pertains to s-Par diagnostics capabilities. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 20 1 file changed, 20 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 8e75c8b..dc1546e 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -179,26 +179,6 @@ int visorbus_write_channel(struct visor_device *dev, int visorbus_enable_channel_interrupts(struct visor_device *dev); void visorbus_disable_channel_interrupts(struct visor_device *dev); -/* - * Levels of severity for diagnostic events, in order from lowest severity to - * highest (i.e. fatal errors are the most severe, and should always be logged, - * but info events rarely need to be logged except during debugging). The - * values DIAG_SEVERITY_ENUM_BEGIN and DIAG_SEVERITY_ENUM_END are not valid - * severity values. They exist merely to dilineate the list, so that future - * additions won't require changes to the driver (i.e. when checking for - * out-of-range severities in SetSeverity). The values DIAG_SEVERITY_OVERRIDE - * and DIAG_SEVERITY_SHUTOFF are not valid severity values for logging events - * but they are valid for controlling the amount of event data. Changes made - * to the enum, need to be reflected in s-Par. - */ -enum diag_severity { - DIAG_SEVERITY_VERBOSE = 0, - DIAG_SEVERITY_INFO = 1, - DIAG_SEVERITY_WARNING = 2, - DIAG_SEVERITY_ERR = 3, - DIAG_SEVERITY_PRINT = 4, -}; - int visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg); int visorchannel_signalinsert(struct visorchannel *channel, u32 queue, -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 39/45] staging: unisys: visorbus: simplify visorchannel_create_guts
From: Sameer Wadgaonkar Removing the two wrapper functions dealing with visorchannel_create() and instead just always use a new version of visorchannel_create() with an additional parameter. Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_private.h | 4 +--- drivers/staging/unisys/visorbus/visorchannel.c | 23 +- drivers/staging/unisys/visorbus/visorchipset.c | 15 +++--- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index 841437f..4a8b12d 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -39,9 +39,7 @@ void visorbus_device_changestate_response(struct visor_device *p, int response, /* visorchannel access functions */ struct visorchannel *visorchannel_create(u64 physaddr, gfp_t gfp, -const guid_t *guid); -struct visorchannel *visorchannel_create_with_lock(u64 physaddr, gfp_t gfp, - const guid_t *guid); +const guid_t *guid, bool needs_lock); void visorchannel_destroy(struct visorchannel *channel); int visorchannel_read(struct visorchannel *channel, ulong offset, void *dest, ulong nbytes); diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 68cfd95..aae1607 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -342,9 +342,9 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue, } /* - * visorchannel_create_guts() - creates the struct visorchannel abstraction for - * a data area in memory, but does NOT modify this - * data area + * visorchannel_create() - creates the struct visorchannel abstraction for a + * data area in memory, but does NOT modify this data + * area * @physaddr: physical address of start of channel * @gfp: gfp_t to use when allocating memory for the data struct * @guid: GUID that identifies channel type; @@ -355,9 +355,8 @@ static int signalinsert_inner(struct visorchannel *channel, u32 queue, * Return: pointer to visorchannel that was created if successful, * otherwise NULL */ -static struct visorchannel *visorchannel_create_guts(u64 physaddr, gfp_t gfp, -const guid_t *guid, -bool needs_lock) +struct visorchannel *visorchannel_create(u64 physaddr, gfp_t gfp, +const guid_t *guid, bool needs_lock) { struct visorchannel *channel; int err; @@ -416,18 +415,6 @@ static struct visorchannel *visorchannel_create_guts(u64 physaddr, gfp_t gfp, return NULL; } -struct visorchannel *visorchannel_create(u64 physaddr, gfp_t gfp, -const guid_t *guid) -{ - return visorchannel_create_guts(physaddr, gfp, guid, false); -} - -struct visorchannel *visorchannel_create_with_lock(u64 physaddr, gfp_t gfp, - const guid_t *guid) -{ - return visorchannel_create_guts(physaddr, gfp, guid, true); -} - /** * visorchannel_signalinsert() - inserts a message into the designated * channel/queue diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index c876e54..027e10f 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -494,7 +494,8 @@ static int visorbus_create(struct controlvm_message *inmsg) } visorchannel = visorchannel_create(cmd->create_bus.channel_addr, GFP_KERNEL, - &cmd->create_bus.bus_data_type_guid); + &cmd->create_bus.bus_data_type_guid, + false); if (!visorchannel) { err = -ENOMEM; goto err_free_pending_msg; @@ -681,10 +682,10 @@ static int visorbus_device_create(struct controlvm_message *inmsg) dev_info->chipset_dev_no = dev_no; guid_copy(&dev_info->inst, &cmd->create_device.dev_inst_guid); dev_info->device.parent = &bus_info->device; - visorchannel = - visorchannel_create_with_lock(cmd->create_device.channel_addr, -GFP_KERNEL, -
[PATCH 36/45] staging: unisys: include: Remove unnecessary macro to generate signature
From: David Binder Removes unnecessary SIGNATURE_16 macro used to generate a simple 32-bit signature. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorchannel.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/unisys/include/visorchannel.h b/drivers/staging/unisys/include/visorchannel.h index 1f4a7b1..3394574 100644 --- a/drivers/staging/unisys/include/visorchannel.h +++ b/drivers/staging/unisys/include/visorchannel.h @@ -20,9 +20,7 @@ #include #include -#define SIGNATURE_16(A, B) ((A) | ((B) << 8)) -#define VISOR_CHANNEL_SIGNATURE \ - (SIGNATURE_16('E', 'C') | (SIGNATURE_16('N', 'L') << 16)) +#define VISOR_CHANNEL_SIGNATURE ('L' << 24 | 'N' << 16 | 'C' << 8 | 'E') /* * enum channel_serverstate -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/45] staging: unisys: include: Rename channel.h to visorchannel.h
From: David Binder In order to avoid a potential conflict with other drivers that define a channel.h file, the s-Par channel.h file is renamed in accordance with the surrounding driver-set namespace. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/iochannel.h | 2 +- drivers/staging/unisys/include/visorbus.h| 2 +- drivers/staging/unisys/include/{channel.h => visorchannel.h} | 6 +++--- drivers/staging/unisys/visorbus/controlvmchannel.h | 2 +- drivers/staging/unisys/visorbus/vbuschannel.h| 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) rename drivers/staging/unisys/include/{channel.h => visorchannel.h} (98%) diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index 69dd9c3..5cd407c 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -44,7 +44,7 @@ #include #include -#include "channel.h" +#include "visorchannel.h" /* * Must increment these whenever you insert or delete fields within this channel diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 6d379e6..8e75c8b 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -29,7 +29,7 @@ #include -#include "channel.h" +#include "visorchannel.h" struct visorchipset_state { u32 created:1; diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/visorchannel.h similarity index 98% rename from drivers/staging/unisys/include/channel.h rename to drivers/staging/unisys/include/visorchannel.h index 6cb8b4d..1f4a7b1 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/visorchannel.h @@ -14,8 +14,8 @@ * details. */ -#ifndef __CHANNEL_H__ -#define __CHANNEL_H__ +#ifndef __VISORCHANNEL_H__ +#define __VISORCHANNEL_H__ #include #include @@ -181,7 +181,7 @@ struct signal_queue_header { u8 filler[12]; } __packed; -/* CHANNEL Guids */ +/* VISORCHANNEL Guids */ /* {414815ed-c58c-11da-95a9-00e08161165f} */ #define VISOR_VHBA_CHANNEL_GUID \ GUID_INIT(0x414815ed, 0xc58c, 0x11da, \ diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h b/drivers/staging/unisys/visorbus/controlvmchannel.h index 4735ed8..9ee9886 100644 --- a/drivers/staging/unisys/visorbus/controlvmchannel.h +++ b/drivers/staging/unisys/visorbus/controlvmchannel.h @@ -18,7 +18,7 @@ #include -#include "channel.h" +#include "visorchannel.h" /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */ #define VISOR_CONTROLVM_CHANNEL_GUID \ diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h index 6eae58d..9623911 100644 --- a/drivers/staging/unisys/visorbus/vbuschannel.h +++ b/drivers/staging/unisys/visorbus/vbuschannel.h @@ -26,7 +26,7 @@ */ #include -#include "channel.h" +#include "visorchannel.h" /* {193b331b-c58f-11da-95a9-00e08161165f} */ #define VISOR_VBUS_CHANNEL_GUID \ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/45] staging: unisys: visorbus: clean up parameter formatting
Cleans up parameter formatting in visorbus. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 2 +- drivers/staging/unisys/visorbus/visorchipset.c | 17 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 3b11fb0..7df06f1 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -251,7 +251,7 @@ static ssize_t nbytes_show(struct device *dev, struct device_attribute *attr, struct visor_device *vdev = to_visor_device(dev); return sprintf(buf, "0x%lx\n", - visorchannel_get_nbytes(vdev->visorchannel)); + visorchannel_get_nbytes(vdev->visorchannel)); } static DEVICE_ATTR_RO(nbytes); diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index d808bbc..c876e54 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -436,10 +436,9 @@ static int controlvm_responder(enum controlvm_id cmd_id, return controlvm_respond(pending_msg_hdr, response, NULL); } -static int device_changestate_responder( - enum controlvm_id cmd_id, - struct visor_device *p, int response, - struct visor_segment_state response_state) +static int device_changestate_responder(enum controlvm_id cmd_id, + struct visor_device *p, int response, + struct visor_segment_state state) { struct controlvm_message outmsg; @@ -449,7 +448,7 @@ static int device_changestate_responder( controlvm_init_response(&outmsg, p->pending_msg_hdr, response); outmsg.cmd.device_change_state.bus_no = p->chipset_bus_no; outmsg.cmd.device_change_state.dev_no = p->chipset_dev_no; - outmsg.cmd.device_change_state.state = response_state; + outmsg.cmd.device_change_state.state = state; return visorchannel_signalinsert(chipset_dev->controlvm_channel, CONTROLVM_QUEUE_REQUEST, &outmsg); } @@ -1044,9 +1043,9 @@ static int parahotplug_request_kickoff(struct parahotplug_request *req) { struct controlvm_message_packet *cmd = &req->msg.cmd; char env_cmd[40], env_id[40], env_state[40], env_bus[40], env_dev[40], - env_func[40]; - char *envp[] = { - env_cmd, env_id, env_state, env_bus, env_dev, env_func, NULL +env_func[40]; + char *envp[] = { env_cmd, env_id, env_state, env_bus, env_dev, +env_func, NULL }; sprintf(env_cmd, "VISOR_PARAHOTPLUG=1"); @@ -1462,7 +1461,7 @@ static int handle_command(struct controlvm_message inmsg, u64 channel_addr) static int read_controlvm_event(struct controlvm_message *msg) { int err = visorchannel_signalremove(chipset_dev->controlvm_channel, - CONTROLVM_QUEUE_EVENT, msg); + CONTROLVM_QUEUE_EVENT, msg); if (err) return err; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/45] staging: unisys: visorbus: shrink name of POLLJIFFIES_CONTROLVMCHANNEL_XXX
Shrinks the name of POLLJIFFIES_CONTORLVMCHANNEL_FAST and POLLJIFFIES_CONTROLVMCHANNEL_SLOW to just POLLJIFFIES_CONTROLVM_. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index ac218f3..d808bbc 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -27,8 +27,8 @@ static const guid_t visor_siovm_guid = VISOR_SIOVM_GUID; static const guid_t visor_controlvm_channel_guid = VISOR_CONTROLVM_CHANNEL_GUID; -#define POLLJIFFIES_CONTROLVMCHANNEL_FAST 1 -#define POLLJIFFIES_CONTROLVMCHANNEL_SLOW 100 +#define POLLJIFFIES_CONTROLVM_FAST 1 +#define POLLJIFFIES_CONTROLVM_SLOW 100 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024 * 128) @@ -1552,15 +1552,11 @@ static void controlvm_periodic_work(struct work_struct *work) * it's been longer than MIN_IDLE_SECONDS since we processed * our last controlvm message; slow down the polling */ - if (chipset_dev->poll_jiffies != - POLLJIFFIES_CONTROLVMCHANNEL_SLOW) - chipset_dev->poll_jiffies = - POLLJIFFIES_CONTROLVMCHANNEL_SLOW; + if (chipset_dev->poll_jiffies != POLLJIFFIES_CONTROLVM_SLOW) + chipset_dev->poll_jiffies = POLLJIFFIES_CONTROLVM_SLOW; } else { - if (chipset_dev->poll_jiffies != - POLLJIFFIES_CONTROLVMCHANNEL_FAST) - chipset_dev->poll_jiffies = - POLLJIFFIES_CONTROLVMCHANNEL_FAST; + if (chipset_dev->poll_jiffies != POLLJIFFIES_CONTROLVM_FAST) + chipset_dev->poll_jiffies = POLLJIFFIES_CONTROLVM_FAST; } schedule_delayed_work(&chipset_dev->periodic_controlvm_work, chipset_dev->poll_jiffies); @@ -1579,7 +1575,7 @@ static int visorchipset_init(struct acpi_device *acpi_device) goto error_free_chipset_dev; acpi_device->driver_data = chipset_dev; chipset_dev->acpi_device = acpi_device; - chipset_dev->poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; + chipset_dev->poll_jiffies = POLLJIFFIES_CONTROLVM_FAST; err = sysfs_create_groups(&chipset_dev->acpi_device->dev.kobj, visorchipset_dev_groups); if (err < 0) @@ -1601,7 +1597,7 @@ static int visorchipset_init(struct acpi_device *acpi_device) INIT_DELAYED_WORK(&chipset_dev->periodic_controlvm_work, controlvm_periodic_work); chipset_dev->most_recent_message_jiffies = jiffies; - chipset_dev->poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; + chipset_dev->poll_jiffies = POLLJIFFIES_CONTROLVM_FAST; schedule_delayed_work(&chipset_dev->periodic_controlvm_work, chipset_dev->poll_jiffies); err = visorbus_init(); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/45] staging: unisys: visorbus: visorchipset.c: Remove useless initializations
Found several more useless initializations in visorchipset.c get rid of them. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index ab5c5c2..ac218f3 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -457,7 +457,7 @@ static int device_changestate_responder( static int visorbus_create(struct controlvm_message *inmsg) { struct controlvm_message_packet *cmd = &inmsg->cmd; - struct controlvm_message_header *pmsg_hdr = NULL; + struct controlvm_message_header *pmsg_hdr; u32 bus_no = cmd->create_bus.bus_no; struct visor_device *bus_info; struct visorchannel *visorchannel; @@ -524,7 +524,7 @@ static int visorbus_create(struct controlvm_message *inmsg) static int visorbus_destroy(struct controlvm_message *inmsg) { - struct controlvm_message_header *pmsg_hdr = NULL; + struct controlvm_message_header *pmsg_hdr; u32 bus_no = inmsg->cmd.destroy_bus.bus_no; struct visor_device *bus_info; int err; @@ -587,7 +587,7 @@ static void *parser_string_get(u8 *pscan, int nscan) static void *parser_name_get(struct parser_context *ctx) { - struct visor_controlvm_parameters_header *phdr = NULL; + struct visor_controlvm_parameters_header *phdr; phdr = &ctx->data; if (phdr->name_offset + phdr->name_length > ctx->param_bytes) @@ -644,10 +644,10 @@ static int visorbus_configure(struct controlvm_message *inmsg, static int visorbus_device_create(struct controlvm_message *inmsg) { struct controlvm_message_packet *cmd = &inmsg->cmd; - struct controlvm_message_header *pmsg_hdr = NULL; + struct controlvm_message_header *pmsg_hdr; u32 bus_no = cmd->create_device.bus_no; u32 dev_no = cmd->create_device.dev_no; - struct visor_device *dev_info = NULL; + struct visor_device *dev_info; struct visor_device *bus_info; struct visorchannel *visorchannel; int err; @@ -732,7 +732,7 @@ static int visorbus_device_create(struct controlvm_message *inmsg) static int visorbus_device_changestate(struct controlvm_message *inmsg) { struct controlvm_message_packet *cmd = &inmsg->cmd; - struct controlvm_message_header *pmsg_hdr = NULL; + struct controlvm_message_header *pmsg_hdr; u32 bus_no = cmd->device_change_state.bus_no; u32 dev_no = cmd->device_change_state.dev_no; struct visor_segment_state state = cmd->device_change_state.state; @@ -790,7 +790,7 @@ static int visorbus_device_changestate(struct controlvm_message *inmsg) static int visorbus_device_destroy(struct controlvm_message *inmsg) { struct controlvm_message_packet *cmd = &inmsg->cmd; - struct controlvm_message_header *pmsg_hdr = NULL; + struct controlvm_message_header *pmsg_hdr; u32 bus_no = cmd->destroy_device.bus_no; u32 dev_no = cmd->destroy_device.dev_no; struct visor_device *dev_info; @@ -1380,7 +1380,7 @@ static int handle_command(struct controlvm_message inmsg, u64 channel_addr) * makes a difference in how we compute the virtual address. */ if (parm_bytes) { - bool retry = false; + bool retry; parser_ctx = parser_init_stream(parm_addr, parm_bytes, &retry); if (!parser_ctx && retry) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 40/45] staging: unisys: visorbus: fix line over 80 characters checkpatch warning
From: Sameer Wadgaonkar This patch fixes two checkpatch issues of line over 80 characters in visorchipset.c. Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 027e10f..6165602 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -694,8 +694,10 @@ static int visorbus_device_create(struct controlvm_message *inmsg) goto err_free_dev_info; } dev_info->visorchannel = visorchannel; - guid_copy(&dev_info->channel_type_guid, &cmd->create_device.data_type_guid); - if (guid_equal(&cmd->create_device.data_type_guid, &visor_vhba_channel_guid)) { + guid_copy(&dev_info->channel_type_guid, + &cmd->create_device.data_type_guid); + if (guid_equal(&cmd->create_device.data_type_guid, + &visor_vhba_channel_guid)) { err = save_crash_message(inmsg, CRASH_DEV); if (err) goto err_destroy_visorchannel; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 42/45] staging: unisys: visorbus: fix comments in vbuschannel.h
From: Sameer Wadgaonkar This patch fixes some comments in the file vbuschannel.h to make it more uniform. Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/vbuschannel.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h index 9623911..981b180 100644 --- a/drivers/staging/unisys/visorbus/vbuschannel.h +++ b/drivers/staging/unisys/visorbus/vbuschannel.h @@ -49,9 +49,9 @@ * @infostrs: Kernel vversion. * @reserved: Pad size to 256 bytes. * - * An array of this struct is present in the channel area for each vbus. - * (See vbuschannel.h.). It is filled in by the client side to provide info - * about the device and driver from the client's perspective. + * An array of this struct is present in the channel area for each vbus. It is + * filled in by the client side to provide info about the device and driver from + * the client's perspective. */ struct visor_vbus_deviceinfo { u8 devtype[16]; @@ -72,7 +72,7 @@ struct visor_vbus_deviceinfo { * BusInfo struct. * @dev_info_offset: Byte offset from beginning of this struct to the * DevInfo array. - * @reserved:Natural Alignment + * @reserved:Natural alignment. */ struct visor_vbus_headerinfo { u32 struct_bytes; @@ -96,7 +96,6 @@ struct visor_vbus_headerinfo { struct visor_vbus_channel { struct channel_header channel_header; struct visor_vbus_headerinfo hdr_info; - /* The remainder of this channel is filled in by the client */ struct visor_vbus_deviceinfo chp_info; struct visor_vbus_deviceinfo bus_info; struct visor_vbus_deviceinfo dev_info[0]; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 44/45] staging: unisys: visorhba: clean up parenthesis
Clean up unneeded parenthesis reported by checkpatch.pl. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorhba/visorhba_main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 91e6e35..0bcd3ac 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -820,9 +820,9 @@ static void do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, memcpy(scsicmd->sense_buffer, cmdrsp->scsi.sensebuf, MAX_SENSE_SIZE); /* Do not log errors for disk-not-present inquiries */ - if ((cmdrsp->scsi.cmnd[0] == INQUIRY) && + if (cmdrsp->scsi.cmnd[0] == INQUIRY && (host_byte(cmdrsp->scsi.linuxstat) == DID_NO_CONNECT) && - (cmdrsp->scsi.addlstat == ADDL_SEL_TIMEOUT)) + cmdrsp->scsi.addlstat == ADDL_SEL_TIMEOUT) return; /* Okay see what our error_count is here */ vdisk = scsidev->hostdata; @@ -870,8 +870,8 @@ static void do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct visordisk_info *vdisk; scsidev = scsicmd->device; - if ((cmdrsp->scsi.cmnd[0] == INQUIRY) && - (cmdrsp->scsi.bufflen >= MIN_INQUIRY_RESULT_LEN)) { + if (cmdrsp->scsi.cmnd[0] == INQUIRY && + cmdrsp->scsi.bufflen >= MIN_INQUIRY_RESULT_LEN) { if (cmdrsp->scsi.no_disk_result == 0) return; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 38/45] staging: unisys: check the whole channel instead of just guid for match
From: Sameer Wadgaonkar Validate that the channel contents match the channel type that we are matching. Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 11 ++- drivers/staging/unisys/visorhba/visorhba_main.c | 3 ++- drivers/staging/unisys/visorinput/visorinput.c | 5 +++-- drivers/staging/unisys/visornic/visornic_main.c | 3 ++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 7df06f1..cc6a9d8 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -143,14 +143,23 @@ static int visorbus_match(struct device *xdev, struct device_driver *xdrv) int i; struct visor_device *dev; struct visor_driver *drv; + struct visorchannel *chan; dev = to_visor_device(xdev); channel_type = visorchannel_get_guid(dev->visorchannel); drv = to_visor_driver(xdrv); + chan = dev->visorchannel; if (!drv->channel_types) return 0; for (i = 0; !guid_is_null(&drv->channel_types[i].guid); i++) - if (guid_equal(&drv->channel_types[i].guid, channel_type)) + if (guid_equal(&drv->channel_types[i].guid, channel_type) && + visor_check_channel(visorchannel_get_header(chan), + xdev, + &drv->channel_types[i].guid, + (char *)drv->channel_types[i].name, + drv->channel_types[i].min_bytes, + drv->channel_types[i].version, + VISOR_CHANNEL_SIGNATURE)) return i + 1; return 0; } diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index b84b40e..91e6e35 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -40,7 +40,8 @@ /* Note that the only channel type we expect to be reported by the * bus driver is the VISOR_VHBA channel. */ - { VISOR_VHBA_CHANNEL_GUID, "sparvhba" }, + { VISOR_VHBA_CHANNEL_GUID, "sparvhba", sizeof(struct channel_header), + VISOR_VHBA_CHANNEL_VERSIONID }, {} }; diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c index 1b58663..450f003 100644 --- a/drivers/staging/unisys/visorinput/visorinput.c +++ b/drivers/staging/unisys/visorinput/visorinput.c @@ -712,8 +712,9 @@ static int visorinput_resume(struct visor_device *dev, /* GUIDS for all channel types supported by this driver. */ static struct visor_channeltype_descriptor visorinput_channel_types[] = { - { VISOR_KEYBOARD_CHANNEL_GUID, "keyboard"}, - { VISOR_MOUSE_CHANNEL_GUID, "mouse"}, + { VISOR_KEYBOARD_CHANNEL_GUID, "keyboard", + sizeof(struct channel_header), 0 }, + { VISOR_MOUSE_CHANNEL_GUID, "mouse", sizeof(struct channel_header), 0 }, {} }; diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index c5f0b01..f31 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -49,7 +49,8 @@ /* Note that the only channel type we expect to be reported by the * bus driver is the VISOR_VNIC channel. */ - { VISOR_VNIC_CHANNEL_GUID, "ultravnic" }, + { VISOR_VNIC_CHANNEL_GUID, "ultravnic", sizeof(struct channel_header), + VISOR_VNIC_CHANNEL_VERSIONID }, {} }; MODULE_DEVICE_TABLE(visorbus, visornic_channel_types); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 41/45] staging: unisys: include: fix comments and spacing issues in visorbus.h
From: Sameer Wadgaonkar This patch fixes some comments and spacings in the file visorbus.h to make it more uniform. Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index dc1546e..1a0986b 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -36,13 +36,12 @@ struct visorchipset_state { u32 attached:1; u32 configured:1; u32 running:1; - /* Add new fields above. */ - /* Remaining bits in this 32-bit word are unused. */ + /* Remaining bits in this 32-bit word are reserved. */ }; /** * struct visor_device - A device type for things "plugged" into the visorbus - * bus + * bus * @visorchannel: Points to the channel that the device is * associated with. * @channel_type_guid: Identifies the channel type to the bus driver. @@ -73,7 +72,6 @@ struct visorchipset_state { * same across all visor_devices in the current * guest. Private use by bus driver only. */ - struct visor_device { struct visorchannel *visorchannel; guid_t channel_type_guid; @@ -104,8 +102,8 @@ typedef void (*visorbus_state_complete_func) (struct visor_device *dev, int status); /* - * This struct describes a specific Supervisor channel, by providing its - * GUID, name, and sizes. + * This struct describes a specific visor channel, by providing its GUID, name, + * and sizes. */ struct visor_channeltype_descriptor { const guid_t guid; @@ -116,7 +114,7 @@ struct visor_channeltype_descriptor { /** * struct visor_driver - Information provided by each visor driver when it - * registers with the visorbus driver. + * registers with the visorbus driver * @name: Name of the visor driver. * @owner: The module owner. * @channel_types: Types of channels handled by this driver, ending with -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 43/45] staging: unisys: visorbus: Fix extraneous parenthesis
Clean up unneeded () that are being reported by checkpatch. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++-- drivers/staging/unisys/visorbus/visorchipset.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index cc6a9d8..2f1e8d3 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -185,8 +185,8 @@ static int match_visorbus_dev_by_id(struct device *dev, void *data) struct visor_device *vdev = to_visor_device(dev); struct visor_busdev *id = data; - if ((vdev->chipset_bus_no == id->bus_no) && - (vdev->chipset_dev_no == id->dev_no)) + if (vdev->chipset_bus_no == id->bus_no && + vdev->chipset_dev_no == id->dev_no) return 1; return 0; } diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 6165602..d9045a4 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -463,7 +463,7 @@ static int visorbus_create(struct controlvm_message *inmsg) int err; bus_info = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL); - if (bus_info && (bus_info->state.created == 1)) { + if (bus_info && bus_info->state.created == 1) { dev_err(&chipset_dev->acpi_device->dev, "failed %s: already exists\n", __func__); err = -EEXIST; @@ -666,7 +666,7 @@ static int visorbus_device_create(struct controlvm_message *inmsg) goto err_respond; } dev_info = visorbus_get_device_by_id(bus_no, dev_no, NULL); - if (dev_info && (dev_info->state.created == 1)) { + if (dev_info && dev_info->state.created == 1) { dev_err(&chipset_dev->acpi_device->dev, "failed to get bus by id: %d/%d\n", bus_no, dev_no); err = -EEXIST; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 45/45] staging: unisys: visornic: clean up parenthesis
Clean up unneeded parenthesis reported by checkpatch.pl. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visornic/visornic_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index f31..735d7e5 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -901,7 +901,7 @@ static int visornic_xmit(struct sk_buff *skb, struct net_device *netdev) return NETDEV_TX_OK; } - if ((len < ETH_MIN_PACKET_SIZE) && + if (len < ETH_MIN_PACKET_SIZE && ((skb_end_pointer(skb) - skb->data) >= ETH_MIN_PACKET_SIZE)) { /* pad the packet out to minimum size */ padlen = ETH_MIN_PACKET_SIZE - len; @@ -1452,7 +1452,7 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf, rcu_read_lock(); for_each_netdev_rcu(current->nsproxy->net_ns, dev) { /* Only consider netdevs that are visornic, and are open */ - if ((dev->netdev_ops != &visornic_dev_ops) || + if (dev->netdev_ops != &visornic_dev_ops || (!netif_queue_stopped(dev))) continue; @@ -1682,7 +1682,7 @@ static void service_resp_queue(struct uiscmdrsp *cmdrsp, /* only call queue wake if we stopped it */ netdev = ((struct sk_buff *)cmdrsp->net.buf)->dev; /* ASSERT netdev == vnicinfo->netdev; */ - if ((netdev == devdata->netdev) && + if (netdev == devdata->netdev && netif_queue_stopped(netdev)) { /* check if we have crossed the lower watermark * for netif_wake_queue() -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: unisys: visorbus: address theoretical int overflows
From: Tim Sell Add necessary casting to several places where we were doing 32-bit arithmetic (unsigned) to produce a 64-bit (unsigned long) result, to prevent the theoretical possibility of a 32-bit overflow during the arithmetic. FYI, these are unsigned long: ctx->param_bytes ctx->allocbytes These are unsigned int: bytes phdr->name_offset phdr->name_length Here is the test program demonstrating why we really need the casts: void main() { unsigned int i; unsigned long il; printf("sizeof(int) =%dn",sizeof(i)); printf("sizeof(long)=%dn",sizeof(il)); i = (unsigned int)unsigned long)(1)) << 32) - 1); printf("i = %un", i); il = i+1; printf("adding 1 withOUT cast = %lun", il); il = (unsigned long)i+1; printf("adding 1 WITHcast = %lun", il); } [selltc@mac tmp]$ gcc x.c -o x.out [selltc@mac tmp]$ ./x.out sizeof(int) =4 sizeof(long)=8 i = 4294967295 adding 1 withOUT cast = 0 adding 1 WITHcast = 4294967296 Signed-off-by: Tim Sell Reported-by: Dan Carpenter Signed-off-by: David Kershner Reviewed-by: David Binder --- drivers/staging/unisys/visorbus/visorchipset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index fed554a4..ef2823a 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -590,7 +590,8 @@ static void *parser_name_get(struct parser_context *ctx) struct visor_controlvm_parameters_header *phdr; phdr = &ctx->data; - if (phdr->name_offset + phdr->name_length > ctx->param_bytes) + if ((unsigned long)phdr->name_offset + + (unsigned long)phdr->name_length > ctx->param_bytes) return NULL; ctx->curr = (char *)&phdr + phdr->name_offset; ctx->bytes_remaining = phdr->name_length; @@ -1317,13 +1318,13 @@ static void parser_done(struct parser_context *ctx) static struct parser_context *parser_init_stream(u64 addr, u32 bytes, bool *retry) { - int allocbytes; + unsigned long allocbytes; struct parser_context *ctx; void *mapping; *retry = false; /* alloc an extra byte to ensure payload is \0 terminated */ - allocbytes = bytes + 1 + (sizeof(struct parser_context) - + allocbytes = (unsigned long)bytes + 1 + (sizeof(struct parser_context) - sizeof(struct visor_controlvm_parameters_header)); if ((chipset_dev->controlvm_payload_bytes_buffered + bytes) > MAX_CONTROLVM_PAYLOAD_BYTES) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] drivers: Move visorbus from staging to drivers/visorbus
This patch series fixes an issue that was reported by Dan Carpenter, moves the necessary include files to include/linux/visorbus and then moves the visorbus driver from drivers/staging/unisys to drivers/visorbus. Greg, thanks for the review of visorbus and for the assistance to get the driver to this state. David Kershner (1): drivers: visorbus: move driver out of staging Tim Sell (1): staging: unisys: visorbus: address theoretical int overflows MAINTAINERS | 2 ++ drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/staging/unisys/Kconfig | 1 - drivers/staging/unisys/Makefile | 1 - drivers/staging/unisys/include/iochannel.h | 3 +-- drivers/staging/unisys/visorhba/visorhba_main.c | 2 +- drivers/staging/unisys/visorinput/visorinput.c | 2 +- drivers/staging/unisys/visornic/visornic_main.c | 2 +- drivers/{staging/unisys => }/visorbus/Kconfig| 4 +++- drivers/{staging/unisys => }/visorbus/Makefile | 2 -- drivers/{staging/unisys => }/visorbus/controlvmchannel.h | 3 +-- drivers/{staging/unisys => }/visorbus/vbuschannel.h | 2 +- drivers/{staging/unisys => }/visorbus/visorbus_main.c| 2 +- drivers/{staging/unisys => }/visorbus/visorbus_private.h | 2 +- drivers/{staging/unisys => }/visorbus/visorchannel.c | 2 +- drivers/{staging/unisys => }/visorbus/visorchipset.c | 9 + .../staging/unisys/include => include/linux/visorbus}/visorbus.h | 0 .../unisys/include => include/linux/visorbus}/visorchannel.h | 0 19 files changed, 22 insertions(+), 20 deletions(-) rename drivers/{staging/unisys => }/visorbus/Kconfig (90%) rename drivers/{staging/unisys => }/visorbus/Makefile (81%) rename drivers/{staging/unisys => }/visorbus/controlvmchannel.h (99%) rename drivers/{staging/unisys => }/visorbus/vbuschannel.h (98%) rename drivers/{staging/unisys => }/visorbus/visorbus_main.c (99%) rename drivers/{staging/unisys => }/visorbus/visorbus_private.h (98%) rename drivers/{staging/unisys => }/visorbus/visorchannel.c (99%) rename drivers/{staging/unisys => }/visorbus/visorchipset.c (99%) rename {drivers/staging/unisys/include => include/linux/visorbus}/visorbus.h (100%) rename {drivers/staging/unisys/include => include/linux/visorbus}/visorchannel.h (100%) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] drivers: visorbus: move driver out of staging
The s-Par header files that are referenced by all s-Par drivers, are being moved into include/linux/visorbus. Move the visorbus driver out of staging and modify the configuration and makefiles so they now reference the new file, this required moving some lines from drivers/staging/unisys/Kconfig over to drives/visorbus/Kconfig to make sure dependencies were met. Visorbus will now just live in the /drivers directory. Signed-off-by: David Kershner Reviewed-by: David Binder Reviewed-by: Tim Sell --- MAINTAINERS | 2 ++ drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/staging/unisys/Kconfig| 1 - drivers/staging/unisys/Makefile | 1 - drivers/staging/unisys/include/iochannel.h| 3 +-- drivers/staging/unisys/visorhba/visorhba_main.c | 2 +- drivers/staging/unisys/visorinput/visorinput.c| 2 +- drivers/staging/unisys/visornic/visornic_main.c | 2 +- drivers/{staging/unisys => }/visorbus/Kconfig | 4 +++- drivers/{staging/unisys => }/visorbus/Makefile| 2 -- drivers/{staging/unisys => }/visorbus/controlvmchannel.h | 3 +-- drivers/{staging/unisys => }/visorbus/vbuschannel.h | 2 +- drivers/{staging/unisys => }/visorbus/visorbus_main.c | 2 +- drivers/{staging/unisys => }/visorbus/visorbus_private.h | 2 +- drivers/{staging/unisys => }/visorbus/visorchannel.c | 2 +- drivers/{staging/unisys => }/visorbus/visorchipset.c | 2 +- {drivers/staging/unisys/include => include/linux/visorbus}/visorbus.h | 0 .../staging/unisys/include => include/linux/visorbus}/visorchannel.h | 0 19 files changed, 18 insertions(+), 17 deletions(-) rename drivers/{staging/unisys => }/visorbus/Kconfig (90%) rename drivers/{staging/unisys => }/visorbus/Makefile (81%) rename drivers/{staging/unisys => }/visorbus/controlvmchannel.h (99%) rename drivers/{staging/unisys => }/visorbus/vbuschannel.h (98%) rename drivers/{staging/unisys => }/visorbus/visorbus_main.c (99%) rename drivers/{staging/unisys => }/visorbus/visorbus_private.h (98%) rename drivers/{staging/unisys => }/visorbus/visorchannel.c (99%) rename drivers/{staging/unisys => }/visorbus/visorchipset.c (99%) rename {drivers/staging/unisys/include => include/linux/visorbus}/visorbus.h (100%) rename {drivers/staging/unisys/include => include/linux/visorbus}/visorchannel.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 650aa0e..a1df0e9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13835,6 +13835,8 @@ UNISYS S-PAR DRIVERS M: David Kershner L: sparmaintai...@unisys.com (Unisys internal) S: Supported +F: include/linux/visorbus/ +F: drivers/visorbus/ F: drivers/staging/unisys/ UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER diff --git a/drivers/Kconfig b/drivers/Kconfig index 152744c..ef5fb83 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -211,4 +211,6 @@ source "drivers/mux/Kconfig" source "drivers/opp/Kconfig" +source "drivers/visorbus/Kconfig" + endmenu diff --git a/drivers/Makefile b/drivers/Makefile index 1d034b6..d5061ed 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -183,3 +183,4 @@ obj-$(CONFIG_FPGA) += fpga/ obj-$(CONFIG_FSI) += fsi/ obj-$(CONFIG_TEE) += tee/ obj-$(CONFIG_MULTIPLEXER) += mux/ +obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index 4f1f5e6..688b5e3 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -11,7 +11,6 @@ menuconfig UNISYSSPAR if UNISYSSPAR -source "drivers/staging/unisys/visorbus/Kconfig" source "drivers/staging/unisys/visornic/Kconfig" source "drivers/staging/unisys/visorinput/Kconfig" source "drivers/staging/unisys/visorhba/Kconfig" diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile index 20eb098..e45f44b 100644 --- a/drivers/staging/unisys/Makefile +++ b/drivers/staging/unisys/Makefile @@ -1,7 +1,6 @@ # # Makefile for Unisys SPAR drivers # -obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ obj-$(CONFIG_UNISYS_VISORNIC) += visornic/ obj-$(CONFIG_UNISYS_VISORINPUT)+= visorinput/ obj-$(CONFIG_UNISYS_VISORHBA) += visorhba/ diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index 5cd407c..6e401a7 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -4
[PATCH 0/4] staging: unisys: fix dependency and include issues
This patch series combines the global include files into a single include and cleans up dependencies that were in the wrong location. We had code dependencies on the UNISYSSPAR Kconfig flag instead of the VISORBUS config flag. UNISYSSPAR is just there for organizational purposes. David Kershner (4): staging: unisys: fix dependencies with UNISYSSPAR Kconfig flag staging: unisys: remove !UML flag staging: unisys: combine visorchannel.h and visorbus.h staging: unisys: move dependencies from UNISYSSPAR to VISORBUS drivers/staging/unisys/Kconfig | 3 - drivers/staging/unisys/include/iochannel.h | 2 +- drivers/staging/unisys/include/visorbus.h | 166 ++- drivers/staging/unisys/include/visorchannel.h | 179 - drivers/staging/unisys/visorbus/Kconfig| 1 + drivers/staging/unisys/visorbus/controlvmchannel.h | 2 +- drivers/staging/unisys/visorbus/vbuschannel.h | 2 +- 7 files changed, 169 insertions(+), 186 deletions(-) delete mode 100644 drivers/staging/unisys/include/visorchannel.h -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: unisys: move dependencies from UNISYSSPAR to VISORBUS
The Kconfig flag UNISYSSPAR depended on ACPI and X86, these dependencies really belong to visorbus, so move them there. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/Kconfig | 2 -- drivers/staging/unisys/visorbus/Kconfig | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index f3c92a5..4d19038 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -3,8 +3,6 @@ # menuconfig UNISYSSPAR bool "Unisys SPAR driver support" - depends on X86_64 - depends on ACPI ---help--- Support for the Unisys SPAR drivers diff --git a/drivers/staging/unisys/visorbus/Kconfig b/drivers/staging/unisys/visorbus/Kconfig index 5113880..3866804 100644 --- a/drivers/staging/unisys/visorbus/Kconfig +++ b/drivers/staging/unisys/visorbus/Kconfig @@ -5,6 +5,7 @@ config UNISYS_VISORBUS tristate "Unisys visorbus driver" depends on UNISYSSPAR + depends on X86_64 && ACPI ---help--- The visorbus driver is a virtualized bus for the Unisys s-Par firmware. Virtualized devices allow Linux guests on a system to share disks and -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: unisys: fix dependencies with UNISYSSPAR Kconfig flag
The Kconfig file for UNISYSSPAR uses select ACPI and select PCI instead of depends on ACPI. This patch fixes the problem. Reported-by: Greg Kroah-Hartman Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index 4f1f5e6..ca1bd9a 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -4,8 +4,7 @@ menuconfig UNISYSSPAR bool "Unisys SPAR driver support" depends on X86_64 && !UML - select PCI - select ACPI + depends on ACPI ---help--- Support for the Unisys SPAR drivers -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: unisys: remove !UML flag
Remove the dependency that the drivers are not built during UML. Reported-by: Greg Kroah-Hartman Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index ca1bd9a..f3c92a5 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -3,7 +3,7 @@ # menuconfig UNISYSSPAR bool "Unisys SPAR driver support" - depends on X86_64 && !UML + depends on X86_64 depends on ACPI ---help--- Support for the Unisys SPAR drivers -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: unisys: combine visorchannel.h and visorbus.h
Combine the include files visorchannel.h and visorbus.h so that only one include file is needed for the .c files. Reported-by: Christoph Hellwig Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/iochannel.h | 2 +- drivers/staging/unisys/include/visorbus.h | 166 ++- drivers/staging/unisys/include/visorchannel.h | 179 - drivers/staging/unisys/visorbus/controlvmchannel.h | 2 +- drivers/staging/unisys/visorbus/vbuschannel.h | 2 +- 5 files changed, 168 insertions(+), 183 deletions(-) delete mode 100644 drivers/staging/unisys/include/visorchannel.h diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index a3c8754..9023cf5 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -34,7 +34,7 @@ #include #include -#include "visorchannel.h" +#include "visorbus.h" /* * Must increment these whenever you insert or delete fields within this channel diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index fb4d3f8..0d8bd67 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -19,8 +19,172 @@ #include -#include "visorchannel.h" +#define VISOR_CHANNEL_SIGNATURE ('L' << 24 | 'N' << 16 | 'C' << 8 | 'E') +/* + * enum channel_serverstate + * @CHANNELSRV_UNINITIALIZED: Channel is in an undefined state. + * @CHANNELSRV_READY:Channel has been initialized by server. + */ +enum channel_serverstate { + CHANNELSRV_UNINITIALIZED = 0, + CHANNELSRV_READY = 1 +}; + +/* + * enum channel_clientstate + * @CHANNELCLI_DETACHED: + * @CHANNELCLI_DISABLED: Client can see channel but is NOT allowed to use it + * unless given TBD* explicit request + * (should actually be < DETACHED). + * @CHANNELCLI_ATTACHING: Legacy EFI client request for EFI server to attach. + * @CHANNELCLI_ATTACHED: Idle, but client may want to use channel any time. + * @CHANNELCLI_BUSY: Client either wants to use or is using channel. + * @CHANNELCLI_OWNED:"No worries" state - client can access channel + * anytime. + */ +enum channel_clientstate { + CHANNELCLI_DETACHED = 0, + CHANNELCLI_DISABLED = 1, + CHANNELCLI_ATTACHING = 2, + CHANNELCLI_ATTACHED = 3, + CHANNELCLI_BUSY = 4, + CHANNELCLI_OWNED = 5 +}; + +/* + * Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so that + * a guest can look at the FeatureFlags in the io channel, and configure the + * driver to use interrupts or not based on this setting. All feature bits for + * all channels should be defined here. The io channel feature bits are defined + * below. + */ +#define VISOR_DRIVER_ENABLES_INTS (0x1ULL << 1) +#define VISOR_CHANNEL_IS_POLLING (0x1ULL << 3) +#define VISOR_IOVM_OK_DRIVER_DISABLING_INTS (0x1ULL << 4) +#define VISOR_DRIVER_DISABLES_INTS (0x1ULL << 5) +#define VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING (0x1ULL << 6) + +/* + * struct channel_header - Common Channel Header + * @signature:Signature. + * @legacy_state: DEPRECATED - being replaced by. + * @header_size: sizeof(struct channel_header). + * @size: Total size of this channel in bytes. + * @features: Flags to modify behavior. + * @chtype: Channel type: data, bus, control, etc.. + * @partition_handle: ID of guest partition. + * @handle: Device number of this channel in client. + * @ch_space_offset: Offset in bytes to channel specific area. + * @version_id: Struct channel_header Version ID. + * @partition_index: Index of guest partition. + * @zone_uuid:Guid of Channel's zone. + * @cli_str_offset:Offset from channel header to null-terminated + *ClientString (0 if ClientString not present). + * @cli_state_boot:CHANNEL_CLIENTSTATE of pre-boot EFI client of this + *channel. + * @cmd_state_cli: CHANNEL_COMMANDSTATE (overloaded in Windows drivers, see + *ServerStateUp, ServerStateDown, etc). + * @cli_state_os: CHANNEL_CLIENTSTATE of Guest OS client of this channel. + * @ch_characteristic: CHANNEL_CHARACTERISTIC_. + * @cmd_state_srv: CHANNEL_COMMANDSTATE (overloaded in Windows drivers, see + *ServerStateUp, ServerStateDown, etc). + * @srv_state:CHANNEL_SERVERSTATE. + * @cli_error_boot:Bits to indicate err states for boot clients, so err + *messages can be throttled. + * @cli_error_os: Bits to indicate err states for OS clients, so err + *messages can be throttled. + * @filler: Pad out to 128 byte
[PATCH v2] drivers: visorbus: move driver out of staging
Move the visorbus driver out of staging (drivers/staging/unisys/visorbus) and to drivers/visorbus. Modify the configuration and makefiles so they now reference the new location. The s-Par header file visorbus.h that is referenced by all s-Par drivers, is being moved into include/linux. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- The files are based off the latest revision in the staging-next tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git Changes from v1: -- Simplified to one single patch -- Combined include files into a single file -- Fixed the dependency flags that were in the wrong location. MAINTAINERS | 2 ++ drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/staging/unisys/Kconfig | 1 - drivers/staging/unisys/Makefile | 1 - drivers/staging/unisys/include/iochannel.h | 3 +-- drivers/staging/unisys/visorhba/visorhba_main.c | 2 +- drivers/staging/unisys/visorinput/visorinput.c | 2 +- drivers/staging/unisys/visornic/visornic_main.c | 2 +- drivers/{staging/unisys => }/visorbus/Kconfig| 1 - drivers/{staging/unisys => }/visorbus/Makefile | 2 -- drivers/{staging/unisys => }/visorbus/controlvmchannel.h | 3 +-- drivers/{staging/unisys => }/visorbus/vbuschannel.h | 2 +- drivers/{staging/unisys => }/visorbus/visorbus_main.c| 2 +- drivers/{staging/unisys => }/visorbus/visorbus_private.h | 2 +- drivers/{staging/unisys => }/visorbus/visorchannel.c | 2 +- drivers/{staging/unisys => }/visorbus/visorchipset.c | 2 +- {drivers/staging/unisys/include => include/linux}/visorbus.h | 0 18 files changed, 15 insertions(+), 17 deletions(-) rename drivers/{staging/unisys => }/visorbus/Kconfig (95%) rename drivers/{staging/unisys => }/visorbus/Makefile (81%) rename drivers/{staging/unisys => }/visorbus/controlvmchannel.h (99%) rename drivers/{staging/unisys => }/visorbus/vbuschannel.h (99%) rename drivers/{staging/unisys => }/visorbus/visorbus_main.c (99%) rename drivers/{staging/unisys => }/visorbus/visorbus_private.h (98%) rename drivers/{staging/unisys => }/visorbus/visorchannel.c (99%) rename drivers/{staging/unisys => }/visorbus/visorchipset.c (99%) rename {drivers/staging/unisys/include => include/linux}/visorbus.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 6308fa7..36f76be 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14006,6 +14006,8 @@ UNISYS S-PAR DRIVERS M: David Kershner L: sparmaintai...@unisys.com (Unisys internal) S: Supported +F: include/linux/visorbus.h +F: drivers/visorbus/ F: drivers/staging/unisys/ UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER diff --git a/drivers/Kconfig b/drivers/Kconfig index 152744c..ef5fb83 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -211,4 +211,6 @@ source "drivers/mux/Kconfig" source "drivers/opp/Kconfig" +source "drivers/visorbus/Kconfig" + endmenu diff --git a/drivers/Makefile b/drivers/Makefile index e06f7f6..7a23300 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -184,3 +184,4 @@ obj-$(CONFIG_FPGA) += fpga/ obj-$(CONFIG_FSI) += fsi/ obj-$(CONFIG_TEE) += tee/ obj-$(CONFIG_MULTIPLEXER) += mux/ +obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index 4d19038..c27dab3 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -8,7 +8,6 @@ menuconfig UNISYSSPAR if UNISYSSPAR -source "drivers/staging/unisys/visorbus/Kconfig" source "drivers/staging/unisys/visornic/Kconfig" source "drivers/staging/unisys/visorinput/Kconfig" source "drivers/staging/unisys/visorhba/Kconfig" diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile index 20eb098..e45f44b 100644 --- a/drivers/staging/unisys/Makefile +++ b/drivers/staging/unisys/Makefile @@ -1,7 +1,6 @@ # # Makefile for Unisys SPAR drivers # -obj-$(CONFIG_UNISYS_VISORBUS) += visorbus/ obj-$(CONFIG_UNISYS_VISORNIC) += visornic/ obj-$(CONFIG_UNISYS_VISORINPUT)+= visorinput/ obj-$(CONFIG_UNISYS_VISORHBA) += visorhba/ diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index 9023cf5..45c785d 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -33,8 +33,7 @@ #include #include - -#include "visorbus.h" +#include /* * Must increment these whenever you insert or delete fields within this
[PATCH 01/12] staging: unisys: visorbus: Move kernel-doc comment to proper location
From: David Binder Moves kernel-doc comment in front of the function it describes. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchannel.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index e91febc..ea4cb09 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -286,16 +286,6 @@ visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg) } EXPORT_SYMBOL_GPL(visorchannel_signalremove); -/** - * visorchannel_signalempty() - checks if the designated channel/queue - * contains any messages - * @channel: the channel to query - * @queue: the queue in the channel to query - * - * Return: boolean indicating whether any messages in the designated - * channel/queue are present - */ - static bool queue_empty(struct visorchannel *channel, u32 queue) { @@ -307,6 +297,15 @@ queue_empty(struct visorchannel *channel, u32 queue) return (sig_hdr.head == sig_hdr.tail); } +/** + * visorchannel_signalempty() - checks if the designated channel/queue + * contains any messages + * @channel: the channel to query + * @queue: the queue in the channel to query + * + * Return: boolean indicating whether any messages in the designated + * channel/queue are present + */ bool visorchannel_signalempty(struct visorchannel *channel, u32 queue) { -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/12] staging: unisys: remove platform device and use acpi device.
The visorchipset device is not really a platform device but an acpi device. This patch series removes the creation of the platform device and uses the acpi device as needed. This series also cleans up some misused kernel-doc comments. David Binder (9): staging: unisys: visorbus: Move kernel-doc comment to proper location staging: unisys: visorbus: Fix spelling mistake staging: unisys: visorhba: Make miscellaneous comment corrections staging: unisys: visorbus: visorchannel.c: Remove kernel-doc comment staging: unisys: visorbus: visorbus_main.c: Remove kernel-doc comments staging: unisys: visorbus: visorchipset.c: Remove kernel-doc comments staging: unisys: visorbus: vbuschannel.h: Remove kernel-doc comment staging: unisys: visornic: visornic_main.c: Remove kernel-doc comments staging: unisys: visorhba: visorhba_main.c: Remove kernel-doc comments Sameer Wadgaonkar (3): staging: unisys: visorbus: added struct visorchipset_device staging: unisys: visorbus: remove character device interface staging: unisys: visorbus: remove visorchipset_platform_device drivers/staging/unisys/visorbus/vbuschannel.h | 2 +- drivers/staging/unisys/visorbus/visorbus_main.c | 42 +- drivers/staging/unisys/visorbus/visorchannel.c | 21 +- drivers/staging/unisys/visorbus/visorchipset.c | 393 + drivers/staging/unisys/visorhba/visorhba_main.c | 71 +-- drivers/staging/unisys/visornic/visornic_main.c | 70 +-- 6 files changed, 229 insertions(+), 370 deletions(-) base-commit: 0a441275018b69deffd35bc22a84fd51c54d7d85 -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/12] staging: unisys: visornic: visornic_main.c: Remove kernel-doc comments
From: David Binder Removes kernel-doc formatting for comments that precede static functions. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visornic/visornic_main.c | 70 +- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index d8f5eca..7583582 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -141,7 +141,7 @@ struct visornic_devdata { struct uiscmdrsp cmdrsp[SIZEOF_CMDRSP]; }; -/** +/* * visor_copy_fragsinfo_from_skb( * @skb_in: skbuff that we are pulling the frags from * @firstfraglen: length of first fragment in skb @@ -250,7 +250,7 @@ static const struct file_operations debugfs_enable_ints_fops = { .write = enable_ints_write, }; -/** +/* * visornic_serverdown_complete - IOPART went down, pause device * @work: Work queue it was scheduled on * @@ -285,7 +285,7 @@ visornic_serverdown_complete(struct visornic_devdata *devdata) devdata->server_down_complete_func = NULL; } -/** +/* * visornic_serverdown - Command has notified us that IOPART is down * @devdata: device that is being managed by IOPART * @@ -332,7 +332,7 @@ visornic_serverdown(struct visornic_devdata *devdata, return err; } -/** +/* * alloc_rcv_buf - alloc rcv buffer to be given to the IO Partition. * @netdev: network adapter the rcv bufs are attached too. * @@ -363,7 +363,7 @@ alloc_rcv_buf(struct net_device *netdev) return skb; } -/** +/* * post_skb- post a skb to the IO Partition. * @cmdrsp: cmdrsp packet to be send to the IO Partition * @devdata: visornic_devdata to post the skb too @@ -397,7 +397,7 @@ post_skb(struct uiscmdrsp *cmdrsp, } } -/** +/* * send_enbdis - send NET_RCV_ENBDIS to IO Partition * @netdev: netdevice we are enable/disable, used as context * return value @@ -421,7 +421,7 @@ send_enbdis(struct net_device *netdev, int state, devdata->chstat.sent_enbdis++; } -/** +/* * visornic_disable_with_timeout - Disable network adapter * @netdev: netdevice to disable * @timeout: timeout to wait for disable @@ -507,7 +507,7 @@ visornic_disable_with_timeout(struct net_device *netdev, const int timeout) return 0; } -/** +/* * init_rcv_bufs -- initialize receive bufs and send them to the IO Part * @netdev: struct netdevice * @devdata: visornic_devdata @@ -554,7 +554,7 @@ init_rcv_bufs(struct net_device *netdev, struct visornic_devdata *devdata) return 0; } -/** +/* * visornic_enable_with_timeout- send enable to IO Part * @netdev: struct net_device * @timeout: Time to wait for the ACK from the enable @@ -626,7 +626,7 @@ visornic_enable_with_timeout(struct net_device *netdev, const int timeout) return 0; } -/** +/* * visornic_timeout_reset - handle xmit timeout resets * @work work item that scheduled the work * @@ -669,7 +669,7 @@ visornic_timeout_reset(struct work_struct *work) rtnl_unlock(); } -/** +/* * visornic_open - Enable the visornic device and mark the queue started * @netdev: netdevice to start * @@ -684,7 +684,7 @@ visornic_open(struct net_device *netdev) return 0; } -/** +/* * visornic_close - Disables the visornic device and stops the queues * @netdev: netdevice to start * @@ -699,7 +699,7 @@ visornic_close(struct net_device *netdev) return 0; } -/** +/* * devdata_xmits_outstanding - compute outstanding xmits * @devdata: visornic_devdata for device * @@ -714,7 +714,7 @@ static unsigned long devdata_xmits_outstanding(struct visornic_devdata *devdata) + devdata->chstat.sent_xmit + 1); } -/** +/* * vnic_hit_high_watermark * @devdata: indicates visornic device we are checking * @high_watermark: max num of unacked xmits we will tolerate, @@ -729,7 +729,7 @@ static inline bool vnic_hit_high_watermark(struct visornic_devdata *devdata, return (devdata_xmits_outstanding(devdata) >= high_watermark); } -/** +/* * vnic_hit_low_watermark * @devdata: indicates visornic device we are checking * @low_watermark: we will wait until the num of unacked xmits @@ -745,7 +745,7 @@ static inline bool vnic_hit_low_watermark(struct visornic_devdata *devdata, return (devdata_xmits_outstanding(devdata) <= low_watermark); } -/** +/* * visornic_xmit - send a packet to the IO Partition * @skb: Packet to be sent * @netdev: net device the packet is being sent from @@ -916,7 +916,7 @@ visornic_xmit(struct sk_buff *skb, struct net_device *netdev) return NETDEV_TX_OK; } -/** +/* * vis
[PATCH 03/12] staging: unisys: visorhba: Make miscellaneous comment corrections
From: David Binder Fixes miscellaneous comment issues in visorhba_main.c. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorhba/visorhba_main.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 0ce92c8..d1d4007 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -106,6 +106,7 @@ struct visorhba_devices_open { if ((iter->channel == match->channel) && \ (iter->id == match->id) &&\ (iter->lun == match->lun)) + /** * visor_thread_start - starts a thread for the device * @threadfn: Function the thread starts @@ -184,7 +185,7 @@ static int add_scsipending_entry(struct visorhba_devdata *devdata, } /** - * del_scsipending_enty - removes an entry from the pending array + * del_scsipending_ent - removes an entry from the pending array * @devdata: Device holding the pending array * @del: Entry to remove * @@ -212,7 +213,7 @@ static void *del_scsipending_ent(struct visorhba_devdata *devdata, /** * get_scsipending_cmdrsp - return the cmdrsp stored in a pending entry - * #ddata: Device holding the pending array + * @ddata: Device holding the pending array * @ent: Entry that stores the cmdrsp * * Each scsipending entry has a cmdrsp in it. The cmdrsp is only valid @@ -1201,7 +1202,7 @@ static int visorhba_init(void) } /** - * visorhba_cleanup- driver exit routine + * visorhba_exit - driver exit routine * * Unregister driver from the bus and free up memory. */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/12] staging: unisys: visorbus: visorchannel.c: Remove kernel-doc comment
From: David Binder Removes kernel-doc formatting for comment that precedes a static function. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchannel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index ea4cb09..1e3dc58 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -367,7 +367,7 @@ signalinsert_inner(struct visorchannel *channel, u32 queue, void *msg) return 0; } -/** +/* * visorchannel_create_guts() - creates the struct visorchannel abstraction * for a data area in memory, but does NOT modify * this data area -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/12] staging: unisys: visorbus: Fix spelling mistake
From: David Binder Fixes a minor spelling mistake in a function comment. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 55f29ae..b36452f 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -143,9 +143,9 @@ struct bus_type visorbus_type = { }; /** - * visorbus_releae_busdevice() - called when device_unregister() is called for - * the bus device instance, after all other tasks - * involved with destroying the dev are complete + * visorbus_release_busdevice() - called when device_unregister() is called for + *the bus device instance, after all other tasks + *involved with destroying the dev are complete * @xdev: struct device for the bus being released */ static void -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/12] staging: unisys: visorbus: visorchipset.c: Remove kernel-doc comments
From: David Binder Removes kernel-doc formatting for comments that precede static functions. Reported-by: Greg Kroah-Hartman Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 24 +-- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 97778d7..74c41fc 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1004,7 +1004,7 @@ my_device_destroy(struct controlvm_message *inmsg) #define PARAHOTPLUG_TIMEOUT_MS 2000 -/** +/* * parahotplug_next_id() - generate unique int to match an outstanding * CONTROLVM message with a udev script /sys * response @@ -1019,7 +1019,7 @@ parahotplug_next_id(void) return atomic_inc_return(&id); } -/** +/* * parahotplug_next_expiration() - returns the time (in jiffies) when a * CONTROLVM message on the list should expire * -- PARAHOTPLUG_TIMEOUT_MS in the future @@ -1032,7 +1032,7 @@ parahotplug_next_expiration(void) return jiffies + msecs_to_jiffies(PARAHOTPLUG_TIMEOUT_MS); } -/** +/* * parahotplug_request_create() - create a parahotplug_request, which is *basically a wrapper for a CONTROLVM_MESSAGE *that we can stick on a list @@ -1056,7 +1056,7 @@ parahotplug_request_create(struct controlvm_message *msg) return req; } -/** +/* * parahotplug_request_destroy() - free a parahotplug_request * @req: the request to deallocate */ @@ -1069,7 +1069,7 @@ parahotplug_request_destroy(struct parahotplug_request *req) static LIST_HEAD(parahotplug_request_list); static DEFINE_SPINLOCK(parahotplug_request_list_lock); /* lock for above */ -/** +/* * parahotplug_request_complete() - mark request as complete * @id: the id of the request * @active: indicates whether the request is assigned to active partition @@ -1113,7 +1113,7 @@ parahotplug_request_complete(int id, u16 active) return -EINVAL; } -/** +/* * devicedisabled_store() - disables the hotplug device * @dev: sysfs interface variable not utilized in this function * @attr: sysfs interface variable not utilized in this function @@ -1143,7 +1143,7 @@ static ssize_t devicedisabled_store(struct device *dev, } static DEVICE_ATTR_WO(devicedisabled); -/** +/* * deviceenabled_store() - enables the hotplug device * @dev: sysfs interface variable not utilized in this function * @attr: sysfs interface variable not utilized in this function @@ -1213,7 +1213,7 @@ static struct platform_device visorchipset_platform_device = { .dev.release = visorchipset_dev_release, }; -/** +/* * parahotplug_request_kickoff() - initiate parahotplug request * @req: the request to initiate * @@ -1245,7 +1245,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req) envp); } -/** +/* * parahotplug_process_message() - enables or disables a PCI device by kicking * off a udev script * @inmsg: the message indicating whether to enable or disable @@ -1719,7 +1719,7 @@ parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry) return NULL; } -/** +/* * handle_command() - process a controlvm message * @inmsg:the message to process * @channel_addr: address of the controlvm channel @@ -1833,7 +1833,7 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr) return true; } -/** +/* * read_controlvm_event() - retreives the next message from the * CONTROLVM_QUEUE_EVENT queue in the controlvm * channel @@ -1854,7 +1854,7 @@ read_controlvm_event(struct controlvm_message *msg) return false; } -/** +/* * parahotplug_process_list() - remove any request from the list that's been on * there too long and respond with an error */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/12] staging: unisys: visorhba: visorhba_main.c: Remove kernel-doc comments
From: David Binder Removes kernel-doc formatting for comments that precede static functions. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorhba/visorhba_main.c | 64 +- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index d1d4007..4018d5a 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -107,7 +107,7 @@ struct visorhba_devices_open { (iter->id == match->id) &&\ (iter->lun == match->lun)) -/** +/* * visor_thread_start - starts a thread for the device * @threadfn: Function the thread starts * @thrcontext: Context to pass to the thread, i.e. devdata @@ -131,7 +131,7 @@ static struct task_struct *visor_thread_start return task; } -/** +/* * visor_thread_stop - stops the thread if it is running */ static void visor_thread_stop(struct task_struct *task) @@ -141,7 +141,7 @@ static void visor_thread_stop(struct task_struct *task) kthread_stop(task); } -/** +/* * add_scsipending_entry - save off io command that is pending in * Service Partition * @devdata: Pointer to devdata @@ -184,7 +184,7 @@ static int add_scsipending_entry(struct visorhba_devdata *devdata, return insert_location; } -/** +/* * del_scsipending_ent - removes an entry from the pending array * @devdata: Device holding the pending array * @del: Entry to remove @@ -211,7 +211,7 @@ static void *del_scsipending_ent(struct visorhba_devdata *devdata, return sent; } -/** +/* * get_scsipending_cmdrsp - return the cmdrsp stored in a pending entry * @ddata: Device holding the pending array * @ent: Entry that stores the cmdrsp @@ -229,7 +229,7 @@ static struct uiscmdrsp *get_scsipending_cmdrsp(struct visorhba_devdata *ddata, return NULL; } -/** +/* * simple_idr_get - associate a provided pointer with an int value * 1 <= value <= INT_MAX, and return this int value; * the pointer value can be obtained later by passing @@ -254,7 +254,7 @@ static unsigned int simple_idr_get(struct idr *idrtable, void *p, return (unsigned int)(id); /* idr_alloc() guarantees > 0 */ } -/** +/* * setup_scsitaskmgmt_handles - stash the necessary handles so that the * completion processing logic for a taskmgmt * cmd will be able to find who to wake up @@ -272,7 +272,7 @@ static void setup_scsitaskmgmt_handles(struct idr *idrtable, spinlock_t *lock, simple_idr_get(idrtable, result, lock); } -/** +/* * cleanup_scsitaskmgmt_handles - forget handles created by * setup_scsitaskmgmt_handles() */ @@ -285,7 +285,7 @@ static void cleanup_scsitaskmgmt_handles(struct idr *idrtable, idr_remove(idrtable, cmdrsp->scsitaskmgmt.notifyresult_handle); } -/** +/* * forward_taskmgmt_command - send taskmegmt command to the Service *Partition * @tasktype: Type of taskmgmt command @@ -364,7 +364,7 @@ static int forward_taskmgmt_command(enum task_mgmt_types tasktype, return FAILED; } -/** +/* * visorhba_abort_handler - Send TASK_MGMT_ABORT_TASK * @scsicmd: The scsicmd that needs aborted * @@ -389,7 +389,7 @@ static int visorhba_abort_handler(struct scsi_cmnd *scsicmd) return forward_taskmgmt_command(TASK_MGMT_ABORT_TASK, scsicmd); } -/** +/* * visorhba_device_reset_handler - Send TASK_MGMT_LUN_RESET * @scsicmd: The scsicmd that needs aborted * @@ -413,7 +413,7 @@ static int visorhba_device_reset_handler(struct scsi_cmnd *scsicmd) return forward_taskmgmt_command(TASK_MGMT_LUN_RESET, scsicmd); } -/** +/* * visorhba_bus_reset_handler - Send TASK_MGMT_TARGET_RESET for each * target on the bus * @scsicmd: The scsicmd that needs aborted @@ -437,7 +437,7 @@ static int visorhba_bus_reset_handler(struct scsi_cmnd *scsicmd) return forward_taskmgmt_command(TASK_MGMT_BUS_RESET, scsicmd); } -/** +/* * visorhba_host_reset_handler - Not supported * @scsicmd: The scsicmd that needs aborted * @@ -451,7 +451,7 @@ visorhba_host_reset_handler(struct scsi_cmnd *scsicmd) return SUCCESS; } -/** +/* * visorhba_get_info * @shp: Scsi host that is requesting information * @@ -463,7 +463,7 @@ static const char *visorhba_get_info(struct Scsi_Host *shp) return "visorhba"; } -/** +/* * visorhba_queue_command_lck -- queues command to the Service Partit
[PATCH 12/12] staging: unisys: visorbus: remove visorchipset_platform_device
From: Sameer Wadgaonkar Removed visorchipset_platform_device and all the unused structures and functions and using chipset_dev.acpi_device instead. Reported-by: Greg Kroah-Hartman Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 48 +++ 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index c120c46..cce1974 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -1175,18 +1174,6 @@ static const struct attribute_group *visorchipset_dev_groups[] = { NULL }; -static void visorchipset_dev_release(struct device *dev) -{ -} - -/* /sys/devices/platform/visorchipset */ -static struct platform_device visorchipset_platform_device = { - .name = "visorchipset", - .id = -1, - .dev.groups = visorchipset_dev_groups, - .dev.release = visorchipset_dev_release, -}; - /* * parahotplug_request_kickoff() - initiate parahotplug request * @req: the request to initiate @@ -1215,7 +1202,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req) sprintf(env_func, "SPAR_PARAHOTPLUG_FUNCTION=%d", cmd->device_change_state.dev_no & 0x7); - kobject_uevent_env(&visorchipset_platform_device.dev.kobj, KOBJ_CHANGE, + kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj, KOBJ_CHANGE, envp); } @@ -1277,7 +1264,7 @@ parahotplug_process_message(struct controlvm_message *inmsg) static int chipset_ready_uevent(struct controlvm_message_header *msg_hdr) { - kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_ONLINE); + kobject_uevent(&chipset_dev->acpi_device->dev.kobj, KOBJ_ONLINE); if (msg_hdr->flags.response_expected) return controlvm_respond(msg_hdr, CONTROLVM_RESP_SUCCESS); @@ -1299,7 +1286,7 @@ chipset_selftest_uevent(struct controlvm_message_header *msg_hdr) char *envp[] = { env_selftest, NULL }; sprintf(env_selftest, "SPARSP_SELFTEST=%d", 1); - kobject_uevent_env(&visorchipset_platform_device.dev.kobj, KOBJ_CHANGE, + kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj, KOBJ_CHANGE, envp); if (msg_hdr->flags.response_expected) @@ -1318,7 +1305,7 @@ chipset_selftest_uevent(struct controlvm_message_header *msg_hdr) static int chipset_notready_uevent(struct controlvm_message_header *msg_hdr) { - kobject_uevent(&visorchipset_platform_device.dev.kobj, KOBJ_OFFLINE); + kobject_uevent(&chipset_dev->acpi_device->dev.kobj, KOBJ_OFFLINE); if (msg_hdr->flags.response_expected) return controlvm_respond(msg_hdr, CONTROLVM_RESP_SUCCESS); @@ -1846,9 +1833,15 @@ visorchipset_init(struct acpi_device *acpi_device) goto error_free_chipset_dev; chipset_dev->controlvm_channel = controlvm_channel; + + err = sysfs_create_groups(&chipset_dev->acpi_device->dev.kobj, + visorchipset_dev_groups); + if (err < 0) + goto error_destroy_channel; + if (!SPAR_CONTROLVM_CHANNEL_OK_CLIENT( visorchannel_get_header(controlvm_channel))) - goto error_destroy_channel; + goto error_delete_groups; /* if booting in a crash kernel */ if (is_kdump_kernel()) @@ -1863,26 +1856,21 @@ visorchipset_init(struct acpi_device *acpi_device) schedule_delayed_work(&chipset_dev->periodic_controlvm_work, chipset_dev->poll_jiffies); - if (platform_device_register(&visorchipset_platform_device) < 0) { - POSTCODE_LINUX(DEVICE_REGISTER_FAILURE_PC, 0, 0, - DIAG_SEVERITY_ERR); - err = -ENODEV; - goto error_cancel_work; - } POSTCODE_LINUX(CHIPSET_INIT_SUCCESS_PC, 0, 0, DIAG_SEVERITY_PRINT); err = visorbus_init(); if (err < 0) - goto error_unregister; + goto error_cancel_work; return 0; -error_unregister: - platform_device_unregister(&visorchipset_platform_device); - error_cancel_work: cancel_delayed_work_sync(&chipset_dev->periodic_controlvm_work); +error_delete_groups: + sysfs_remove_groups(&chipset_dev->acpi_device->dev.kobj, + visorchipset_dev_groups); + error_destroy_channel: visorchannel_destroy(chipset_dev->controlvm_channel); @@ -1901,8 +1889,10 @@ visorchipset_exit(struct acpi_device *acpi
[PATCH 10/12] staging: unisys: visorbus: added struct visorchipset_device
From: Sameer Wadgaonkar Added the structure visorchipset_device and moved the globals to the struct. The visorchipset_init() function saves acpi_device within this structure. Reported-by: Greg Kroah-Hartman Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 197 ++ 1 file changed, 112 insertions(+), 85 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 74c41fc..b3c3cdd 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -72,9 +72,6 @@ visorchipset_release(struct inode *inode, struct file *file) * message, we switch back to fast polling mode. */ #define MIN_IDLE_SECONDS 10 -static unsigned long poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST; -/* when we got our last controlvm message */ -static unsigned long most_recent_message_jiffies; struct parser_context { unsigned long allocbytes; @@ -85,22 +82,28 @@ struct parser_context { char data[0]; }; -static struct delayed_work periodic_controlvm_work; - -static struct cdev file_cdev; -static struct visorchannel **file_controlvm_channel; - -static struct visorchannel *controlvm_channel; -static unsigned long controlvm_payload_bytes_buffered; +struct visorchipset_device { + struct acpi_device *acpi_device; + unsigned long poll_jiffies; + /* when we got our last controlvm message */ + unsigned long most_recent_message_jiffies; + struct delayed_work periodic_controlvm_work; + struct cdev file_cdev; + struct visorchannel **file_controlvm_channel; + struct visorchannel *controlvm_channel; + unsigned long controlvm_payload_bytes_buffered; + /* +* The following variables are used to handle the scenario where we are +* unable to offload the payload from a controlvm message due to memory +* requirements. In this scenario, we simply stash the controlvm +* message, then attempt to process it again the next time +* controlvm_periodic_work() runs. +*/ + struct controlvm_message controlvm_pending_msg; + bool controlvm_pending_msg_valid; +}; -/* - * The following globals are used to handle the scenario where we are unable to - * offload the payload from a controlvm message due to memory requirements. In - * this scenario, we simply stash the controlvm message, then attempt to - * process it again the next time controlvm_periodic_work() runs. - */ -static struct controlvm_message controlvm_pending_msg; -static bool controlvm_pending_msg_valid; +static struct visorchipset_device *chipset_dev; struct parahotplug_request { struct list_head list; @@ -119,7 +122,7 @@ static ssize_t toolaction_show(struct device *dev, { u8 tool_action = 0; - visorchannel_read(controlvm_channel, + visorchannel_read(chipset_dev->controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, tool_action), &tool_action, sizeof(u8)); return sprintf(buf, "%u\n", tool_action); @@ -136,7 +139,7 @@ static ssize_t toolaction_store(struct device *dev, return -EINVAL; ret = visorchannel_write - (controlvm_channel, + (chipset_dev->controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, tool_action), &tool_action, sizeof(u8)); @@ -153,7 +156,7 @@ static ssize_t boottotool_show(struct device *dev, { struct efi_spar_indication efi_spar_indication; - visorchannel_read(controlvm_channel, + visorchannel_read(chipset_dev->controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, efi_spar_ind), &efi_spar_indication, sizeof(struct efi_spar_indication)); @@ -172,7 +175,7 @@ static ssize_t boottotool_store(struct device *dev, efi_spar_indication.boot_to_tool = val; ret = visorchannel_write - (controlvm_channel, + (chipset_dev->controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, efi_spar_ind), &(efi_spar_indication), sizeof(struct efi_spar_indication)); @@ -188,7 +191,7 @@ static ssize_t error_show(struct device *dev, struct device_attribute *attr, { u32 error = 0; - visorchannel_read(controlvm_channel, + visorchannel_read(chipset_dev->controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, installation_error), &error, sizeof(u32)); @@ -205,7 +208,7 @@ static ssize_t error_store(struc
[PATCH 07/12] staging: unisys: visorbus: vbuschannel.h: Remove kernel-doc comment
From: David Binder Removes kernel-doc formatting for comment that precedes a static function. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/vbuschannel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h index b0df261..5dbf6c5 100644 --- a/drivers/staging/unisys/visorbus/vbuschannel.h +++ b/drivers/staging/unisys/visorbus/vbuschannel.h @@ -66,7 +66,7 @@ struct ultra_vbus_deviceinfo { u8 reserved[128]; /* pad size to 256 bytes */ }; -/** +/* * vbuschannel_print_devinfo() - format a struct ultra_vbus_deviceinfo * and write it to a seq_file * @devinfo: the struct ultra_vbus_deviceinfo to format -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/12] staging: unisys: visorbus: visorbus_main.c: Remove kernel-doc comments
From: David Binder Removes kernel-doc formatting for comments that precede static functions. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 36 +- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index b36452f..1d54190 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -92,7 +92,7 @@ visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env) return 0; } -/** +/* * visorbus_match() - called automatically upon adding a visor_device *(device_add), or adding a visor_driver *(visorbus_register_visor_driver) @@ -142,7 +142,7 @@ struct bus_type visorbus_type = { .dev_groups = visorbus_dev_groups, }; -/** +/* * visorbus_release_busdevice() - called when device_unregister() is called for *the bus device instance, after all other tasks *involved with destroying the dev are complete @@ -158,7 +158,7 @@ visorbus_release_busdevice(struct device *xdev) kfree(dev); } -/** +/* * visorbus_release_device() - called when device_unregister() is called for * each child device instance * @xdev: struct device for the visor device being released @@ -464,7 +464,7 @@ dev_stop_periodic_work(struct visor_device *dev) put_device(&dev->device); } -/** +/* * visordriver_remove_device() - handle visor device going away * @xdev: struct device for the visor device being removed * @@ -583,7 +583,7 @@ visorbus_disable_channel_interrupts(struct visor_device *dev) } EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts); -/** +/* * create_visor_device() - create visor device as a result of receiving the * controlvm device_create message for a new device * @dev: a freshly-zeroed struct visor_device, containing only filled-in values @@ -694,7 +694,7 @@ get_vbus_header_info(struct visorchannel *chan, return 0; } -/** +/* * write_vbus_chp_info() - write the contents of to the struct * spar_vbus_channel_protocol.chp_info * @chan: indentifies the s-Par channel that will be updated @@ -720,7 +720,7 @@ write_vbus_chp_info(struct visorchannel *chan, visorchannel_write(chan, off, info, sizeof(*info)); } -/** +/* * write_vbus_bus_info() - write the contents of to the struct * spar_vbus_channel_protocol.bus_info * @chan: indentifies the s-Par channel that will be updated @@ -746,7 +746,7 @@ write_vbus_bus_info(struct visorchannel *chan, visorchannel_write(chan, off, info, sizeof(*info)); } -/** +/* * write_vbus_dev_info() - write the contents of to the struct * spar_vbus_channel_protocol.dev_info[] * @chan: indentifies the s-Par channel that will be updated @@ -775,7 +775,7 @@ write_vbus_dev_info(struct visorchannel *chan, visorchannel_write(chan, off, info, sizeof(*info)); } -/** +/* * fix_vbus_dev_info() - for a child device just created on a client bus, fill * in information about the driver that is controlling * this device into the the appropriate slot within the @@ -832,7 +832,7 @@ fix_vbus_dev_info(struct visor_device *visordev) &clientbus_driverinfo); } -/** +/* * visordriver_probe_device() - handle new visor device coming online * @xdev: struct device for the visor device being probed * @@ -956,7 +956,7 @@ int visorbus_register_visor_driver(struct visor_driver *drv) } EXPORT_SYMBOL_GPL(visorbus_register_visor_driver); -/** +/* * create_bus_instance() - create a device instance for the visor bus itself * @dev: struct visor_device indicating the bus instance * @@ -1027,7 +1027,7 @@ create_bus_instance(struct visor_device *dev) return err; } -/** +/* * remove_bus_instance() - remove a device instance for the visor bus itself * @dev: struct visor_device indentifying the bus to remove */ @@ -1051,7 +1051,7 @@ remove_bus_instance(struct visor_device *dev) device_unregister(&dev->device); } -/** +/* * create_bus_type() - create and register the one-and-only one instance of * the visor bus type (visorbus_type) * Return: 0 for success, otherwise negative errno value returned by @@ -1064,7 +1064,7 @@ create_bus_type(void) return busreg_rc; } -/** +/* * remove_bus_type() - remove the one-and-only one instance of the visor bus * type (visorbus_type) */ @@ -1074,7 +1074,7 @@ remove_bus_type(void) bus_unregister(&visorbus_type); } -/** +/* * remove_all_visor_device
[PATCH 11/12] staging: unisys: visorbus: remove character device interface
From: Sameer Wadgaonkar Removed the character device interface from visorchipset and removed the major and minor numbers. Reported-by: Greg Kroah-Hartman Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 158 +-- 1 file changed, 158 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index b3c3cdd..c120c46 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -15,7 +15,6 @@ */ #include -#include #include #include #include @@ -36,8 +35,6 @@ #define MAX_CONTROLVM_PAYLOAD_BYTES (1024 * 128) -#define VISORCHIPSET_MMAP_CONTROLCHANOFFSET0x - #define UNISYS_SPAR_LEAF_ID 0x4000 /* The s-Par leaf ID returns "UnisysSpar64" encoded across ebx, ecx, edx */ @@ -46,27 +43,6 @@ #define UNISYS_SPAR_ID_EDX 0x34367261 /* - * Module parameters - */ -static int visorchipset_major; - -static int -visorchipset_open(struct inode *inode, struct file *file) -{ - unsigned int minor_number = iminor(inode); - - if (minor_number) - return -ENODEV; - return 0; -} - -static int -visorchipset_release(struct inode *inode, struct file *file) -{ - return 0; -} - -/* * When the controlvm channel is idle for at least MIN_IDLE_SECONDS, * we switch to slow polling mode. As soon as we get a controlvm * message, we switch back to fast polling mode. @@ -88,8 +64,6 @@ struct visorchipset_device { /* when we got our last controlvm message */ unsigned long most_recent_message_jiffies; struct delayed_work periodic_controlvm_work; - struct cdev file_cdev; - struct visorchannel **file_controlvm_channel; struct visorchannel *controlvm_channel; unsigned long controlvm_payload_bytes_buffered; /* @@ -112,9 +86,6 @@ struct parahotplug_request { struct controlvm_message msg; }; -/* info for /dev/visorchipset */ -static dev_t major_dev = -1; /*< indicates major num for device */ - /* prototypes for attributes */ static ssize_t toolaction_show(struct device *dev, struct device_attribute *attr, @@ -1537,46 +1508,6 @@ device_resume_response(struct visor_device *dev_info, int response) dev_info->pending_msg_hdr = NULL; } -static int -visorchipset_mmap(struct file *file, struct vm_area_struct *vma) -{ - unsigned long physaddr = 0; - unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; - u64 addr = 0; - - /* sv_enable_dfp(); */ - if (offset & (PAGE_SIZE - 1)) - return -ENXIO; /* need aligned offsets */ - - switch (offset) { - case VISORCHIPSET_MMAP_CONTROLCHANOFFSET: - vma->vm_flags |= VM_IO; - if (!*chipset_dev->file_controlvm_channel) - return -ENXIO; - - visorchannel_read - (*chipset_dev->file_controlvm_channel, -offsetof(struct spar_controlvm_channel_protocol, - gp_control_channel), -&addr, sizeof(addr)); - if (!addr) - return -ENXIO; - - physaddr = (unsigned long)addr; - if (remap_pfn_range(vma, vma->vm_start, - physaddr >> PAGE_SHIFT, - vma->vm_end - vma->vm_start, - /*pgprot_noncached */ - (vma->vm_page_prot))) { - return -EAGAIN; - } - break; - default: - return -ENXIO; - } - return 0; -} - static inline s64 issue_vmcall_query_guest_virtual_time_offset(void) { u64 result = VMCALL_SUCCESS; @@ -1595,79 +1526,6 @@ static inline int issue_vmcall_update_physical_time(u64 adjustment) return result; } -static long visorchipset_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) -{ - u64 adjustment; - s64 vrtc_offset; - - switch (cmd) { - case VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET: - /* get the physical rtc offset */ - vrtc_offset = issue_vmcall_query_guest_virtual_time_offset(); - if (copy_to_user((void __user *)arg, &vrtc_offset, -sizeof(vrtc_offset))) { - return -EFAULT; - } - return 0; - case VMCALL_UPDATE_PHYSICAL_TIME: - if (copy_from_user(&adjustment, (void __user *)arg, - sizeof(adjustment))) { - return -EFAULT; - } - return issue_vmcall_updat
[PATCH 00/36] staging: unisys: additional code cleanups
This series cleans up several different checkpatch, sparse and other miscellaneous code issues found throughout the Unisys s-Par driver stack. It also cleans up the comments surrounding #defines. Note: Acceptence of this patch series determines whether or not the team will partake in a soft, sweet food made from a mixture of flour, shortening, eggs, sugar and other ingredients, baked and often decorated. Though some would suggest that it is a lie. Alexander Curtin (2): staging: unisys: include: replaced COVERQ with DIV_ROUND_UP staging: unisys: visorbus_main: removed revference to virtpci David Binder (21): staging: unisys: include: Wrap macro argument in parenthesis staging: unisys: include: Remove unused visorchannel #defines staging: unisys: visorbus: Remove useless checks in visorbus_main.c staging: unisys: visorbus: Rename #define VMCALL_IO_CONTROLVM_ADDR staging: unisys: include: Change out-of-date references staging: unisys: visornic: Move function to appropriate location staging: unisys: visorbus: Rename what vmcallinterface.h #define staging: unisys: visorinput: Remove unnecessary usage of local variable staging: unisys: include: Add function definition argument identifier staging: unisys: visorbus: Remove pointer cast that causes sparse warning staging: unisys: visorbus: visorchannel.c: Fix #define formatting staging: unisys: visorbus: visorbus_main.c: Fix #define formatting staging: unisys: visorbus: controlvmchannel.h: Fix #define formatting staging: unisys: visorbus: visorchipset.c: Fix #define formatting staging: unisys: visorbus: vbuschannel.h: Fix #define formatting staging: unisys: visorbus: vmcallinterface.h: Fix #define formatting staging: unisys: visorinput: visorinput.c: Fix #define formatting staging: unisys: visorhba: visorhba_main.c: Fix #define formatting staging: unisys: include: iochannel.h: Fix #define formatting staging: unisys: include: visorbus.h: Fix #define formatting staging: unisys: include: channel.h: Fix #define formatting David Kershner (1): staging: unisys: include: simplify spar_check_channel_client Jon Frisch (5): staging: unisys: include: remove macro lengthof staging: unisys: include: removed unused function declarations staging: unisys: include: remove irrelevant comments staging: unisys: visornic: remove inline functions staging: unisys: visorbus: remove #pragma directive Sameer Wadgaonkar (7): staging: unisys: visorbus: removed unused structure pci_id staging: unisys: include: remove unused function spar_check_channel_server staging: unisys: include: remove unused macro spar_signal_init staging: unisys: visorbus: remove unused functions in visorchipset staging: unisys: visorhba: remove inline keyword staging: unisys: visorbus: remove inline keyword from visorchipset staging: unisys: visorbus: remove inline keyword in visorchannel.c drivers/staging/unisys/include/channel.h | 203 +- drivers/staging/unisys/include/iochannel.h | 65 + drivers/staging/unisys/include/visorbus.h | 6 +- drivers/staging/unisys/visorbus/controlvmchannel.h | 142 -- drivers/staging/unisys/visorbus/vbuschannel.h | 28 +-- drivers/staging/unisys/visorbus/visorbus_main.c| 28 +-- drivers/staging/unisys/visorbus/visorbus_private.h | 2 +- drivers/staging/unisys/visorbus/visorchannel.c | 21 +- drivers/staging/unisys/visorbus/visorchipset.c | 24 +-- drivers/staging/unisys/visorbus/vmcallinterface.h | 40 +-- drivers/staging/unisys/visorhba/visorhba_main.c| 16 +- drivers/staging/unisys/visorinput/visorinput.c | 21 +- drivers/staging/unisys/visornic/visornic_main.c| 49 ++- 13 files changed, 222 insertions(+), 423 deletions(-) base-commit: 7bc49cb9b9b8bad32536c4b6d1aff1824c1adc6c -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/36] staging: unisys: include: replaced COVERQ with DIV_ROUND_UP
From: Alexander Curtin COVERQ is functionally equivalent to DIV_ROUND_UP and was only used to define the COVER macro. Signed-off-by: Alexander Curtin Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index 1c95302..8024529 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -41,11 +41,8 @@ #ifndef lengthof #define lengthof(TYPE, MEMBER) (sizeof(((TYPE *)0)->MEMBER)) #endif -#ifndef COVERQ -#define COVERQ(v, d) (((v) + (d) - 1) / (d)) -#endif #ifndef COVER -#define COVER(v, d) ((d) * COVERQ(v, d)) +#define COVER(v, d) ((d) * DIV_ROUND_UP(v, d)) #endif #define ULTRA_CHANNEL_PROTOCOL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L') -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/36] staging: unisys: visorbus: remove unused functions in visorchipset
From: Sameer Wadgaonkar Removed unused functions issue_vmcall_update_physical_time() and issue_vmcall_query_guest_virtual_time_offset() from visorchipset.c Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index cce1974..893bdb3 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1495,24 +1495,6 @@ device_resume_response(struct visor_device *dev_info, int response) dev_info->pending_msg_hdr = NULL; } -static inline s64 issue_vmcall_query_guest_virtual_time_offset(void) -{ - u64 result = VMCALL_SUCCESS; - u64 physaddr = 0; - - ISSUE_IO_VMCALL(VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET, physaddr, - result); - return result; -} - -static inline int issue_vmcall_update_physical_time(u64 adjustment) -{ - int result = VMCALL_SUCCESS; - - ISSUE_IO_VMCALL(VMCALL_UPDATE_PHYSICAL_TIME, adjustment, result); - return result; -} - static struct parser_context * parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry) { -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/36] staging: unisys: visorbus: remove inline keyword from visorchipset
From: Sameer Wadgaonkar Removed inline keyword from the functions in visorchipset: * issue_vmcall_io_controlvm_addr() Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 893bdb3..184cf5f 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1313,7 +1313,7 @@ chipset_notready_uevent(struct controlvm_message_header *msg_hdr) return 0; } -static inline unsigned int +static unsigned int issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes) { struct vmcall_io_controlvm_addr_params params; -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/36] staging: unisys: include: remove unused function spar_check_channel_server
From: Sameer Wadgaonkar Removed unused function spar_check_channel_server from channel.h Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 19 --- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index 8024529..88fec81 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -287,25 +287,6 @@ spar_check_channel_client(void __iomem *ch, return 1; } -/* Generic function useful for validating any type of channel when it is about - * to be initialized by the server of the channel. - * Note that is only needed for callers in the EFI environment, and - * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages. - */ -static inline int spar_check_channel_server(uuid_le typeuuid, char *name, - u64 expected_min_bytes, - u64 actual_bytes) -{ - if (expected_min_bytes > 0) /* verify channel size */ - if (actual_bytes < expected_min_bytes) { - pr_err("Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8llx actual=0x%-8.8llx\n", - name, &typeuuid, expected_min_bytes, - actual_bytes); - return 0; - } - return 1; -} - /* * Routine Description: * Tries to insert the prebuilt signal pointed to by pSignal into the nth -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 17/36] staging: unisys: visorinput: Remove unnecessary usage of local variable
From: David Binder Remove local variable on stack by directly returning the value in the array. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorinput/visorinput.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c index 949cce6..3fc7d9e 100644 --- a/drivers/staging/unisys/visorinput/visorinput.c +++ b/drivers/staging/unisys/visorinput/visorinput.c @@ -539,13 +539,10 @@ handle_locking_key(struct input_dev *visorinput_dev, static int scancode_to_keycode(int scancode) { - int keycode; - if (scancode > 0xff) - keycode = visorkbd_ext_keycode[(scancode >> 8) & 0xff]; - else - keycode = visorkbd_keycode[scancode]; - return keycode; + return visorkbd_ext_keycode[(scancode >> 8) & 0xff]; + + return visorkbd_keycode[scancode]; } static int -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/36] staging: unisys: visorbus_main: removed revference to virtpci
From: Alexander Curtin The comment referencing virtpci was irrelevant. Signed-off-by: Alexander Curtin Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index e7b04b6..e9c7d1a 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -823,10 +823,6 @@ fix_vbus_dev_info(struct visor_device *visordev) bus_device_info_init(&dev_info, chan_type_name, visordrv->name); write_vbus_dev_info(bdev->visorchannel, hdr_info, &dev_info, dev_no); - /* -* Re-write bus+chipset info, because it is possible that this -* was previously written by our evil counterpart, virtpci. -*/ write_vbus_chp_info(bdev->visorchannel, hdr_info, &chipset_driverinfo); write_vbus_bus_info(bdev->visorchannel, hdr_info, &clientbus_driverinfo); -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/36] staging: unisys: visorhba: remove inline keyword
From: Sameer Wadgaonkar Removed inline keyword from the function complete_taskmgmt_command in visorhba_main.c Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorhba/visorhba_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 4018d5a..3df9c0e 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -686,8 +686,8 @@ static const struct file_operations info_debugfs_fops = { * command. Wake up anyone waiting for it. * Returns void */ -static inline void complete_taskmgmt_command -(struct idr *idrtable, struct uiscmdrsp *cmdrsp, int result) +static void complete_taskmgmt_command(struct idr *idrtable, + struct uiscmdrsp *cmdrsp, int result) { wait_queue_head_t *wq = idr_find(idrtable, cmdrsp->scsitaskmgmt.notify_handle); -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/36] staging: unisys: include: remove unused macro spar_signal_init
From: Sameer Wadgaonkar Removed unused macro spar_signal_init from channel.h Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index 88fec81..e202f5b 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -211,20 +211,6 @@ struct signal_queue_header { u8 filler[12]; /* Pad out to 64 byte cacheline */ } __packed; -#define spar_signal_init(chan, QHDRFLD, QDATAFLD, QDATATYPE, ver, typ) \ - do {\ - memset(&chan->QHDRFLD, 0, sizeof(chan->QHDRFLD)); \ - chan->QHDRFLD.version = ver;\ - chan->QHDRFLD.chtype = typ; \ - chan->QHDRFLD.size = sizeof(chan->QDATAFLD);\ - chan->QHDRFLD.signal_size = sizeof(QDATATYPE); \ - chan->QHDRFLD.sig_base_offset = (u64)(chan->QDATAFLD) - \ - (u64)(&chan->QHDRFLD); \ - chan->QHDRFLD.max_slots = \ - sizeof(chan->QDATAFLD) / sizeof(QDATATYPE); \ - chan->QHDRFLD.max_signals = chan->QHDRFLD.max_slots - 1;\ - } while (0) - /* Generic function useful for validating any type of channel when it is * received by the client that will be accessing the channel. * Note that is only needed for callers in the EFI environment, and -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/36] staging: unisys: visorbus: remove inline keyword in visorchannel.c
From: Sameer Wadgaonkar Removed inline keyword from functions sig_read_data and sig_write_data in visorchannel.c Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchannel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 1e3dc58..31cd37d 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -199,7 +199,7 @@ sig_read_header(struct visorchannel *channel, u32 queue, sig_hdr, sizeof(struct signal_queue_header)); } -static inline int +static int sig_read_data(struct visorchannel *channel, u32 queue, struct signal_queue_header *sig_hdr, u32 slot, void *data) { @@ -210,7 +210,7 @@ sig_read_data(struct visorchannel *channel, u32 queue, data, sig_hdr->signal_size); } -static inline int +static int sig_write_data(struct visorchannel *channel, u32 queue, struct signal_queue_header *sig_hdr, u32 slot, void *data) { -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/36] staging: unisys: include: Wrap macro argument in parenthesis
From: David Binder Addresses checkpatch check by wrapping macro argument in parenthesis. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index e202f5b..36dbe21 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -32,7 +32,7 @@ */ #define __SUPERVISOR_CHANNEL_H__ -#define SIGNATURE_16(A, B) ((A) | (B << 8)) +#define SIGNATURE_16(A, B) ((A) | ((B) << 8)) #define SIGNATURE_32(A, B, C, D) \ (SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16)) #define SIGNATURE_64(A, B, C, D, E, F, G, H) \ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/36] staging: unisys: visorbus: Remove pointer cast that causes sparse warning
From: David Binder Removes unnecessary cast of to __iomem of a non-io-mapped pointer, thereby eliminating the following sparse warning: visorchannel.c:159:17: warning: cast adds address space to expression () Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_private.h | 2 +- drivers/staging/unisys/visorbus/visorchannel.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index 49bec17..eb8b3ec 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -81,5 +81,5 @@ u64 visorchannel_get_clientpartition(struct visorchannel *channel); int visorchannel_set_clientpartition(struct visorchannel *channel, u64 partition_handle); char *visorchannel_uuid_id(uuid_le *guid, char *s); -void __iomem *visorchannel_get_header(struct visorchannel *channel); +void *visorchannel_get_header(struct visorchannel *channel); #endif diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 31cd37d..1b1ef93 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -153,10 +153,10 @@ visorchannel_write(struct visorchannel *channel, ulong offset, return 0; } -void __iomem * +void * visorchannel_get_header(struct visorchannel *channel) { - return (void __iomem *)&channel->chan_hdr; + return &channel->chan_hdr; } /* -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 18/36] staging: unisys: include: Add function definition argument identifier
From: David Binder Adds identifier to function definition arguments to satisfy checkpatch warnings: WARNING: function definition argument 'struct visor_driver *' should also have an identifier name WARNING: function definition argument 'struct visor_driver *' should also have an identifier name Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/visorbus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 03d56f8..0bb7903 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -172,8 +172,8 @@ struct visor_device { #define to_visor_device(x) container_of(x, struct visor_device, device) -int visorbus_register_visor_driver(struct visor_driver *); -void visorbus_unregister_visor_driver(struct visor_driver *); +int visorbus_register_visor_driver(struct visor_driver *drv); +void visorbus_unregister_visor_driver(struct visor_driver *drv); int visorbus_read_channel(struct visor_device *dev, unsigned long offset, void *dest, unsigned long nbytes); -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/36] staging: unisys: include: removed unused function declarations
From: Jon Frisch This patch removes the unused function declarations in channel.h. Signed-off-by: Jon Frisch Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 80 +- 1 file changed, 80 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index e5e3698..048ef16 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -260,86 +260,6 @@ spar_check_channel_client(struct channel_header *ch, } /* - * Routine Description: - * Tries to insert the prebuilt signal pointed to by pSignal into the nth - * Queue of the Channel pointed to by pChannel - * - * Parameters: - * pChannel: (IN) points to the IO Channel - * Queue: (IN) nth Queue of the IO Channel - * pSignal: (IN) pointer to the signal - * - * Assumptions: - * - pChannel, Queue and pSignal are valid. - * - If insertion fails due to a full queue, the caller will determine the - * retry policy (e.g. wait & try again, report an error, etc.). - * - * Return value: 1 if the insertion succeeds, 0 if the queue was - * full. - */ - -unsigned char spar_signal_insert(struct channel_header __iomem *ch, u32 queue, -void *sig); - -/* - * Routine Description: - * Removes one signal from Channel pChannel's nth Queue at the - * time of the call and copies it into the memory pointed to by - * pSignal. - * - * Parameters: - * pChannel: (IN) points to the IO Channel - * Queue: (IN) nth Queue of the IO Channel - * pSignal: (IN) pointer to where the signals are to be copied - * - * Assumptions: - * - pChannel and Queue are valid. - * - pSignal points to a memory area large enough to hold queue's SignalSize - * - * Return value: 1 if the removal succeeds, 0 if the queue was - * empty. - */ - -unsigned char spar_signal_remove(struct channel_header __iomem *ch, u32 queue, -void *sig); - -/* - * Routine Description: - * Removes all signals present in Channel pChannel's nth Queue at the - * time of the call and copies them into the memory pointed to by - * pSignal. Returns the # of signals copied as the value of the routine. - * - * Parameters: - * pChannel: (IN) points to the IO Channel - * Queue: (IN) nth Queue of the IO Channel - * pSignal: (IN) pointer to where the signals are to be copied - * - * Assumptions: - * - pChannel and Queue are valid. - * - pSignal points to a memory area large enough to hold Queue's MaxSignals - * # of signals, each of which is Queue's SignalSize. - * - * Return value: - * # of signals copied. - */ -unsigned int spar_signal_remove_all(struct channel_header *ch, u32 queue, - void *sig); - -/* - * Routine Description: - * Determine whether a signal queue is empty. - * - * Parameters: - * pChannel: (IN) points to the IO Channel - * Queue: (IN) nth Queue of the IO Channel - * - * Return value: - * 1 if the signal queue is empty, 0 otherwise. - */ -unsigned char spar_signalqueue_empty(struct channel_header __iomem *ch, -u32 queue); - -/* * CHANNEL Guids */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 26/36] staging: unisys: visorbus: visorchannel.c: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchannel.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index 1b1ef93..686137a 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -29,8 +29,9 @@ #define MYDRVNAME "visorchannel" #define SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID \ - UUID_LE(0x3cd6e705, 0xd6a2, 0x4aa5, \ + UUID_LE(0x3cd6e705, 0xd6a2, 0x4aa5, \ 0xad, 0x5c, 0x7b, 0x8, 0x88, 0x9d, 0xff, 0xe2) + static const uuid_le spar_video_guid = SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID; struct visorchannel { @@ -173,17 +174,17 @@ visorchannel_get_header(struct visorchannel *channel) */ #define SIG_DATA_OFFSET(chan_hdr, q, sig_hdr, slot) \ (SIG_QUEUE_OFFSET(chan_hdr, q) + (sig_hdr)->sig_base_offset + \ - ((slot) * (sig_hdr)->signal_size)) +((slot) * (sig_hdr)->signal_size)) /* * Write the contents of a specific field within a SIGNAL_QUEUE_HEADER back * into host memory */ -#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ - visorchannel_write(channel, \ - SIG_QUEUE_OFFSET(&channel->chan_hdr, queue) +\ +#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ + visorchannel_write(channel, \ + SIG_QUEUE_OFFSET(&channel->chan_hdr, queue) + \ offsetof(struct signal_queue_header, FIELD), \ - &((sig_hdr)->FIELD), \ + &((sig_hdr)->FIELD), \ sizeof((sig_hdr)->FIELD)) static int -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/36] staging: unisys: visorbus: Rename what vmcallinterface.h #define
From: David Binder Renames __IOMONINTF_H__ to __VMCALLINTERFACE_H__, which more closely reflects the naming conventions of the code. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/vmcallinterface.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h b/drivers/staging/unisys/visorbus/vmcallinterface.h index 1a65336..3ba1ed7 100644 --- a/drivers/staging/unisys/visorbus/vmcallinterface.h +++ b/drivers/staging/unisys/visorbus/vmcallinterface.h @@ -12,8 +12,8 @@ * details. */ -#ifndef __IOMONINTF_H__ -#define __IOMONINTF_H__ +#ifndef __VMCALLINTERFACE_H__ +#define __VMCALLINTERFACE_H__ /* * This file contains all structures needed to support the VMCALLs for IO @@ -174,4 +174,4 @@ do { \ MDS_APPOS, post_code_temp); \ } while (0) -#endif /* __IOMONINTF_H__ */ +#endif /* __VMCALLINTERFACE_H__ */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 27/36] staging: unisys: visorbus: visorbus_main.c: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorbus_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index cdad654..fc841b1 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -31,7 +31,7 @@ static int visorbus_forcenomatch; #define LINESIZE 99 #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c -#define POLLJIFFIES_NORMALCHANNEL 10 +#define POLLJIFFIES_NORMALCHANNEL 10 static int busreg_rc = -ENODEV; /* stores the result from bus registration */ static struct dentry *visorbus_debugfs_dir; -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/36] staging: unisys: visorbus: Remove useless checks in visorbus_main.c
From: David Binder Removes checks that all visor_device instances have an associated visorchannel. Due to the design of the s-Par drivers these checks are unnecessary. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorbus_main.c | 22 -- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index e9c7d1a..cdad654 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -185,8 +185,6 @@ static ssize_t physaddr_show(struct device *dev, struct device_attribute *attr, { struct visor_device *vdev = to_visor_device(dev); - if (!vdev->visorchannel) - return 0; return sprintf(buf, "0x%llx\n", visorchannel_get_physaddr(vdev->visorchannel)); } @@ -197,8 +195,6 @@ static ssize_t nbytes_show(struct device *dev, struct device_attribute *attr, { struct visor_device *vdev = to_visor_device(dev); - if (!vdev->visorchannel) - return 0; return sprintf(buf, "0x%lx\n", visorchannel_get_nbytes(vdev->visorchannel)); } @@ -209,8 +205,6 @@ static ssize_t clientpartition_show(struct device *dev, { struct visor_device *vdev = to_visor_device(dev); - if (!vdev->visorchannel) - return 0; return sprintf(buf, "0x%llx\n", visorchannel_get_clientpartition(vdev->visorchannel)); } @@ -222,8 +216,6 @@ static ssize_t typeguid_show(struct device *dev, struct device_attribute *attr, struct visor_device *vdev = to_visor_device(dev); char typeid[LINESIZE]; - if (!vdev->visorchannel) - return 0; return sprintf(buf, "%s\n", visorchannel_id(vdev->visorchannel, typeid)); } @@ -235,8 +227,6 @@ static ssize_t zoneguid_show(struct device *dev, struct device_attribute *attr, struct visor_device *vdev = to_visor_device(dev); char zoneid[LINESIZE]; - if (!vdev->visorchannel) - return 0; return sprintf(buf, "%s\n", visorchannel_zoneid(vdev->visorchannel, zoneid)); } @@ -245,13 +235,12 @@ static DEVICE_ATTR_RO(zoneguid); static ssize_t typename_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct visor_device *vdev = to_visor_device(dev); int i = 0; struct bus_type *xbus = dev->bus; struct device_driver *xdrv = dev->driver; struct visor_driver *drv = NULL; - if (!vdev->visorchannel || !xbus || !xdrv) + if (!xbus || !xdrv) return 0; i = xbus->match(dev, xdrv); if (!i) @@ -344,11 +333,10 @@ static ssize_t channel_id_show(struct device *dev, struct visor_device *vdev = to_visor_device(dev); int len = 0; - if (vdev->visorchannel) { - visorchannel_id(vdev->visorchannel, buf); - len = strlen(buf); - buf[len++] = '\n'; - } + visorchannel_id(vdev->visorchannel, buf); + len = strlen(buf); + buf[len++] = '\n'; + return len; } static DEVICE_ATTR_RO(channel_id); -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/36] staging: unisys: visorbus: visorchipset.c: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/visorchipset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index c7b7cae..46c5a93 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -29,7 +29,7 @@ #define CURRENT_FILE_PC VISOR_BUS_PC_visorchipset_c -#define POLLJIFFIES_CONTROLVMCHANNEL_FAST 1 +#define POLLJIFFIES_CONTROLVMCHANNEL_FAST 1 #define POLLJIFFIES_CONTROLVMCHANNEL_SLOW 100 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024 * 128) -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/36] staging: unisys: visorbus: controlvmchannel.h: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/controlvmchannel.h | 134 +++--- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h b/drivers/staging/unisys/visorbus/controlvmchannel.h index 79f77ad..63f9e44 100644 --- a/drivers/staging/unisys/visorbus/controlvmchannel.h +++ b/drivers/staging/unisys/visorbus/controlvmchannel.h @@ -19,9 +19,9 @@ #include "channel.h" /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */ -#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \ - UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \ - 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d) +#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \ + UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \ + 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d) #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \ ULTRA_CHANNEL_PROTOCOL_SIGNATURE @@ -33,24 +33,24 @@ * software. Note that you can usually add fields to the END of the * channel struct withOUT needing to increment this. */ -#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1 +#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1 -#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \ - spar_check_channel_client(ch, \ +#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \ + (spar_check_channel_client(ch, \ SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \ "controlvm", \ sizeof(struct spar_controlvm_channel_protocol), \ ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \ - ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE) + ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE)) /* Defines for various channel queues */ -#define CONTROLVM_QUEUE_REQUEST0 -#define CONTROLVM_QUEUE_RESPONSE 1 -#define CONTROLVM_QUEUE_EVENT 2 -#define CONTROLVM_QUEUE_ACK3 +#define CONTROLVM_QUEUE_REQUEST 0 +#define CONTROLVM_QUEUE_RESPONSE 1 +#define CONTROLVM_QUEUE_EVENT 2 +#define CONTROLVM_QUEUE_ACK 3 /* Max num of messages stored during IOVM creation to be reused after crash */ -#define CONTROLVM_CRASHMSG_MAX 2 +#define CONTROLVM_CRASHMSG_MAX 2 struct spar_segment_state { /* Bit 0: May enter other states */ @@ -453,78 +453,78 @@ struct spar_controlvm_parameters_header { }; /* General Errors--[0-99] */ -#define CONTROLVM_RESP_SUCCESS 0 -#define CONTROLVM_RESP_ALREADY_DONE 1 -#define CONTROLVM_RESP_IOREMAP_FAILED 2 -#define CONTROLVM_RESP_KMALLOC_FAILED 3 -#define CONTROLVM_RESP_ID_UNKNOWN 4 -#define CONTROLVM_RESP_ID_INVALID_FOR_CLIENT5 +#define CONTROLVM_RESP_SUCCESS0 +#define CONTROLVM_RESP_ALREADY_DONE 1 +#define CONTROLVM_RESP_IOREMAP_FAILED 2 +#define CONTROLVM_RESP_KMALLOC_FAILED 3 +#define CONTROLVM_RESP_ID_UNKNOWN 4 +#define CONTROLVM_RESP_ID_INVALID_FOR_CLIENT 5 /* CONTROLVM_INIT_CHIPSET---[100-199] */ -#define CONTROLVM_RESP_CLIENT_SWITCHCOUNT_NONZERO 100 -#define CONTROLVM_RESP_EXPECTED_CHIPSET_INIT101 +#define CONTROLVM_RESP_CLIENT_SWITCHCOUNT_NONZERO 100 +#define CONTROLVM_RESP_EXPECTED_CHIPSET_INIT 101 /* Maximum Limit[200-299] */ -#define CONTROLVM_RESP_ERROR_MAX_BUSES 201 /* BUS_CREATE */ -#define CONTROLVM_RESP_ERROR_MAX_DEVICES202/* DEVICE_CREATE */ +#define CONTROLVM_RESP_ERROR_MAX_BUSES201 /* BUS_CREATE */ +#define CONTROLVM_RESP_ERROR_MAX_DEVICES 202 /* DEVICE_CREATE */ /* Payload and Parameter Related[400-499] */ -#define CONTROLVM_RESP_PAYLOAD_INVALID 400 /* SWITCH_ATTACHEXTPORT, -* DEVICE_CONFIGURE -*/ -#define CONTROLVM_RESP_INITIATOR_PARAMETER_INVALID 401 /* Multiple */ -#define CONTROLVM_RESP_TARGET_PARAMETER_INVALID402 /* DEVICE_CONFIGURE */ -#define CONTROLVM_RESP_CLIENT_PARAMETER_INVALID403 /* DEVICE_CONFIGURE */ +#define CONTROLVM_RESP_PAYLOAD_IN
[PATCH 19/36] staging: unisys: include: simplify spar_check_channel_client
The function spar_check_channel_client shouldn't need to do readq's, it is referencing a local copy of the channel header. Simplify it to just access the fields directly. Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 37 - 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index d3c1dac..8c6a7ad 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -217,7 +217,7 @@ struct signal_queue_header { * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages. */ static inline int -spar_check_channel_client(void __iomem *ch, +spar_check_channel_client(struct channel_header *ch, uuid_le expected_uuid, char *chname, u64 expected_min_bytes, @@ -225,48 +225,37 @@ spar_check_channel_client(void __iomem *ch, u64 expected_signature) { if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) { - uuid_le guid; - - memcpy_fromio(&guid, - &((struct channel_header __iomem *)(ch))->chtype, - sizeof(guid)); /* caller wants us to verify type GUID */ - if (uuid_le_cmp(guid, expected_uuid) != 0) { + if (uuid_le_cmp(ch->chtype, expected_uuid) != 0) { pr_err("Channel mismatch on channel=%s(%pUL) field=type expected=%pUL actual=%pUL\n", chname, &expected_uuid, - &expected_uuid, &guid); + &expected_uuid, &ch->chtype); return 0; } } if (expected_min_bytes > 0) { /* verify channel size */ - unsigned long long bytes = - readq(&((struct channel_header __iomem *) - (ch))->size); - if (bytes < expected_min_bytes) { + if (ch->size < expected_min_bytes) { pr_err("Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8Lx actual=0x%-8.8Lx\n", chname, &expected_uuid, - (unsigned long long)expected_min_bytes, bytes); + (unsigned long long)expected_min_bytes, + ch->size); return 0; } } if (expected_version > 0) { /* verify channel version */ - unsigned long ver = readl(&((struct channel_header __iomem *) - (ch))->version_id); - if (ver != expected_version) { - pr_err("Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8lx\n", + if (ch->version_id != expected_version) { + pr_err("Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8x\n", chname, &expected_uuid, - (unsigned long)expected_version, ver); + (unsigned long)expected_version, + ch->version_id); return 0; } } if (expected_signature > 0) { /* verify channel signature */ - unsigned long long sig = - readq(&((struct channel_header __iomem *) - (ch))->signature); - if (sig != expected_signature) { - pr_err("Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8llx actual=0x%-8.8llx\n", + if (ch->signature != expected_signature) { + pr_err("Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8Lx actual=0x%-8.8Lx\n", chname, &expected_uuid, - expected_signature, sig); + expected_signature, ch->signature); return 0; } } -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/36] staging: unisys: visorbus: Rename #define VMCALL_IO_CONTROLVM_ADDR
From: David Binder Rename #define VMCALL_IO_CONTROLVM_ADDR to VMCALL_CONTROLVM_ADDR, as this vmcall can be used by any partition, not just the IO partition. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/visorchipset.c| 2 +- drivers/staging/unisys/visorbus/vmcallinterface.h | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 184cf5f..c7b7cae 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1321,7 +1321,7 @@ issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes) u64 physaddr; physaddr = virt_to_phys(¶ms); - ISSUE_IO_VMCALL(VMCALL_IO_CONTROLVM_ADDR, physaddr, result); + ISSUE_IO_VMCALL(VMCALL_CONTROLVM_ADDR, physaddr, result); if (VMCALL_SUCCESSFUL(result)) { *control_addr = params.address; *control_bytes = params.channel_bytes; diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h b/drivers/staging/unisys/visorbus/vmcallinterface.h index d1d72c1..1a65336 100644 --- a/drivers/staging/unisys/visorbus/vmcallinterface.h +++ b/drivers/staging/unisys/visorbus/vmcallinterface.h @@ -54,8 +54,8 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple, return result; } -#ifdef VMCALL_IO_CONTROLVM_ADDR -#undef VMCALL_IO_CONTROLVM_ADDR +#ifdef VMCALL_CONTROLVM_ADDR +#undef VMCALL_CONTROLVM_ADDR #endif /* */ /* define subsystem number for AppOS, used in uislib driver */ @@ -72,7 +72,7 @@ enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */ * type of VMCALL */ /* used by all Guests, not just IO */ - VMCALL_IO_CONTROLVM_ADDR = 0x0501, + VMCALL_CONTROLVM_ADDR = 0x0501, /* Allow caller to query virtual time offset */ VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET = 0x0708, /* LOGEVENT Post Code (RDX) with specified subsystem mask */ @@ -95,7 +95,7 @@ enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */ /* Structures for IO VMCALLs */ -/* Parameters to VMCALL_IO_CONTROLVM_ADDR interface */ +/* Parameters to VMCALL_CONTROLVM_ADDR interface */ struct vmcall_io_controlvm_addr_params { /* The Guest-relative physical address of the ControlVm channel. */ /* This VMCall fills this in with the appropriate address. */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/36] staging: unisys: visorbus: remove #pragma directive
From: Jon Frisch This patch removes the #pragma directive from visorchannel.h and adds the __packed keyword to all structs to suppress structure padding. Signed-off-by: Jon Frisch Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visorbus/vbuschannel.h | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h index 5dbf6c5..408bb3a 100644 --- a/drivers/staging/unisys/visorbus/vbuschannel.h +++ b/drivers/staging/unisys/visorbus/vbuschannel.h @@ -51,8 +51,6 @@ static const uuid_le spar_vbus_channel_protocol_uuid = SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID, \ SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE) -#pragma pack(push, 1) /* both GCC and VC now allow this pragma */ - /* * An array of this struct is present in the channel area for each vbus. * (See vbuschannel.h.) @@ -64,7 +62,7 @@ struct ultra_vbus_deviceinfo { u8 drvname[16]; /* driver .sys file name */ u8 infostrs[96];/* kernel version */ u8 reserved[128]; /* pad size to 256 bytes */ -}; +} __packed; /* * vbuschannel_print_devinfo() - format a struct ultra_vbus_deviceinfo @@ -113,7 +111,7 @@ struct spar_vbus_headerinfo { u32 dev_info_offset;/* byte offset from beginning of this struct */ /* to the DevInfo array (below) */ u8 reserved[104]; -}; +} __packed; struct spar_vbus_channel_protocol { struct channel_header channel_header; /* initialized by server */ @@ -125,8 +123,6 @@ struct spar_vbus_channel_protocol { /* describes client bus device and driver */ struct ultra_vbus_deviceinfo dev_info[0]; /* describes client device and driver for each device on the bus */ -}; - -#pragma pack(pop) +} __packed; #endif -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/36] staging: unisys: visorhba: visorhba_main.c: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorhba/visorhba_main.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 3df9c0e..d372115 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -28,9 +28,9 @@ /* The Send and Receive Buffers of the IO Queue may both be full */ -#define IOS_ERROR_THRESHOLD1000 -#define MAX_PENDING_REQUESTS (MIN_NUMSIGNALS * 2) -#define VISORHBA_ERROR_COUNT 30 +#define IOS_ERROR_THRESHOLD 1000 +#define MAX_PENDING_REQUESTS (MIN_NUMSIGNALS * 2) +#define VISORHBA_ERROR_COUNT 30 static struct dentry *visorhba_debugfs_dir; @@ -101,10 +101,10 @@ struct visorhba_devices_open { struct visorhba_devdata *devdata; }; -#define for_each_vdisk_match(iter, list, match) \ +#define for_each_vdisk_match(iter, list, match) \ for (iter = &list->head; iter->next; iter = iter->next) \ - if ((iter->channel == match->channel) && \ - (iter->id == match->id) &&\ + if ((iter->channel == match->channel) && \ + (iter->id == match->id) && \ (iter->lun == match->lun)) /* -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/36] staging: unisys: visornic: remove inline functions
From: Jon Frisch This patch removes inline functions in visornic_main.c. Signed-off-by: Jon Frisch Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/visornic/visornic_main.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 89de87f..ac8ed04 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -409,7 +409,7 @@ alloc_rcv_buf(struct net_device *netdev) * Send the skb to the IO Partition. * Returns void */ -static inline void +static void post_skb(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata, struct sk_buff *skb) { @@ -760,8 +760,8 @@ static unsigned long devdata_xmits_outstanding(struct visornic_devdata *devdata) * Returns true iff the number of unacked xmits sent to * the IO partition is >= high_watermark. */ -static inline bool vnic_hit_high_watermark(struct visornic_devdata *devdata, - ulong high_watermark) +static bool vnic_hit_high_watermark(struct visornic_devdata *devdata, + ulong high_watermark) { return (devdata_xmits_outstanding(devdata) >= high_watermark); } @@ -776,8 +776,8 @@ static inline bool vnic_hit_high_watermark(struct visornic_devdata *devdata, * Returns true iff the number of unacked xmits sent to * the IO partition is <= low_watermark. */ -static inline bool vnic_hit_low_watermark(struct visornic_devdata *devdata, - ulong low_watermark) +static bool vnic_hit_low_watermark(struct visornic_devdata *devdata, + ulong low_watermark) { return (devdata_xmits_outstanding(devdata) <= low_watermark); } @@ -1067,7 +1067,7 @@ visornic_xmit_timeout(struct net_device *netdev) * we are finished with them. * Returns 0 for success, -1 for error. */ -static inline int +static int repost_return(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata, struct sk_buff *skb, struct net_device *netdev) { -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/36] staging: unisys: include: remove macro lengthof
From: Jon Frisch This patch removes the unused macro lengthof. Signed-off-by: Jon Frisch Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/channel.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/unisys/include/channel.h b/drivers/staging/unisys/include/channel.h index 8c6a7ad..e5e3698 100644 --- a/drivers/staging/unisys/include/channel.h +++ b/drivers/staging/unisys/include/channel.h @@ -38,9 +38,6 @@ #define SIGNATURE_64(A, B, C, D, E, F, G, H) \ (SIGNATURE_32(A, B, C, D) | ((u64)(SIGNATURE_32(E, F, G, H)) << 32)) -#ifndef lengthof -#define lengthof(TYPE, MEMBER) (sizeof(((TYPE *)0)->MEMBER)) -#endif #ifndef COVER #define COVER(v, d) ((d) * DIV_ROUND_UP(v, d)) #endif -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/36] staging: unisys: include: iochannel.h: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/include/iochannel.h | 24 +++ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index 0b61fd7..5d8a500 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -50,13 +50,13 @@ #define ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID 2 #define ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID 1 -#define SPAR_VHBA_CHANNEL_OK_CLIENT(ch)\ +#define SPAR_VHBA_CHANNEL_OK_CLIENT(ch) \ (spar_check_channel_client(ch, spar_vhba_channel_protocol_uuid, \ "vhba", MIN_IO_CHANNEL_SIZE, \ ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID, \ ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE)) -#define SPAR_VNIC_CHANNEL_OK_CLIENT(ch)\ +#define SPAR_VNIC_CHANNEL_OK_CLIENT(ch) \ (spar_check_channel_client(ch, spar_vnic_channel_protocol_uuid, \ "vnic", MIN_IO_CHANNEL_SIZE, \ ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID, \ @@ -200,7 +200,7 @@ struct uiscmdrsp_scsi { int linuxstat; /* original Linux status used by Linux vdisk */ u8 scsistat;/* the scsi status */ u8 addlstat;/* non-scsi status */ -#define ADDL_SEL_TIMEOUT 4 +#define ADDL_SEL_TIMEOUT 4 /* The following fields are need to determine the result of command. */ u8 sensebuf[MAX_SENSE_SIZE]; /* sense info in case cmd failed; */ @@ -340,7 +340,7 @@ struct net_pkt_xmtdone { #define RCVPOST_BUF_SIZE 4032 #define MAX_NET_RCV_CHAIN \ ((VISOR_ETH_MAX_MTU + ETH_HLEN + RCVPOST_BUF_SIZE - 1) \ - / RCVPOST_BUF_SIZE) +/ RCVPOST_BUF_SIZE) /* * rcv buf size must be large enough to include ethernet data len + ethernet @@ -441,7 +441,7 @@ struct uiscmdrsp_scsitaskmgmt { /* Result of taskmgmt command - set by IOPart - values are: */ char result; -#define TASK_MGMT_FAILED 0 +#define TASK_MGMT_FAILED 0 } __packed; /* Used by uissd to send disk add/remove notifications to Guest. */ @@ -496,11 +496,11 @@ struct uiscmdrsp { char cmdtype; /* Describes what type of information is in the struct */ -#define CMD_SCSI_TYPE 1 -#define CMD_NET_TYPE 2 -#define CMD_SCSITASKMGMT_TYPE 3 -#define CMD_NOTIFYGUEST_TYPE 4 -#define CMD_VDISKMGMT_TYPE 5 +#define CMD_SCSI_TYPE1 +#define CMD_NET_TYPE 2 +#define CMD_SCSITASKMGMT_TYPE 3 +#define CMD_NOTIFYGUEST_TYPE 4 +#define CMD_VDISKMGMT_TYPE5 union { struct uiscmdrsp_scsi scsi; struct uiscmdrsp_net net; @@ -548,7 +548,7 @@ struct spar_io_channel_protocol { #define SIZEOF_CMDRSP (COVER(sizeof(struct uiscmdrsp), 64)) /* Use 4K page sizes when passing page info between Guest and IOPartition. */ -#define PI_PAGE_SIZE 0x1000 -#define PI_PAGE_MASK 0x0FFF +#define PI_PAGE_SIZE 0x1000 +#define PI_PAGE_MASK 0x0FFF #endif /* __IOCHANNEL_H__ */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/36] staging: unisys: visorbus: vmcallinterface.h: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/vmcallinterface.h | 26 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h b/drivers/staging/unisys/visorbus/vmcallinterface.h index 3ba1ed7..06bd300 100644 --- a/drivers/staging/unisys/visorbus/vmcallinterface.h +++ b/drivers/staging/unisys/visorbus/vmcallinterface.h @@ -59,7 +59,7 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple, #endif /* */ /* define subsystem number for AppOS, used in uislib driver */ -#define MDS_APPOS 0x4000L /* subsystem = 62 - AppOS */ +#define MDS_APPOS 0x4000L /* subsystem = 62 - AppOS */ enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */ /* Note: when a new VMCALL is added: * - the 1st 2 hex digits correspond to one of the @@ -83,14 +83,14 @@ enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */ }; #define VMCALL_SUCCESS 0 -#define VMCALL_SUCCESSFUL(result) (result == 0) +#define VMCALL_SUCCESSFUL(result) (result == 0) #define unisys_vmcall(tuple, reg_ebx, reg_ecx) \ __unisys_vmcall_gnuc(tuple, reg_ebx, reg_ecx) #define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \ __unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx) #define ISSUE_IO_VMCALL(method, param, result) \ - (result = unisys_vmcall(method, (param) & 0x, \ + (result = unisys_vmcall(method, (param) & 0x, \ (param) >> 32)) /* Structures for IO VMCALLs */ @@ -162,16 +162,16 @@ enum event_pc { /* POSTCODE event identifier tuples */ * entered/exited from. */ -#define POSTCODE_LINUX(EVENT_PC, pc16bit1, pc16bit2, severity) \ -do { \ - unsigned long long post_code_temp; \ - post_code_temp = (((u64)CURRENT_FILE_PC) << 56) | \ - (((u64)EVENT_PC) << 44) | \ - u64)__LINE__) & 0xFFF) << 32) | \ - u64)pc16bit1) & 0x) << 16) |\ - (((u64)pc16bit2) & 0x); \ - unisys_extended_vmcall(VMCALL_POST_CODE_LOGEVENT, severity, \ - MDS_APPOS, post_code_temp); \ +#define POSTCODE_LINUX(EVENT_PC, pc16bit1, pc16bit2, severity) \ +do { \ + unsigned long long post_code_temp; \ + post_code_temp = (((u64)CURRENT_FILE_PC) << 56) | \ + (((u64)EVENT_PC) << 44) | \ + u64)__LINE__) & 0xFFF) << 32) | \ + u64)pc16bit1) & 0x) << 16) | \ + (((u64)pc16bit2) & 0x); \ + unisys_extended_vmcall(VMCALL_POST_CODE_LOGEVENT, severity, \ + MDS_APPOS, post_code_temp); \ } while (0) #endif /* __VMCALLINTERFACE_H__ */ -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/36] staging: unisys: include: visorbus.h: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/include/visorbus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 0bb7903..6582939 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -209,7 +209,7 @@ int visorchannel_signalinsert(struct visorchannel *channel, u32 queue, bool visorchannel_signalempty(struct visorchannel *channel, u32 queue); uuid_le visorchannel_get_uuid(struct visorchannel *channel); -#define BUS_ROOT_DEVICEUINT_MAX +#define BUS_ROOT_DEVICE UINT_MAX struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, struct visor_device *from); #endif -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/36] staging: unisys: visorinput: visorinput.c: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorinput/visorinput.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c index 3fc7d9e..cdd3543 100644 --- a/drivers/staging/unisys/visorinput/visorinput.c +++ b/drivers/staging/unisys/visorinput/visorinput.c @@ -33,21 +33,21 @@ #include "ultrainputreport.h" /* Keyboard channel {c73416d0-b0b8-44af-b304-9d2ae99f1b3d} */ -#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID\ - UUID_LE(0xc73416d0, 0xb0b8, 0x44af, \ +#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID \ + UUID_LE(0xc73416d0, 0xb0b8, 0x44af, \ 0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d) #define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d" /* Mouse channel {addf07d4-94a9-46e2-81c3-61abcdbdbd87} */ -#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID \ +#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID \ UUID_LE(0xaddf07d4, 0x94a9, 0x46e2, \ 0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87) #define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR \ "addf07d4-94a9-46e2-81c3-61abcdbdbd87" -#define PIXELS_ACROSS_DEFAULT 800 -#define PIXELS_DOWN_DEFAULT600 -#define KEYCODE_TABLE_BYTES256 +#define PIXELS_ACROSS_DEFAULT 800 +#define PIXELS_DOWN_DEFAULT 600 +#define KEYCODE_TABLE_BYTES 256 enum visorinput_device_type { visorinput_keyboard, -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 30/36] staging: unisys: visorbus: vbuschannel.h: Fix #define formatting
From: David Binder In an effort to create a more uniform coding style within the Unisys s-Par driver set, this patch adjusts the formatting of all #define directives within this source file to match the following template, and thereby eliminate irregular usage of whitespace: Reviewed-by: Tim Sell The amount of whitespace used between the and the is dependent on what is needed to make the surrounding #define directives as uniform as possible. Signed-off-by: David Binder Signed-off-by: David Kershner --- drivers/staging/unisys/visorbus/vbuschannel.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h b/drivers/staging/unisys/visorbus/vbuschannel.h index 408bb3a..447fef2 100644 --- a/drivers/staging/unisys/visorbus/vbuschannel.h +++ b/drivers/staging/unisys/visorbus/vbuschannel.h @@ -28,8 +28,8 @@ /* {193b331b-c58f-11da-95a9-00e08161165f} */ #define SPAR_VBUS_CHANNEL_PROTOCOL_UUID \ - UUID_LE(0x193b331b, 0xc58f, 0x11da, \ - 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) + UUID_LE(0x193b331b, 0xc58f, 0x11da, \ + 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f) static const uuid_le spar_vbus_channel_protocol_uuid = SPAR_VBUS_CHANNEL_PROTOCOL_UUID; @@ -43,13 +43,13 @@ static const uuid_le spar_vbus_channel_protocol_uuid = */ #define SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID 1 -#define SPAR_VBUS_CHANNEL_OK_CLIENT(ch) \ - spar_check_channel_client(ch, \ - spar_vbus_channel_protocol_uuid, \ - "vbus", \ - sizeof(struct spar_vbus_channel_protocol),\ - SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID, \ - SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE) +#define SPAR_VBUS_CHANNEL_OK_CLIENT(ch) \ + spar_check_channel_client(ch, \ + spar_vbus_channel_protocol_uuid, \ + "vbus", \ + sizeof(struct spar_vbus_channel_protocol), \ + SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID, \ + SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE) /* * An array of this struct is present in the channel area for each vbus. -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/36] staging: unisys: visornic: Move function to appropriate location
From: David Binder Move function add_physinfo_entries() to visornic_main.c, which is the only function where it is used. Signed-off-by: David Binder Signed-off-by: David Kershner Reviewed-by: Tim Sell --- drivers/staging/unisys/include/iochannel.h | 37 +-- drivers/staging/unisys/visornic/visornic_main.c | 37 ++- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h index 53fed6d..0b61fd7 100644 --- a/drivers/staging/unisys/include/iochannel.h +++ b/drivers/staging/unisys/include/iochannel.h @@ -551,41 +551,4 @@ struct spar_io_channel_protocol { #define PI_PAGE_SIZE 0x1000 #define PI_PAGE_MASK 0x0FFF -/* Returns next non-zero index on success or 0 on failure (i.e. out of room). */ -static inline u16 -add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, u16 index, -u16 max_pi_arr_entries, struct phys_info pi_arr[]) -{ - u32 len; - u16 i, firstlen; - - firstlen = PI_PAGE_SIZE - inp_off; - if (inp_len <= firstlen) { - /* The input entry spans only one page - add as is. */ - if (index >= max_pi_arr_entries) - return 0; - pi_arr[index].pi_pfn = inp_pfn; - pi_arr[index].pi_off = (u16)inp_off; - pi_arr[index].pi_len = (u16)inp_len; - return index + 1; - } - - /* This entry spans multiple pages. */ - for (len = inp_len, i = 0; len; - len -= pi_arr[index + i].pi_len, i++) { - if (index + i >= max_pi_arr_entries) - return 0; - pi_arr[index + i].pi_pfn = inp_pfn + i; - if (i == 0) { - pi_arr[index].pi_off = inp_off; - pi_arr[index].pi_len = firstlen; - } else { - pi_arr[index + i].pi_off = 0; - pi_arr[index + i].pi_len = - (u16)MINNUM(len, (u32)PI_PAGE_SIZE); - } - } - return index + i; -} - #endif /* __IOCHANNEL_H__ */ diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index b961d7e..89de87f 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -141,6 +141,43 @@ struct visornic_devdata { struct uiscmdrsp cmdrsp[SIZEOF_CMDRSP]; }; +/* Returns next non-zero index on success or 0 on failure (i.e. out of room). */ +static inline u16 +add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, u16 index, +u16 max_pi_arr_entries, struct phys_info pi_arr[]) +{ + u32 len; + u16 i, firstlen; + + firstlen = PI_PAGE_SIZE - inp_off; + if (inp_len <= firstlen) { + /* The input entry spans only one page - add as is. */ + if (index >= max_pi_arr_entries) + return 0; + pi_arr[index].pi_pfn = inp_pfn; + pi_arr[index].pi_off = (u16)inp_off; + pi_arr[index].pi_len = (u16)inp_len; + return index + 1; + } + + /* This entry spans multiple pages. */ + for (len = inp_len, i = 0; len; + len -= pi_arr[index + i].pi_len, i++) { + if (index + i >= max_pi_arr_entries) + return 0; + pi_arr[index + i].pi_pfn = inp_pfn + i; + if (i == 0) { + pi_arr[index].pi_off = inp_off; + pi_arr[index].pi_len = firstlen; + } else { + pi_arr[index + i].pi_off = 0; + pi_arr[index + i].pi_len = + (u16)MINNUM(len, (u32)PI_PAGE_SIZE); + } + } + return index + i; +} + /* * visor_copy_fragsinfo_from_skb( * @skb_in: skbuff that we are pulling the frags from -- git-series 0.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel