davidker / unisys

Master repository for new changes to drivers/staging/unisys and drivers/visorbus
Other
2 stars 1 forks source link

Code order nit in handle_command() #130

Open wadgaonkarsam opened 7 years ago

wadgaonkarsam commented 7 years ago

Kanboard:29385

        */
        parahotplug_request_kickoff(req);
        controlvm_respond_physdev_changestate
            (&inmsg->hdr,
             CONTROLVM_RESP_SUCCESS,
             inmsg->cmd.device_change_state.state);
        parahotplug_request_destroy(req);
    } else {
        /*
         * For disable messages, add the request to the
         * request list before kicking off the udev script. It
         * won't get responded to until the script has
         * indicated it's done.
         */
        spin_lock(¶hotplug_request_list_lock);
        list_add_tail(&req->list, ¶hotplug_request_list);
        spin_unlock(¶hotplug_request_list_lock);

        parahotplug_request_kickoff(req);
    }
}

/**
 * handle_command() - process a controlvm message
 * @inmsg:        the message to process
 * @channel_addr: address of the controlvm channel
 *
 * Return:
 *    false - this function will return false only in the case where the
 *            controlvm message was NOT processed, but processing must be
 *            retried before reading the next controlvm message; a
 *            scenario where this can occur is when we need to throttle
 *            the allocation of memory in which to copy out controlvm
 *            payload data
 *    true  - processing of the controlvm message completed,
 *            either successfully or with an error
 */
static bool
handle_command(struct controlvm_message inmsg, u64 channel_addr)
{
    struct controlvm_message_packet *cmd = &inmsg.cmd;
    u64 parm_addr;
    u32 parm_bytes;
    struct parser_context *parser_ctx = NULL;
    bool local_addr;
    struct controlvm_message ackmsg;

    /* create parsing context if necessary */
    local_addr = (inmsg.hdr.flags.test_message == 1);
    if (channel_addr == 0)
        return true;

Why not check this before setting local_addr?