aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-02-06 05:19:46 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-02-08 00:48:02 +0100
commite33e580fc03b75be85c4bf6816fe1f40d945a942 (patch)
treebe98ad9a05e3fb1ec1b906a664f72203e8d01fdd
parentfde4e274bd9ba2b539fd466dac742fdf506cd3d9 (diff)
downloadhardware_replicant_libsamsung-ipc-e33e580fc03b75be85c4bf6816fe1f40d945a942.tar.gz
hardware_replicant_libsamsung-ipc-e33e580fc03b75be85c4bf6816fe1f40d945a942.tar.bz2
hardware_replicant_libsamsung-ipc-e33e580fc03b75be85c4bf6816fe1f40d945a942.zip
devices: crespo: cosmetic cleanups
- Whitespaces were unified to use 4 spaces as stated by the last line that has vim settings. - The line length was limited to 80 characters with the exception of the functions with only one argument where it didn't make sense to try to split it as the result would look counter intuitive. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--samsung-ipc/devices/crespo/crespo.c74
1 files changed, 46 insertions, 28 deletions
diff --git a/samsung-ipc/devices/crespo/crespo.c b/samsung-ipc/devices/crespo/crespo.c
index 8e1569c..206f43b 100644
--- a/samsung-ipc/devices/crespo/crespo.c
+++ b/samsung-ipc/devices/crespo/crespo.c
@@ -49,7 +49,8 @@ int crespo_boot(struct ipc_client *client)
ipc_client_log(client, "Starting crespo modem boot");
- modem_image_data = file_data_read(client, CRESPO_MODEM_IMAGE_DEVICE, CRESPO_MODEM_IMAGE_SIZE, 0x1000, 0);
+ modem_image_data = file_data_read(client, CRESPO_MODEM_IMAGE_DEVICE,
+ CRESPO_MODEM_IMAGE_SIZE, 0x1000, 0);
if (modem_image_data == NULL) {
ipc_client_log(client, "Reading modem image data failed");
goto error;
@@ -92,7 +93,8 @@ int crespo_boot(struct ipc_client *client)
lseek(modem_ctl_fd, 0, SEEK_SET);
- rc = xmm616_firmware_send(client, modem_ctl_fd, NULL, (void *) p, CRESPO_MODEM_IMAGE_SIZE - CRESPO_PSI_SIZE);
+ rc = xmm616_firmware_send(client, modem_ctl_fd, NULL, (void *) p,
+ CRESPO_MODEM_IMAGE_SIZE - CRESPO_PSI_SIZE);
if (rc < 0) {
ipc_client_log(client, "Sending XMM616 firmware failed");
goto error;
@@ -133,8 +135,9 @@ int crespo_fmt_send(struct ipc_client *client, struct ipc_message *message)
struct modem_io mio;
int rc;
- if (client == NULL || client->handlers == NULL || client->handlers->write == NULL || message == NULL)
- return -1;
+ if (client == NULL || client->handlers == NULL ||
+ client->handlers->write == NULL || message == NULL)
+ return -1;
ipc_fmt_header_setup(&header, message);
@@ -144,11 +147,14 @@ int crespo_fmt_send(struct ipc_client *client, struct ipc_message *message)
memcpy(mio.data, &header, sizeof(struct ipc_fmt_header));
if (message->data != NULL && message->size > 0)
- memcpy((void *) ((unsigned char *) mio.data + sizeof(struct ipc_fmt_header)), message->data, message->size);
+ memcpy((void *) ((unsigned char *) mio.data +
+ sizeof(struct ipc_fmt_header)),
+ message->data, message->size);
ipc_client_log_send(client, message, __func__);
- rc = client->handlers->write(client->handlers->transport_data, (void *) &mio, sizeof(struct modem_io));
+ rc = client->handlers->write(client->handlers->transport_data,
+ (void *) &mio, sizeof(struct modem_io));
if (rc < 0) {
ipc_client_log(client, "Writing FMT data failed");
goto error;
@@ -173,17 +179,21 @@ int crespo_fmt_recv(struct ipc_client *client, struct ipc_message *message)
struct modem_io mio;
int rc;
- if (client == NULL || client->handlers == NULL || client->handlers->read == NULL || message == NULL)
- return -1;
+ if (client == NULL || client->handlers == NULL ||
+ client->handlers->read == NULL || message == NULL)
+ return -1;
memset(&mio, 0, sizeof(struct modem_io));
mio.size = CRESPO_BUFFER_LENGTH;
mio.data = calloc(1, mio.size);
- rc = client->handlers->read(client->handlers->transport_data, &mio, sizeof(struct modem_io) + mio.size);
- if (rc < 0 || mio.data == NULL || mio.size < sizeof(struct ipc_fmt_header) || mio.size > CRESPO_BUFFER_LENGTH) {
- ipc_client_log(client, "Reading FMT data failed");
- goto error;
+ rc = client->handlers->read(client->handlers->transport_data, &mio,
+ sizeof(struct modem_io) + mio.size);
+ if (rc < 0 || mio.data == NULL ||
+ mio.size < sizeof(struct ipc_fmt_header) ||
+ mio.size > CRESPO_BUFFER_LENGTH) {
+ ipc_client_log(client, "Reading FMT data failed");
+ goto error;
}
header = (struct ipc_fmt_header *) mio.data;
@@ -194,7 +204,10 @@ int crespo_fmt_recv(struct ipc_client *client, struct ipc_message *message)
message->size = mio.size - sizeof(struct ipc_fmt_header);
message->data = calloc(1, message->size);
- memcpy(message->data, (void *) ((unsigned char *) mio.data + sizeof(struct ipc_fmt_header)), message->size);
+ memcpy(message->data,
+ (void *) ((unsigned char *) mio.data +
+ sizeof(struct ipc_fmt_header)),
+ message->size);
}
ipc_client_log_recv(client, message, __func__);
@@ -217,8 +230,9 @@ int crespo_rfs_send(struct ipc_client *client, struct ipc_message *message)
struct modem_io mio;
int rc;
- if (client == NULL || client->handlers == NULL || client->handlers->write == NULL || message == NULL)
- return -1;
+ if (client == NULL || client->handlers == NULL ||
+ client->handlers->write == NULL || message == NULL)
+ return -1;
memset(&mio, 0, sizeof(struct modem_io));
mio.id = message->mseq;
@@ -233,7 +247,8 @@ int crespo_rfs_send(struct ipc_client *client, struct ipc_message *message)
ipc_client_log_send(client, message, __func__);
- rc = client->handlers->write(client->handlers->transport_data, (void *) &mio, sizeof(struct modem_io));
+ rc = client->handlers->write(client->handlers->transport_data,
+ (void *) &mio, sizeof(struct modem_io));
if (rc < 0) {
ipc_client_log(client, "Writing RFS data failed");
goto error;
@@ -257,17 +272,20 @@ int crespo_rfs_recv(struct ipc_client *client, struct ipc_message *message)
struct modem_io mio;
int rc;
- if (client == NULL || client->handlers == NULL || client->handlers->read == NULL || message == NULL)
- return -1;
+ if (client == NULL || client->handlers == NULL ||
+ client->handlers->read == NULL || message == NULL)
+ return -1;
memset(&mio, 0, sizeof(struct modem_io));
mio.size = CRESPO_BUFFER_LENGTH;
mio.data = calloc(1, mio.size);
- rc = client->handlers->read(client->handlers->transport_data, &mio, sizeof(struct modem_io) + mio.size);
- if (rc < 0 || mio.data == NULL || mio.size <= 0 || mio.size > CRESPO_BUFFER_LENGTH) {
- ipc_client_log(client, "Reading RFS data failed");
- goto error;
+ rc = client->handlers->read(client->handlers->transport_data, &mio,
+ sizeof(struct modem_io) + mio.size);
+ if (rc < 0 || mio.data == NULL || mio.size <= 0 ||
+ mio.size > CRESPO_BUFFER_LENGTH) {
+ ipc_client_log(client, "Reading RFS data failed");
+ goto error;
}
memset(message, 0, sizeof(struct ipc_message));
@@ -481,8 +499,8 @@ int crespo_power_off(__attribute__((unused)) void *data)
}
int crespo_data_create(void **transport_data,
- __attribute__((unused)) void **power_data,
- __attribute__((unused)) void **gprs_data)
+ __attribute__((unused)) void **power_data,
+ __attribute__((unused)) void **gprs_data)
{
if (transport_data == NULL)
return -1;
@@ -493,8 +511,8 @@ int crespo_data_create(void **transport_data,
}
int crespo_data_destroy(void *transport_data,
- __attribute__((unused)) void *power_data,
- __attribute__((unused)) void *gprs_data)
+ __attribute__((unused)) void *power_data,
+ __attribute__((unused)) void *gprs_data)
{
if (transport_data == NULL)
return -1;
@@ -505,13 +523,13 @@ int crespo_data_destroy(void *transport_data,
}
int crespo_gprs_activate(__attribute__((unused)) void *data,
- __attribute__((unused)) unsigned int cid)
+ __attribute__((unused)) unsigned int cid)
{
return 0;
}
int crespo_gprs_deactivate(__attribute__((unused)) void *data,
- __attribute__((unused)) unsigned int cid)
+ __attribute__((unused)) unsigned int cid)
{
return 0;
}