diff options
author | Simon Busch <morphis@gravedo.de> | 2012-08-08 16:56:05 +0200 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2012-08-08 16:56:05 +0200 |
commit | 1628980f6a5aca6ed427cc7d56cb0d5b318a9c4e (patch) | |
tree | ae103a6fa545c780112829f681ab793173ebfbfe /samsung-ipc | |
parent | b44ee66d247cfa523469ebd144a07b79762702ca (diff) | |
download | external_libsamsung-ipc-1628980f6a5aca6ed427cc7d56cb0d5b318a9c4e.zip external_libsamsung-ipc-1628980f6a5aca6ed427cc7d56cb0d5b318a9c4e.tar.gz external_libsamsung-ipc-1628980f6a5aca6ed427cc7d56cb0d5b318a9c4e.tar.bz2 |
First round of fixing unnecessary warnings
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/ipc_util.c | 10 | ||||
-rw-r--r-- | samsung-ipc/rfs.c | 12 |
2 files changed, 13 insertions, 9 deletions
diff --git a/samsung-ipc/ipc_util.c b/samsung-ipc/ipc_util.c index e4740bf..7f6973e 100644 --- a/samsung-ipc/ipc_util.c +++ b/samsung-ipc/ipc_util.c @@ -35,7 +35,7 @@ #define IPC_STR(f) case f: return strdup(#f); void ipc_client_log_recv(struct ipc_client *client, - struct ipc_message_info *response, char *prefix) + struct ipc_message_info *response, const char *prefix) { switch (client->type) { case IPC_CLIENT_TYPE_FMT: @@ -68,7 +68,7 @@ void ipc_client_log_recv(struct ipc_client *client, } void ipc_client_log_send(struct ipc_client *client, - struct ipc_message_info *request, char *prefix) + struct ipc_message_info *request, const char *prefix) { switch (client->type) { case IPC_CLIENT_TYPE_FMT: @@ -271,8 +271,10 @@ void ipc_client_hex_dump(struct ipc_client *client, void *data, int size) for (n=1;n<=size;n++) { if (n%16 == 1) { /* store address for this line */ - snprintf(addrstr, sizeof(addrstr), "%.4x", - ((unsigned int)p-(unsigned int)data) ); + unsigned int end = 0, start = 0; + end = *((unsigned int*) p); + start = *((unsigned int*) data); + snprintf(addrstr, sizeof(addrstr), "%.4x", end - start); } c = *p; diff --git a/samsung-ipc/rfs.c b/samsung-ipc/rfs.c index edf2fb3..a416999 100644 --- a/samsung-ipc/rfs.c +++ b/samsung-ipc/rfs.c @@ -113,7 +113,7 @@ int nv_data_size(struct ipc_client *client) { if (client == NULL || client->nv_data_specs == NULL || - client->nv_data_specs->nv_data_size == NULL) + client->nv_data_specs->nv_data_size == 0) return NV_DATA_SIZE_DEFAULT; return client->nv_data_specs->nv_data_size; @@ -123,7 +123,7 @@ int nv_data_chunk_size(struct ipc_client *client) { if (client == NULL || client->nv_data_specs == NULL || - client->nv_data_specs->nv_data_chunk_size == NULL) + client->nv_data_specs->nv_data_chunk_size == 0) return NV_DATA_CHUNK_SIZE_DEFAULT; return client->nv_data_specs->nv_data_chunk_size; @@ -714,7 +714,7 @@ void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, struct if (rfs_io == NULL) { ipc_client_log(client, "ERROR: Request message is invalid: aseq = %i", info->aseq); - return NULL; + return; } rfs_io_conf = malloc(rfs_io->length + sizeof(struct ipc_rfs_io_confirm)); @@ -734,7 +734,8 @@ void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, struct rfs_io_conf->offset = rfs_io->offset; rfs_io_conf->length = rfs_io->length; - ipc_client_send(client, IPC_RFS_NV_READ_ITEM, 0, rfs_io_conf, rfs_io->length + sizeof(struct ipc_rfs_io_confirm), info->aseq); + ipc_client_send(client, IPC_RFS_NV_READ_ITEM, 0, (unsigned char*) rfs_io_conf, + rfs_io->length + sizeof(struct ipc_rfs_io_confirm), info->aseq); free(rfs_io_conf); } @@ -767,7 +768,8 @@ void ipc_rfs_send_io_confirm_for_nv_write_item(struct ipc_client *client, struct rfs_io_conf->offset = rfs_io->offset; rfs_io_conf->length = rfs_io->length; - ipc_client_send(client, IPC_RFS_NV_WRITE_ITEM, 0, rfs_io_conf, sizeof(struct ipc_rfs_io_confirm), info->aseq); + ipc_client_send(client, IPC_RFS_NV_WRITE_ITEM, 0, (unsigned char*) rfs_io_conf, + sizeof(struct ipc_rfs_io_confirm), info->aseq); free(rfs_io_conf); } |