Skip to content

Commit

Permalink
change all \n to \r\n
Browse files Browse the repository at this point in the history
make the line ending consistent in the whole project

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 authored and Wendy Liang committed Feb 27, 2019
1 parent 95b833d commit dd17c5a
Show file tree
Hide file tree
Showing 23 changed files with 243 additions and 244 deletions.
20 changes: 10 additions & 10 deletions apps/examples/echo/rpmsg-echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len,

/* On reception of a shutdown we signal the application to terminate */
if ((*(unsigned int *)data) == SHUTDOWN_MSG) {
LPRINTF("shutdown message is received.\n");
LPRINTF("shutdown message is received.\r\n");
shutdown_req = 1;
return RPMSG_SUCCESS;
}

/* Send data back to master */
if (rpmsg_send(ept, data, len) < 0) {
LPERROR("rpmsg_send failed\n");
LPERROR("rpmsg_send failed\r\n");
}
return RPMSG_SUCCESS;
}

static void rpmsg_service_unbind(struct rpmsg_endpoint *ept)
{
(void)ept;
LPRINTF("unexpected Remote endpoint destroy\n");
LPRINTF("unexpected Remote endpoint destroy\r\n");
shutdown_req = 1;
}

Expand All @@ -55,17 +55,17 @@ int app(struct rpmsg_device *rdev, void *priv)
int ret;

/* Initialize RPMSG framework */
LPRINTF("Try to create rpmsg endpoint.\n");
LPRINTF("Try to create rpmsg endpoint.\r\n");

ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME,
0, RPMSG_ADDR_ANY, rpmsg_endpoint_cb,
rpmsg_service_unbind);
if (ret) {
LPERROR("Failed to create endpoint.\n");
LPERROR("Failed to create endpoint.\r\n");
return -1;
}

LPRINTF("Successfully created rpmsg endpoint.\n");
LPRINTF("Successfully created rpmsg endpoint.\r\n");
while(1) {
platform_poll(priv);
/* we got a shutdown request, exit */
Expand All @@ -87,19 +87,19 @@ int main(int argc, char *argv[])
struct rpmsg_device *rpdev;
int ret;

LPRINTF("Starting application...\n");
LPRINTF("Starting application...\r\n");

/* Initialize platform */
ret = platform_init(argc, argv, &platform);
if (ret) {
LPERROR("Failed to initialize platform.\n");
LPERROR("Failed to initialize platform.\r\n");
ret = -1;
} else {
rpdev = platform_create_rpmsg_vdev(platform, 0,
VIRTIO_DEV_SLAVE,
NULL, NULL);
if (!rpdev) {
LPERROR("Failed to create rpmsg virtio device.\n");
LPERROR("Failed to create rpmsg virtio device.\r\n");
ret = -1;
} else {
app(rpdev, platform);
Expand All @@ -108,7 +108,7 @@ int main(int argc, char *argv[])
}
}

LPRINTF("Stopping application...\n");
LPRINTF("Stopping application...\r\n");
platform_cleanup(platform);

return ret;
Expand Down
40 changes: 20 additions & 20 deletions apps/examples/echo/rpmsg-ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len,
r_payload->num, (unsigned long)len);

if (r_payload->size == 0) {
LPERROR(" Invalid size of package is received.\n");
LPERROR(" Invalid size of package is received.\r\n");
err_cnt++;
return RPMSG_SUCCESS;
}
/* Validate data buffer integrity. */
for (i = 0; i < (int)r_payload->size; i++) {
if (r_payload->data[i] != 0xA5) {
LPRINTF("Data corruption at index %d\n", i);
LPRINTF("Data corruption at index %d\r\n", i);
err_cnt++;
break;
}
Expand All @@ -68,16 +68,16 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept)
{
(void)ept;
rpmsg_destroy_ept(&lept);
LPRINTF("echo test: service is destroyed\n");
LPRINTF("echo test: service is destroyed\r\n");
ept_deleted = 1;
}

static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev,
const char *name, uint32_t dest)
{
LPRINTF("new endpoint notification is received.\n");
LPRINTF("new endpoint notification is received.\r\n");
if (strcmp(name, RPMSG_SERVICE_NAME))
LPERROR("Unexpected name service %s.\n", name);
LPERROR("Unexpected name service %s.\r\n", name);
else
(void)rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME,
APP_EPT_ADDR, dest,
Expand All @@ -97,11 +97,11 @@ int app (struct rpmsg_device *rdev, void *priv)
int expect_rnum = 0;

LPRINTF(" 1 - Send data to remote core, retrieve the echo");
LPRINTF(" and validate its integrity ..\n");
LPRINTF(" and validate its integrity ..\r\n");

max_size = rpmsg_virtio_get_buffer_size(rdev);
if (max_size < 0) {
LPERROR("No avaiable buffer size.\n");
LPERROR("No avaiable buffer size.\r\n");
return -1;
}
max_size -= sizeof(struct _payload);
Expand All @@ -111,7 +111,7 @@ int app (struct rpmsg_device *rdev, void *priv)
max_size);

if (!i_payload) {
LPERROR("memory allocation failed.\n");
LPERROR("memory allocation failed.\r\n");
return -1;
}

Expand All @@ -121,33 +121,33 @@ int app (struct rpmsg_device *rdev, void *priv)
rpmsg_endpoint_cb, rpmsg_service_unbind);

if (ret) {
LPERROR("Failed to create RPMsg endpoint.\n");
LPERROR("Failed to create RPMsg endpoint.\r\n");
return ret;
}

while (!is_rpmsg_ept_ready(&lept))
platform_poll(priv);

LPRINTF("RPMSG endpoint is binded with remote.\n");
LPRINTF("RPMSG endpoint is binded with remote.\r\n");
for (i = 0, size = PAYLOAD_MIN_SIZE; i < num_payloads; i++, size++) {
i_payload->num = i;
i_payload->size = size;

/* Mark the data buffer. */
memset(&(i_payload->data[0]), 0xA5, size);

LPRINTF("sending payload number %lu of size %lu\n",
LPRINTF("sending payload number %lu of size %lu\r\n",
i_payload->num,
(unsigned long)(2 * sizeof(unsigned long)) + size);

ret = rpmsg_send(&lept, i_payload,
(2 * sizeof(unsigned long)) + size);

if (ret < 0) {
LPERROR("Failed to send data...\n");
LPERROR("Failed to send data...\r\n");
break;
}
LPRINTF("echo test: sent : %lu\n",
LPRINTF("echo test: sent : %lu\r\n",
(unsigned long)(2 * sizeof(unsigned long)) + size);

expect_rnum++;
Expand All @@ -157,12 +157,12 @@ int app (struct rpmsg_device *rdev, void *priv)

}

LPRINTF("**********************************\n");
LPRINTF(" Test Results: Error count = %d \n", err_cnt);
LPRINTF("**********************************\n");
LPRINTF("**********************************\r\n");
LPRINTF(" Test Results: Error count = %d \r\n", err_cnt);
LPRINTF("**********************************\r\n");
/* Destroy the RPMsg endpoint */
rpmsg_destroy_ept(&lept);
LPRINTF("Quitting application .. Echo test end\n");
LPRINTF("Quitting application .. Echo test end\r\n");

metal_free_memory(i_payload);
return 0;
Expand All @@ -177,15 +177,15 @@ int main(int argc, char *argv[])
/* Initialize platform */
ret = platform_init(argc, argv, &platform);
if (ret) {
LPERROR("Failed to initialize platform.\n");
LPERROR("Failed to initialize platform.\r\n");
ret = -1;
} else {
rpdev = platform_create_rpmsg_vdev(platform, 0,
VIRTIO_DEV_MASTER,
NULL,
rpmsg_name_service_bind_cb);
if (!rpdev) {
LPERROR("Failed to create rpmsg virtio device.\n");
LPERROR("Failed to create rpmsg virtio device.\r\n");
ret = -1;
} else {
app(rpdev, platform);
Expand All @@ -194,7 +194,7 @@ int main(int argc, char *argv[])
}
}

LPRINTF("Stopping application...\n");
LPRINTF("Stopping application...\r\n");
platform_cleanup(platform);

return ret;
Expand Down
6 changes: 3 additions & 3 deletions apps/examples/load_fw/load_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ static XStatus IpiConfigure(XIpiPsu *const IpiInstPtr)
IpiCfgPtr = XIpiPsu_LookupConfig(XPAR_XIPIPSU_0_DEVICE_ID);
if (NULL == IpiCfgPtr) {
Status = XST_FAILURE;
LPERROR("%s ERROR in getting CfgPtr\n", __func__);
LPERROR("%s ERROR in getting CfgPtr\r\n", __func__);
return Status;
}

/* Init with the Cfg Data */
Status = XIpiPsu_CfgInitialize(IpiInstPtr, IpiCfgPtr,
IpiCfgPtr->BaseAddress);
if (XST_SUCCESS != Status) {
LPERROR("%s ERROR #%d in configuring IPI\n", __func__, Status);
LPERROR("%s ERROR #%d in configuring IPI\r\n", __func__, Status);
return Status;
}
return Status;
Expand Down Expand Up @@ -219,7 +219,7 @@ int main(void)
return -1;
}

LPRINTF("Loading Exectuable Demo\n");
LPRINTF("Loading Exectuable Demo\r\n");
/* Initialize libmetal evironment */
metal_init(&metal_param);
/* Initialize remoteproc instance */
Expand Down
2 changes: 1 addition & 1 deletion apps/examples/load_fw/mem_image_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int mem_image_load(void *store, size_t offset, size_t size,

(void)is_blocking;

LPRINTF("%s: offset=0x%x, size=0x%x\n\r",
LPRINTF("%s: offset=0x%x, size=0x%x\r\n",
__func__, offset, size);
if (pa == METAL_BAD_PHYS) {
if (data == NULL) {
Expand Down
14 changes: 7 additions & 7 deletions apps/examples/load_fw/zynqmp_r5_lcm_rproc_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static uint32_t r5_rproc_boot_addr_config(struct r5_rproc_priv *priv,
{
uint32_t rpu_resetaddr;

LPRINTF("%s: R5 ID: %d, boot_addr 0x%x\n",
LPRINTF("%s: R5 ID: %d, boot_addr 0x%x\r\n",
__func__, priv->cpu_id, bootaddr);

if (bootaddr < 0x40000)
Expand All @@ -80,7 +80,7 @@ static void r5_rproc_mode_config(struct r5_rproc_priv *priv)
{
uint32_t tmp;

LPRINTF("%s: mode: %d\n", __func__, priv->cpu_id);
LPRINTF("%s: mode: %d\r\n", __func__, priv->cpu_id);
tmp = metal_io_read32(&priv->rpu_io, RPU_GLBL_CNTL_OFFSET);
if (priv->cpu_id == NODE_RPU) {
/* RPU lock step mode */
Expand All @@ -103,11 +103,11 @@ struct remoteproc *r5_rproc_init(struct remoteproc *rproc,
unsigned int cpu_id = *((unsigned int *)arg);

if (cpu_id < NODE_RPU_0 || cpu_id > NODE_RPU_1) {
xil_printf("rproc init: invalide node id: %d\n\r", cpu_id);
xil_printf("rproc init: invalide node id: %d\r\n", cpu_id);
return NULL;
}

xil_printf("rproc init: node id: %d\n\r", cpu_id);
xil_printf("rproc init: node id: %d\r\n", cpu_id);
priv = metal_allocate_memory(sizeof(*priv));
if (!priv)
return NULL;
Expand Down Expand Up @@ -150,7 +150,7 @@ void *r5_rproc_mmap(struct remoteproc *rproc,

if (!da || !pa)
return NULL;
LPRINTF("%s: pa=0x%x, da=0x%x, size=0x%x, atrribute=0x%x\n\r",
LPRINTF("%s: pa=0x%x, da=0x%x, size=0x%x, atrribute=0x%x\r\n",
__func__, *pa, *da, size, attribute);
lda = *da;
lpa = *pa;
Expand Down Expand Up @@ -189,7 +189,7 @@ void *r5_rproc_mmap(struct remoteproc *rproc,
PM_CAP_ACCESS, 0,
REQUEST_ACK_BLOCKING);
} else {
LPERROR("mmap failed: invalid cpu node: %d\n",
LPERROR("mmap failed: invalid cpu node: %d\r\n",
priv->cpu_id);
return NULL;
}
Expand Down Expand Up @@ -230,7 +230,7 @@ int r5_rproc_start(struct remoteproc *rproc)
ret = XPm_RequestWakeUp(priv->cpu_id, true, resetaddr,
REQUEST_ACK_BLOCKING);
if (ret != XST_SUCCESS) {
LPRINTF("%s: Failed to start RPU 0x%x, ret=0x%x\n\r",
LPRINTF("%s: Failed to start RPU 0x%x, ret=0x%x\r\n",
__func__, priv->cpu_id, ret);
return -1;
} else {
Expand Down
Loading

0 comments on commit dd17c5a

Please sign in to comment.