aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-04-04 19:11:17 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-04-05 17:40:55 +0200
commitd097c782e9063470c67346d8b9d324553c74b996 (patch)
tree674ff871125ce043ce11c073fd712507574619fc
parentf24cb0877c73d5e01f085face317aecbf1fe028a (diff)
downloadhardware_replicant_libsamsung-ipc-d097c782e9063470c67346d8b9d324553c74b996.tar.gz
hardware_replicant_libsamsung-ipc-d097c782e9063470c67346d8b9d324553c74b996.tar.bz2
hardware_replicant_libsamsung-ipc-d097c782e9063470c67346d8b9d324553c74b996.zip
samsung-ipc: svc: switch to Linux code style
This contains no functional changes. The commented out code if any has also been preserved as it could be relevant to the understanding of the code. It will be kept until we understand why the code has been commented. In that case we either need to remove it completely or to replace it by a comment explaining why not having that code was necessary. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--samsung-ipc/svc.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/samsung-ipc/svc.c b/samsung-ipc/svc.c
index f2fdc89..294c2c5 100644
--- a/samsung-ipc/svc.c
+++ b/samsung-ipc/svc.c
@@ -23,61 +23,61 @@
#include <samsung-ipc.h>
int ipc_svc_enter_setup(struct ipc_svc_enter_data *data,
- unsigned char mode, unsigned char type)
+ unsigned char mode, unsigned char type)
{
- if (data == NULL)
- return -1;
+ if (data == NULL)
+ return -1;
- memset(data, 0, sizeof(struct ipc_svc_enter_data));
- data->mode = mode;
- data->type = type;
+ memset(data, 0, sizeof(struct ipc_svc_enter_data));
+ data->mode = mode;
+ data->type = type;
- if (mode == IPC_SVC_MODE_MONITOR)
- data->magic = 0x00;
- else
- data->magic = 0x10;
+ if (mode == IPC_SVC_MODE_MONITOR)
+ data->magic = 0x00;
+ else
+ data->magic = 0x10;
- return 0;
+ return 0;
}
-unsigned char ipc_svc_display_screen_count_extract(const void *data, size_t size)
+unsigned char ipc_svc_display_screen_count_extract(const void *data,
+ size_t size)
{
- struct ipc_svc_display_screen_header *header;
+ struct ipc_svc_display_screen_header *header;
- if (data == NULL || size < sizeof(struct ipc_svc_display_screen_header))
- return 0;
+ if (data == NULL || size < sizeof(struct ipc_svc_display_screen_header))
+ return 0;
- header = (struct ipc_svc_display_screen_header *) data;
+ header = (struct ipc_svc_display_screen_header *) data;
- return header->count;
+ return header->count;
}
-struct ipc_svc_display_screen_entry *ipc_svc_display_screen_extract(const void *data,
- size_t size, unsigned int index)
+struct ipc_svc_display_screen_entry *ipc_svc_display_screen_extract(
+ const void *data, size_t size, unsigned int index)
{
- struct ipc_svc_display_screen_entry *entry = NULL;
- unsigned char count;
- unsigned char i;
- unsigned int offset;
+ struct ipc_svc_display_screen_entry *entry = NULL;
+ unsigned char count;
+ unsigned char i;
+ unsigned int offset;
- if (data == NULL)
- return NULL;
+ if (data == NULL)
+ return NULL;
- count = ipc_svc_display_screen_count_extract(data, size);
- if (count == 0 || index >= count)
- return NULL;
+ count = ipc_svc_display_screen_count_extract(data, size);
+ if (count == 0 || index >= count)
+ return NULL;
- offset = sizeof(struct ipc_svc_display_screen_header);
+ offset = sizeof(struct ipc_svc_display_screen_header);
- for (i = 0; i < (index + 1); i++) {
- entry = (struct ipc_svc_display_screen_entry *) ((unsigned char *) data + offset);
- offset += sizeof(struct ipc_svc_display_screen_entry);
- }
+ for (i = 0; i < (index + 1); i++) {
+ entry = (struct ipc_svc_display_screen_entry *) (
+ (unsigned char *) data + offset);
+ offset += sizeof(struct ipc_svc_display_screen_entry);
+ }
- if (offset > size)
- return NULL;
+ if (offset > size)
+ return NULL;
- return entry;
+ return entry;
}
-
-// vim:ts=4:sw=4:expandtab