Commit c62bddfb authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: fix strict checks in create_device()

Use the variable name rather than the type, and add a set of missing brackets
to the if statement in create_device().
Signed-off-by: default avatarKen Depro <kenneth.depro@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 20eca8f0
...@@ -361,7 +361,7 @@ create_device(struct controlvm_message *msg, char *buf) ...@@ -361,7 +361,7 @@ create_device(struct controlvm_message *msg, char *buf)
POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo, POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo,
POSTCODE_SEVERITY_INFO); POSTCODE_SEVERITY_INFO);
dev = kzalloc(sizeof(struct device_info), GFP_ATOMIC); dev = kzalloc(sizeof(*dev), GFP_ATOMIC);
if (!dev) { if (!dev) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed: kmalloc for dev failed.\n"); LOGERR("CONTROLVM_DEVICE_CREATE Failed: kmalloc for dev failed.\n");
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
...@@ -377,9 +377,9 @@ create_device(struct controlvm_message *msg, char *buf) ...@@ -377,9 +377,9 @@ create_device(struct controlvm_message *msg, char *buf)
sema_init(&dev->interrupt_callback_lock, 1); /* unlocked */ sema_init(&dev->interrupt_callback_lock, 1); /* unlocked */
sprintf(dev->devid, "vbus%u:dev%u", (unsigned)busNo, (unsigned)devNo); sprintf(dev->devid, "vbus%u:dev%u", (unsigned)busNo, (unsigned)devNo);
/* map the channel memory for the device. */ /* map the channel memory for the device. */
if (msg->hdr.flags.test_message) if (msg->hdr.flags.test_message) {
dev->chanptr = (void __iomem *)__va(dev->channel_addr); dev->chanptr = (void __iomem *)__va(dev->channel_addr);
else { } else {
pReqHandler = req_handler_find(dev->channel_uuid); pReqHandler = req_handler_find(dev->channel_uuid);
if (pReqHandler) if (pReqHandler)
/* generic service handler registered for this /* generic service handler registered for this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment