Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cc08121 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab
Browse files

[media] staging: as102: Fix CodingStyle errors in file as10x_cmd.c



Fix Linux kernel coding style (whitespace and indentation) errors
in file as10x_cmd.c. No functional changes.

Signed-off-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarPiotr Chmura <chmooreck@poczta.onet.pl>
Signed-off-by: default avatarSylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e54d081d
Loading
Loading
Loading
Loading
+288 −285
Original line number Diff line number Diff line
/*
 * Abilis Systems Single DVB-T Receiver
 * Copyright (C) 2008 Pierrick Hascoet <pierrick.hascoet@abilis.com>
 * Copyright (C) 2010 Devin Heitmueller <dheitmueller@kernellabs.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@
#include <linux/kernel.h>
#include "as102_drv.h"
#elif defined(WIN32)
   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)  /* win32 ddk implementation */
   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
      /* win32 ddk implementation */
      #include "wdm.h"
      #include "Device.h"
      #include "endian_mgmt.h" /* FIXME */
@@ -60,34 +62,33 @@ int as10x_cmd_turn_on(as10x_handle_t *phandle)
	prsp = phandle->rsp;

	/* prepare command */
   as10x_cmd_build(pcmd,(++phandle->cmd_xid), sizeof(pcmd->body.turn_on.req));
	as10x_cmd_build(pcmd, (++phandle->cmd_xid),
			sizeof(pcmd->body.turn_on.req));

	/* fill command */
	pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);

	/* send command */
	if (phandle->ops->xfer_cmd) {
      error = phandle->ops->xfer_cmd(
			phandle,
			(uint8_t *) pcmd,
			sizeof(pcmd->body.turn_on.req) + HEADER_SIZE,
		error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
					       sizeof(pcmd->body.turn_on.req) +
					       HEADER_SIZE,
					       (uint8_t *) prsp,
			sizeof(prsp->body.turn_on.rsp) + HEADER_SIZE);
   }
   else{
					       sizeof(prsp->body.turn_on.rsp) +
					       HEADER_SIZE);
	} else {
		error = AS10X_CMD_ERROR;
	}

   if(error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);

out:
	LEAVE();
   return(error);
	return error;
}

/**
@@ -107,7 +108,8 @@ int as10x_cmd_turn_off(as10x_handle_t *phandle)
	prsp = phandle->rsp;

	/* prepare command */
   as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.turn_off.req));
	as10x_cmd_build(pcmd, (++phandle->cmd_xid),
			sizeof(pcmd->body.turn_off.req));

	/* fill command */
	pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
@@ -119,21 +121,19 @@ int as10x_cmd_turn_off(as10x_handle_t *phandle)
			sizeof(pcmd->body.turn_off.req) + HEADER_SIZE,
			(uint8_t *) prsp,
			sizeof(prsp->body.turn_off.rsp) + HEADER_SIZE);
   }
   else{
	} else {
		error = AS10X_CMD_ERROR;
	}

   if(error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNOFF_RSP);

out:
	LEAVE();
   return(error);
	return error;
}

/**
@@ -154,7 +154,8 @@ int as10x_cmd_set_tune(as10x_handle_t *phandle, struct as10x_tune_args *ptune)
	prsp = phandle->rsp;

	/* prepare command */
   as10x_cmd_build(preq,(++phandle->cmd_xid),sizeof(preq->body.set_tune.req));
	as10x_cmd_build(preq, (++phandle->cmd_xid),
			sizeof(preq->body.set_tune.req));

	/* fill command */
	preq->body.set_tune.req.proc_id = cpu_to_le16(CONTROL_PROC_SETTUNE);
@@ -163,32 +164,35 @@ int as10x_cmd_set_tune(as10x_handle_t *phandle, struct as10x_tune_args *ptune)
	preq->body.set_tune.req.args.hier_select = ptune->hier_select;
	preq->body.set_tune.req.args.constellation = ptune->constellation;
	preq->body.set_tune.req.args.hierarchy = ptune->hierarchy;
   preq->body.set_tune.req.args.interleaving_mode  = ptune->interleaving_mode;
	preq->body.set_tune.req.args.interleaving_mode  =
		ptune->interleaving_mode;
	preq->body.set_tune.req.args.code_rate  = ptune->code_rate;
	preq->body.set_tune.req.args.guard_interval = ptune->guard_interval;
   preq->body.set_tune.req.args.transmission_mode  = ptune->transmission_mode;
	preq->body.set_tune.req.args.transmission_mode  =
		ptune->transmission_mode;

	/* send command */
	if (phandle->ops->xfer_cmd) {
		error = phandle->ops->xfer_cmd(phandle,
					       (uint8_t *) preq,
			sizeof(preq->body.set_tune.req) + HEADER_SIZE,
					       sizeof(preq->body.set_tune.req)
					       + HEADER_SIZE,
					       (uint8_t *) prsp,
			sizeof(prsp->body.set_tune.rsp) + HEADER_SIZE);
					       sizeof(prsp->body.set_tune.rsp)
					       + HEADER_SIZE);
	} else {
		error = AS10X_CMD_ERROR;
	}

   if(error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_SETTUNE_RSP);

out:
	LEAVE();
   return(error);
	return error;
}

/**
@@ -198,7 +202,8 @@ int as10x_cmd_set_tune(as10x_handle_t *phandle, struct as10x_tune_args *ptune)
   \return 0 when no error, < 0 in case of error.
   \callgraph
 */
int as10x_cmd_get_tune_status(as10x_handle_t *phandle, struct as10x_tune_status *pstatus)
int as10x_cmd_get_tune_status(as10x_handle_t *phandle,
			      struct as10x_tune_status *pstatus)
{
	int error;
	struct as10x_cmd_t  *preq, *prsp;
@@ -224,20 +229,17 @@ int as10x_cmd_get_tune_status(as10x_handle_t *phandle, struct as10x_tune_status
			sizeof(preq->body.get_tune_status.req) + HEADER_SIZE,
			(uint8_t *) prsp,
			sizeof(prsp->body.get_tune_status.rsp) + HEADER_SIZE);
   }
   else{
	} else {
		error = AS10X_CMD_ERROR;
	}

   if (error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_GETTUNESTAT_RSP);
   if (error < 0) {
	if (error < 0)
		goto out;
   }

	/* Response OK -> get response data */
	pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state;
@@ -248,7 +250,7 @@ int as10x_cmd_get_tune_status(as10x_handle_t *phandle, struct as10x_tune_status

out:
	LEAVE();
   return(error);
	return error;
}

/**
@@ -260,7 +262,6 @@ int as10x_cmd_get_tune_status(as10x_handle_t *phandle, struct as10x_tune_status
 */
int as10x_cmd_get_tps(as10x_handle_t *phandle, struct as10x_tps *ptps)
{

	int error;
	struct as10x_cmd_t *pcmd, *prsp;

@@ -270,30 +271,33 @@ int as10x_cmd_get_tps(as10x_handle_t *phandle, struct as10x_tps *ptps)
	prsp = phandle->rsp;

	/* prepare command */
   as10x_cmd_build(pcmd, (++phandle->cmd_xid),sizeof(pcmd->body.get_tps.req));
	as10x_cmd_build(pcmd, (++phandle->cmd_xid),
			sizeof(pcmd->body.get_tps.req));

	/* fill command */
   pcmd->body.get_tune_status.req.proc_id = cpu_to_le16(CONTROL_PROC_GETTPS);
	pcmd->body.get_tune_status.req.proc_id =
		cpu_to_le16(CONTROL_PROC_GETTPS);

	/* send command */
	if (phandle->ops->xfer_cmd) {
		error = phandle->ops->xfer_cmd(phandle,
	       (uint8_t *) pcmd, sizeof(pcmd->body.get_tps.req) + HEADER_SIZE,
	       (uint8_t *) prsp, sizeof(prsp->body.get_tps.rsp) + HEADER_SIZE);
   }
   else{
					       (uint8_t *) pcmd,
					       sizeof(pcmd->body.get_tps.req) +
					       HEADER_SIZE,
					       (uint8_t *) prsp,
					       sizeof(prsp->body.get_tps.rsp) +
					       HEADER_SIZE);
	} else {
		error = AS10X_CMD_ERROR;
	}

   if(error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_GETTPS_RSP);
   if (error < 0) {
	if (error < 0)
		goto out;
   }

	/* Response OK -> get response data */
	ptps->constellation = prsp->body.get_tps.rsp.tps.constellation;
@@ -309,7 +313,7 @@ int as10x_cmd_get_tps(as10x_handle_t *phandle, struct as10x_tps *ptps)

out:
	LEAVE();
   return(error);
	return error;
}

/**
@@ -342,23 +346,22 @@ int as10x_cmd_get_demod_stats(as10x_handle_t *phandle,
	if (phandle->ops->xfer_cmd) {
		error = phandle->ops->xfer_cmd(phandle,
				(uint8_t *) pcmd,
			 sizeof(pcmd->body.get_demod_stats.req) + HEADER_SIZE,
				sizeof(pcmd->body.get_demod_stats.req)
				+ HEADER_SIZE,
				(uint8_t *) prsp,
			 sizeof(prsp->body.get_demod_stats.rsp) + HEADER_SIZE);
   }
   else{
				sizeof(prsp->body.get_demod_stats.rsp)
				+ HEADER_SIZE);
	} else {
		error = AS10X_CMD_ERROR;
	}

   if(error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_GET_DEMOD_STATS_RSP);
   if (error < 0) {
	if (error < 0)
		goto out;
   }

	/* Response OK -> get response data */
	pdemod_stats->frame_count =
@@ -374,7 +377,7 @@ int as10x_cmd_get_demod_stats(as10x_handle_t *phandle,

out:
	LEAVE();
   return(error);
	return error;
}

/**
@@ -408,30 +411,29 @@ int as10x_cmd_get_impulse_resp(as10x_handle_t *phandle,
	if (phandle->ops->xfer_cmd) {
		error = phandle->ops->xfer_cmd(phandle,
					(uint8_t *) pcmd,
			 sizeof(pcmd->body.get_impulse_rsp.req) + HEADER_SIZE,
					sizeof(pcmd->body.get_impulse_rsp.req)
					+ HEADER_SIZE,
					(uint8_t *) prsp,
			 sizeof(prsp->body.get_impulse_rsp.rsp) + HEADER_SIZE);
   }
   else{
					sizeof(prsp->body.get_impulse_rsp.rsp)
					+ HEADER_SIZE);
	} else {
		error = AS10X_CMD_ERROR;
	}

   if(error < 0) {
	if (error < 0)
		goto out;
   }

	/* parse response */
	error = as10x_rsp_parse(prsp, CONTROL_PROC_GET_IMPULSE_RESP_RSP);
   if (error < 0) {
	if (error < 0)
		goto out;
   }

	/* Response OK -> get response data */
	*is_ready = prsp->body.get_impulse_rsp.rsp.is_ready;

out:
	LEAVE();
   return(error);
	return error;
}


@@ -468,7 +470,8 @@ int as10x_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id)
	/* extract command error code */
	error = prsp->body.common.rsp.error;

   if((error == 0) && (le16_to_cpu(prsp->body.common.rsp.proc_id) == proc_id)) {
	if ((error == 0) &&
	    (le16_to_cpu(prsp->body.common.rsp.proc_id) == proc_id)) {
		return 0;
	}