[Replicant] [libsamsung-ipc][PATCH 15/48] samsung-ipc: svc: switch to Linux code style

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Sun Apr 5 18:20:49 UTC 2020


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 at cyberdimension.org>
---
 samsung-ipc/svc.c | 76 +++++++++++++++++++++++------------------------
 1 file 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
-- 
2.26.0



More information about the Replicant mailing list