From: Erik Arfvidson <erik.arfvidson@xxxxxxxxx> In the function handle_command, the variable local_addr is always false. So this patch is getting rid of logic when it is true. Signed-off-by: Erik Arfvidson <erik.arfvidson@xxxxxxxxx> Signed-off-by: David Kershner <david.kershner@xxxxxxxxxx> Reviewed-by: David Binder <david.binder@xxxxxxxxxx> --- drivers/staging/unisys/visorbus/visorchipset.c | 43 +++++-------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index ebae5bd..6d77160 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1510,10 +1510,11 @@ visorbus_device_resume_response(struct visor_device *dev_info, int response) } static struct parser_context * -parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry) +parser_init_byte_stream(u64 addr, u32 bytes, bool *retry) { int allocbytes = sizeof(struct parser_context) + bytes; struct parser_context *ctx; + void *mapping; *retry = false; @@ -1538,22 +1539,11 @@ parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry) ctx->curr = NULL; ctx->bytes_remaining = 0; ctx->byte_stream = false; - if (local) { - void *p; - - if (addr > virt_to_phys(high_memory - 1)) - goto err_finish_ctx; - p = __va((unsigned long)(addr)); - memcpy(ctx->data, p, bytes); - } else { - void *mapping = memremap(addr, bytes, MEMREMAP_WB); - - if (!mapping) - goto err_finish_ctx; - memcpy(ctx->data, mapping, bytes); - memunmap(mapping); - } - + mapping = memremap(addr, bytes, MEMREMAP_WB); + if (!mapping) + goto err_finish_ctx; + memcpy(ctx->data, mapping, bytes); + memunmap(mapping); ctx->byte_stream = true; chipset_dev->controlvm_payload_bytes_buffered += ctx->param_bytes; @@ -1584,12 +1574,10 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr) u64 parm_addr; u32 parm_bytes; struct parser_context *parser_ctx = NULL; - bool local_addr; struct controlvm_message ackmsg; int err = 0; /* create parsing context if necessary */ - local_addr = (inmsg.hdr.flags.test_message == 1); parm_addr = channel_addr + inmsg.hdr.payload_vm_offset; parm_bytes = inmsg.hdr.payload_bytes; @@ -1602,21 +1590,16 @@ handle_command(struct controlvm_message inmsg, u64 channel_addr) bool retry = false; parser_ctx = - parser_init_byte_stream(parm_addr, parm_bytes, - local_addr, &retry); + parser_init_byte_stream(parm_addr, parm_bytes, &retry); if (!parser_ctx && retry) return -EAGAIN; } + controlvm_init_response(&ackmsg, &inmsg.hdr, CONTROLVM_RESP_SUCCESS); + err = visorchannel_signalinsert(chipset_dev->controlvm_channel, + CONTROLVM_QUEUE_ACK, &ackmsg); + if (err) + return err; - if (!local_addr) { - controlvm_init_response(&ackmsg, &inmsg.hdr, - CONTROLVM_RESP_SUCCESS); - err = visorchannel_signalinsert(chipset_dev->controlvm_channel, - CONTROLVM_QUEUE_ACK, - &ackmsg); - if (err) - return err; - } switch (inmsg.hdr.id) { case CONTROLVM_CHIPSET_INIT: err = chipset_init(&inmsg); -- git-series 0.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel