Commit 44508ba1 authored by Dave Stevenson's avatar Dave Stevenson Committed by Phil Elwell
Browse files

staging: vc-sm-cma: Fix the few remaining coding style issues



Fix a few minor checkpatch complaints to make the driver clean

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.org>
parent 83c19d81
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -325,7 +325,6 @@ static void vc_sm_release_resource(struct vc_sm_buffer *buffer)
				  buffer->cookie, buffer->dma_addr);
	}


	/* Free our buffer. Start by removing it from the list */
	mutex_lock(&sm_state->map_lock);
	list_del(&buffer->global_buffer_list);
@@ -1365,7 +1364,8 @@ static int vc_sm_cma_clean_invalid2(unsigned int cmdnr, unsigned long arg)
	}

	for (i = 0; i < ioparam.op_count; i++) {
		const struct vc_sm_cma_ioctl_clean_invalid_block * const op = block + i;
		const struct vc_sm_cma_ioctl_clean_invalid_block * const op =
								block + i;

		if (op->invalidate_mode == VC_SM_CACHE_OP_NOP)
			continue;
@@ -1637,8 +1637,6 @@ err_remove_misc_dev:
err_remove_debugfs:
	debugfs_remove_recursive(sm_state->dir_root);
	vc_sm_cma_vchi_stop(&sm_state->sm_handle);

	return;
}

/* Driver loading. */
+63 −65
Original line number Diff line number Diff line
@@ -188,7 +188,10 @@ static int vc_sm_cma_vchi_videocore_io(void *arg)
		if (svc_use)
			vchi_service_release(instance->vchi_handle[0]);
		svc_use = 0;
		if (!wait_for_completion_interruptible(&instance->io_cmplt)) {

		if (wait_for_completion_interruptible(&instance->io_cmplt))
			continue;

		vchi_service_use(instance->vchi_handle[0]);
		svc_use = 1;

@@ -202,17 +205,15 @@ static int vc_sm_cma_vchi_videocore_io(void *arg)
				mutex_unlock(&instance->lock);
				break;
			}
				cmd =
				    list_first_entry(&instance->cmd_list,
						     struct sm_cmd_rsp_blk,
						     head);
			cmd = list_first_entry(&instance->cmd_list,
					       struct sm_cmd_rsp_blk, head);
			list_move(&cmd->head, &instance->rsp_list);
			cmd->sent = 1;
			mutex_unlock(&instance->lock);

			/* Send the command */
				status = bcm2835_vchi_msg_queue(
						instance->vchi_handle[0],
			status =
				bcm2835_vchi_msg_queue(instance->vchi_handle[0],
						       cmd->msg, cmd->length);
			if (status) {
				pr_err("%s: failed to queue message (%d)",
@@ -235,18 +236,16 @@ static int vc_sm_cma_vchi_videocore_io(void *arg)

		} while (1);

			while (!vchi_msg_peek(instance->vchi_handle[0],
					      (void **)&reply, &reply_len,
					      VCHI_FLAGS_NONE)) {
		while (!vchi_msg_peek(instance->vchi_handle[0], (void **)&reply,
				      &reply_len, VCHI_FLAGS_NONE)) {
			if (reply->trans_id & 0x80000000) {
				/* Async event or cmd from the VPU */
				if (instance->vpu_event)
						instance->vpu_event(
							instance, reply,
					instance->vpu_event(instance, reply,
							    reply_len);
			} else {
					vc_sm_cma_vchi_rx_ack(instance, cmd,
							      reply, reply_len);
				vc_sm_cma_vchi_rx_ack(instance, cmd, reply,
						      reply_len);
			}

			vchi_msg_remove(instance->vchi_handle[0]);
@@ -254,14 +253,13 @@ static int vc_sm_cma_vchi_videocore_io(void *arg)

		/* Go through the dead list and free them */
		mutex_lock(&instance->lock);
			list_for_each_entry_safe(cmd, cmd_tmp,
						 &instance->dead_list, head) {
		list_for_each_entry_safe(cmd, cmd_tmp, &instance->dead_list,
					 head) {
			list_del(&cmd->head);
			vc_vchi_cmd_delete(instance, cmd);
		}
		mutex_unlock(&instance->lock);
	}
	}

	return 0;
}