Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code order nit in handle_command() #130

Open
wadgaonkarsam opened this issue Apr 27, 2017 · 0 comments
Open

Code order nit in handle_command() #130

wadgaonkarsam opened this issue Apr 27, 2017 · 0 comments
Assignees

Comments

@wadgaonkarsam
Copy link
Collaborator

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?

wadgaonkarsam pushed a commit that referenced this issue Apr 27, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
davidker pushed a commit that referenced this issue Apr 27, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
wadgaonkarsam pushed a commit that referenced this issue Apr 28, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
davidker pushed a commit that referenced this issue May 1, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 1, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 1, 2017
Added an if condition to check if visorchannal_get_physaddr returns
zero before passing the value to handle_command() function in the
controlvm_periodic_work() function in visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 2, 2017
Removed a check for channel_addr in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 3, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 3, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 4, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 5, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 5, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 8, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 9, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 9, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 10, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 10, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 10, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 11, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 11, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 11, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 12, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 15, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 15, 2017
Reorder code to check channel_addr == 0 first in the handle_command
function in visorchipset.c

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 15, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 16, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 17, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
wadgaonkarsam pushed a commit that referenced this issue May 18, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 18, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 18, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
davidker pushed a commit that referenced this issue May 19, 2017
Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

githubissue: #130
Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Kershner <david.kershner@unisys.com>
@wadgaonkarsam wadgaonkarsam self-assigned this Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant