aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/ipc.c
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2012-01-26 20:18:50 +0100
committerPaulK <contact@paulk.fr>2012-01-28 11:44:58 +0100
commitdb817efb93fd1818871d3daf454ab329677b11bd (patch)
tree9e5722a0f4902f5e4e135c7b5229a4c75bd1d3a3 /samsung-ipc/ipc.c
parenta29b8e0b7622099fbe78ee9a2e34e8200760f793 (diff)
downloadexternal_libsamsung-ipc-db817efb93fd1818871d3daf454ab329677b11bd.zip
external_libsamsung-ipc-db817efb93fd1818871d3daf454ab329677b11bd.tar.gz
external_libsamsung-ipc-db817efb93fd1818871d3daf454ab329677b11bd.tar.bz2
Cosmetics on ipc.c
Diffstat (limited to 'samsung-ipc/ipc.c')
-rw-r--r--samsung-ipc/ipc.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index 29c8f63..f7fbb6d 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -101,9 +101,8 @@ int ipc_client_set_log_handler(struct ipc_client *client, ipc_client_log_handler
int ipc_client_set_handlers(struct ipc_client *client, struct ipc_handlers *handlers)
{
- if(client == NULL)
- return -1;
- if(handlers == NULL)
+ if(client == NULL ||
+ handlers == NULL)
return -1;
memcpy(client->handlers, handlers, sizeof(struct ipc_handlers));
@@ -115,9 +114,8 @@ int ipc_client_set_io_handlers(struct ipc_client *client,
ipc_io_handler_cb read, void *read_data,
ipc_io_handler_cb write, void *write_data)
{
- if(client == NULL)
- return -1;
- if(client->handlers == NULL)
+ if(client == NULL ||
+ client->handlers == NULL)
return -1;
if(read != NULL)
@@ -136,11 +134,9 @@ int ipc_client_set_handlers_common_data(struct ipc_client *client, void *data)
{
void *common_data;
- if(client == NULL)
- return -1;
- if(client->handlers == NULL)
- return -1;
- if(data == NULL)
+ if(client == NULL ||
+ client->handlers == NULL ||
+ data == NULL)
return -1;
common_data = data;
@@ -158,23 +154,19 @@ int ipc_client_set_handlers_common_data(struct ipc_client *client, void *data)
void *ipc_client_get_handlers_common_data(struct ipc_client *client)
{
- if(client == NULL)
+ if(client == NULL ||
+ client->handlers == NULL)
return NULL;
- if(client->handlers == NULL)
- return -1;
return client->handlers->common_data;
-
- return 0;
}
int ipc_client_create_handlers_common_data(struct ipc_client *client)
{
void *common_data;
- if(client == NULL)
- return -1;
- if(client->handlers == NULL)
+ if(client == NULL ||
+ client->handlers == NULL)
return -1;
common_data = client->handlers->common_data_create();
@@ -195,9 +187,9 @@ int ipc_client_destroy_handlers_common_data(struct ipc_client *client)
void *common_data;
int rc;
- if(client == NULL)
- return -1;
- if(client->handlers == NULL)
+ if(client == NULL ||
+ client->handlers == NULL ||
+ client->handlers->common_data_destroy == NULL)
return -1;
rc = client->handlers->common_data_destroy(client->handlers->common_data);
@@ -220,9 +212,9 @@ int ipc_client_destroy_handlers_common_data(struct ipc_client *client)
int ipc_client_set_handlers_common_data_fd(struct ipc_client *client, int fd)
{
- if(client == NULL)
- return -1;
- if(client->handlers == NULL)
+ if(client == NULL ||
+ client->handlers == NULL ||
+ client->handlers->common_data_set_fd == NULL)
return -1;
return client->handlers->common_data_set_fd(client->handlers->common_data, fd);
@@ -230,9 +222,9 @@ int ipc_client_set_handlers_common_data_fd(struct ipc_client *client, int fd)
int ipc_client_get_handlers_common_data_fd(struct ipc_client *client)
{
- if(client == NULL)
- return -1;
- if(client->handlers == NULL)
+ if(client == NULL ||
+ client->handlers == NULL ||
+ client->handlers->common_data_get_fd == NULL)
return -1;
return client->handlers->common_data_get_fd(client->handlers->common_data);