aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
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-06-27 18:39:31 +0200
commitc58ad3a442834b79c0dc94fd15a96d4c93cc80d5 (patch)
tree1eb57bbbf973947b3f4aac601e7019a9d64fcb25 /samsung-ipc
parentd2a921cd5eb4575aa99e60f02fd2abc1b726a7b8 (diff)
downloadhardware_replicant_libsamsung-ipc-c58ad3a442834b79c0dc94fd15a96d4c93cc80d5.tar.gz
hardware_replicant_libsamsung-ipc-c58ad3a442834b79c0dc94fd15a96d4c93cc80d5.tar.bz2
hardware_replicant_libsamsung-ipc-c58ad3a442834b79c0dc94fd15a96d4c93cc80d5.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> Reviewed-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Diffstat (limited to 'samsung-ipc')
-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