summaryrefslogtreecommitdiff
path: root/common/host_command.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-07-26 11:12:31 -0700
committerGerrit <chrome-bot@google.com>2012-07-26 16:25:34 -0700
commit247fdaf13d7d317465d6d04b015a309721e599a9 (patch)
tree6eef0fb1a07133135f0529a6e26635b99428b6ea /common/host_command.c
parentd0d50b6da7b826c0aa13391d6794b66e1c0f1303 (diff)
downloadchrome-ec-247fdaf13d7d317465d6d04b015a309721e599a9.tar.gz
Change host command params/response pointers to void *
This removes a bunch of unnecessary typecasts, since you can assign to/from void * without them. This also uncovered a few cases where const was being cast away for the input params; now fixed. BUG=none TEST=mkbp hash from u-boot console, and/or system boots ok Change-Id: Ic314b9d2ca06226ea8a09703ef5c1a912eb7146d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28500
Diffstat (limited to 'common/host_command.c')
-rw-r--r--common/host_command.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/common/host_command.c b/common/host_command.c
index 212152efa1..515962d987 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -82,8 +82,7 @@ static const struct host_command *find_host_command(int command)
static int host_command_proto_version(struct host_cmd_handler_args *args)
{
- struct ec_response_proto_version *r =
- (struct ec_response_proto_version *)args->response;
+ struct ec_response_proto_version *r = args->response;
r->version = EC_PROTO_VERSION;
args->response_size = sizeof(*r);
@@ -96,10 +95,8 @@ DECLARE_HOST_COMMAND(EC_CMD_PROTO_VERSION,
static int host_command_hello(struct host_cmd_handler_args *args)
{
- const struct ec_params_hello *p =
- (const struct ec_params_hello *)args->params;
- struct ec_response_hello *r =
- (struct ec_response_hello *)args->response;
+ const struct ec_params_hello *p = args->params;
+ struct ec_response_hello *r = args->response;
uint32_t d = p->in_data;
r->out_data = d + 0x01020304;
@@ -113,10 +110,8 @@ DECLARE_HOST_COMMAND(EC_CMD_HELLO,
static int host_command_read_test(struct host_cmd_handler_args *args)
{
- const struct ec_params_read_test *p =
- (const struct ec_params_read_test *)args->params;
- struct ec_response_read_test *r =
- (struct ec_response_read_test *)args->response;
+ const struct ec_params_read_test *p = args->params;
+ struct ec_response_read_test *r = args->response;
int offset = p->offset;
int size = p->size / sizeof(uint32_t);
@@ -143,8 +138,7 @@ DECLARE_HOST_COMMAND(EC_CMD_READ_TEST,
*/
static int host_command_read_memmap(struct host_cmd_handler_args *args)
{
- const struct ec_params_read_memmap *p =
- (const struct ec_params_read_memmap *)args->params;
+ const struct ec_params_read_memmap *p = args->params;
/* Copy params out of data before we overwrite it with output */
uint8_t offset = p->offset;
@@ -166,10 +160,8 @@ DECLARE_HOST_COMMAND(EC_CMD_READ_MEMMAP,
static int host_command_get_cmd_versions(struct host_cmd_handler_args *args)
{
- const struct ec_params_get_cmd_versions *p =
- (const struct ec_params_get_cmd_versions *)args->params;
- struct ec_response_get_cmd_versions *r =
- (struct ec_response_get_cmd_versions *)args->response;
+ const struct ec_params_get_cmd_versions *p = args->params;
+ struct ec_response_get_cmd_versions *r = args->response;
const struct host_command *cmd = find_host_command(p->cmd);