From b21b7798f433ea38e4eef9bfc852a183ddb92ddd Mon Sep 17 00:00:00 2001 From: Simon Busch Date: Fri, 21 Sep 2012 17:07:08 +0200 Subject: samsung-ipc: cleanup to match common code style --- samsung-ipc/ipc.c | 2 -- samsung-ipc/ipc_devices.h | 15 +++++---------- samsung-ipc/ipc_util.c | 39 +++++++++++++++++++++------------------ samsung-ipc/net.c | 2 +- samsung-ipc/sms.c | 2 +- samsung-ipc/wakelock.c | 46 ++++++++++++++++++++++------------------------ 6 files changed, 50 insertions(+), 56 deletions(-) (limited to 'samsung-ipc') diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 391b479..d6b4b92 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -427,7 +427,6 @@ int _ipc_client_send(struct ipc_client *client, struct ipc_message_info *request return client->ops->send(client, request); } -/* Convenience functions for ipc_send */ inline void ipc_client_send_get(struct ipc_client *client, const unsigned short command, unsigned char mseq) { ipc_client_send(client, command, IPC_TYPE_GET, 0, 0, mseq); @@ -438,7 +437,6 @@ inline void ipc_client_send_exec(struct ipc_client *client, const unsigned short ipc_client_send(client, command, IPC_TYPE_EXEC, 0, 0, mseq); } -/* Wrapper for ipc_send */ void ipc_client_send(struct ipc_client *client, const unsigned short command, const char type, unsigned char *data, const int length, unsigned char mseq) { struct ipc_message_info request; diff --git a/samsung-ipc/ipc_devices.h b/samsung-ipc/ipc_devices.h index 715121c..2e028e2 100644 --- a/samsung-ipc/ipc_devices.h +++ b/samsung-ipc/ipc_devices.h @@ -37,36 +37,31 @@ struct ipc_device_desc { extern struct ipc_device_desc ipc_devices[]; extern int ipc_devices_count; -// h1 - +/* h1 */ extern struct ipc_ops h1_fmt_ops; extern struct ipc_ops h1_rfs_ops; extern struct ipc_handlers h1_default_handlers; -// crespo - +/* crespo */ extern struct ipc_ops crespo_fmt_ops; extern struct ipc_ops crespo_rfs_ops; extern struct ipc_handlers crespo_default_handlers; extern struct ipc_gprs_specs crespo_gprs_specs; -// aries - +/* aries */ extern struct ipc_ops aries_fmt_ops; extern struct ipc_ops aries_rfs_ops; extern struct ipc_handlers aries_default_handlers; extern struct ipc_gprs_specs aries_gprs_specs; -// galaxys2 - +/* galaxys2 */ extern struct ipc_ops galaxys2_fmt_ops; extern struct ipc_ops galaxys2_fmt_ops; extern struct ipc_ops galaxys2_rfs_ops; extern struct ipc_handlers galaxys2_default_handlers; extern struct ipc_gprs_specs galaxys2_gprs_specs; -// maguro - +/* maguro */ extern struct ipc_ops maguro_fmt_ops; extern struct ipc_ops maguro_rfs_ops; extern struct ipc_handlers maguro_default_handlers; diff --git a/samsung-ipc/ipc_util.c b/samsung-ipc/ipc_util.c index 181a9a1..63c0c6e 100644 --- a/samsung-ipc/ipc_util.c +++ b/samsung-ipc/ipc_util.c @@ -32,7 +32,7 @@ #include #include "ipc_private.h" -#define IPC_STR(f) case f: return strdup(#f); +#define IPC_STR(f) case f: return strdup(#f); void ipc_client_log_recv(struct ipc_client *client, struct ipc_message_info *response, const char *prefix) @@ -100,20 +100,22 @@ void ipc_client_log_send(struct ipc_client *client, } } -const char *ipc_response_type_to_str(int type) { - switch(type) { - case IPC_TYPE_INDI: - return "INDI"; - case IPC_TYPE_RESP: - return "RESP"; - case IPC_TYPE_NOTI: - return "NOTI"; - default: - return "UNKNOWN"; - } +const char *ipc_response_type_to_str(int type) +{ + switch(type) { + case IPC_TYPE_INDI: + return "INDI"; + case IPC_TYPE_RESP: + return "RESP"; + case IPC_TYPE_NOTI: + return "NOTI"; + default: + return "UNKNOWN"; + } } -const char *ipc_request_type_to_str(int type) { +const char *ipc_request_type_to_str(int type) +{ switch(type) { case IPC_TYPE_EXEC: return "EXEC"; @@ -125,13 +127,14 @@ const char *ipc_request_type_to_str(int type) { return "CFRM"; case IPC_TYPE_EVENT: return "EVENT"; - default: - return "UNKNOWN"; + default: + return "UNKNOWN"; } } -const char *ipc_command_to_str(int command) { - switch(command) { +const char *ipc_command_to_str(int command) +{ + switch(command) { IPC_STR(IPC_CALL_OUTGOING) IPC_STR(IPC_CALL_INCOMING) IPC_STR(IPC_CALL_RELEASE) @@ -250,7 +253,7 @@ const char *ipc_command_to_str(int command) { IPC_STR(IPC_IMEI_CHECK_DEVICE_INFO) default: return "IPC_UNKNOWN"; - } + } } void ipc_client_hex_dump(struct ipc_client *client, void *data, int size) diff --git a/samsung-ipc/net.c b/samsung-ipc/net.c index 4fde726..9e4dfb5 100644 --- a/samsung-ipc/net.c +++ b/samsung-ipc/net.c @@ -23,7 +23,7 @@ void ipc_net_regist_get_setup(struct ipc_net_regist_get *message, unsigned char domain) { - //FIXME: could that be IPC_NET_ACCESS_TECHNOLOGY_... (act) ? + /* FIXME: could that be IPC_NET_ACCESS_TECHNOLOGY_... (act) ? */ message->net = 0xff; message->domain = domain; } diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c index 713b85c..58eba72 100644 --- a/samsung-ipc/sms.c +++ b/samsung-ipc/sms.c @@ -46,4 +46,4 @@ unsigned char* ipc_sms_send_msg_pack(struct ipc_sms_send_msg *msg, char *smsc, return data; } - +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/wakelock.c b/samsung-ipc/wakelock.c index 8cc8e30..227208b 100644 --- a/samsung-ipc/wakelock.c +++ b/samsung-ipc/wakelock.c @@ -26,36 +26,34 @@ static int wake_lock_fd = -1; static int wake_unlock_fd = -1; -int wake_lock(char *lock_name) { - int rc; - assert(lock_name != NULL); - - if (wake_lock_fd < 0) { - wake_lock_fd = open("/sys/power/wake_lock", O_RDWR); - } +int wake_lock(char *lock_name) +{ + int rc; + assert(lock_name != NULL); - if (wake_lock_fd < 0) { - return wake_lock_fd; - } + if (wake_lock_fd < 0) + wake_lock_fd = open("/sys/power/wake_lock", O_RDWR); - rc = write(wake_lock_fd, lock_name, strlen(lock_name)); + if (wake_lock_fd < 0) + return wake_lock_fd; - return rc; + rc = write(wake_lock_fd, lock_name, strlen(lock_name)); + + return rc; } -int wake_unlock(char *lock_name) { - int rc; - assert(lock_name != NULL); - - if (wake_unlock_fd < 0) { - wake_unlock_fd = open("/sys/power/wake_unlock", O_RDWR); - } +int wake_unlock(char *lock_name) +{ + int rc; + assert(lock_name != NULL); + + if (wake_unlock_fd < 0) + wake_unlock_fd = open("/sys/power/wake_unlock", O_RDWR); - if (wake_unlock_fd < 0) { - return wake_lock_fd; - } + if (wake_unlock_fd < 0) + return wake_lock_fd; - rc = write(wake_unlock_fd, lock_name, strlen(lock_name)); + rc = write(wake_unlock_fd, lock_name, strlen(lock_name)); - return rc; + return rc; } -- cgit v1.2.3