Commit ba0737b7 authored by Swann Perarnau's avatar Swann Perarnau

[fix] various dma/area fixes after -Wall

Less than perfect types for the most part, plus a few unused variables.
parent fddea6ed
......@@ -33,7 +33,7 @@ struct aml_dma_linux_par_thread_data {
* A logical identifier of the thread in charge for
* the request progress.
**/
int tid;
size_t tid;
/** The actual thread in charge for the request progress**/
pthread_t thread;
/** The dma containing sequential operations **/
......@@ -70,7 +70,7 @@ struct aml_dma_linux_par_data {
struct aml_dma_linux_par_ops {
void *(*do_thread)(void *thread_data);
int (*do_copy)(struct aml_dma_linux_par_data *data,
struct aml_dma_request_linux_par *request, int tid);
struct aml_dma_request_linux_par *request, size_t tid);
};
/**
......
......@@ -47,6 +47,8 @@ aml_area_linux_check_binding(struct aml_area_linux_data *area_data,
{
int err, mode, i;
struct bitmask *nodeset;
// unused parameter
(void)size;
nodeset = numa_allocate_nodemask();
if (nodeset == NULL)
......@@ -209,7 +211,6 @@ int aml_area_linux_init(struct aml_area *area, const int mmap_flags,
const int binding_flags)
{
struct aml_area_linux_data *data;
int err;
if (area == NULL)
return -AML_EINVAL;
......
......@@ -66,7 +66,7 @@ void *aml_dma_linux_par_do_thread(void *arg)
}
int aml_dma_linux_par_do_copy(struct aml_dma_linux_par_data *dma,
struct aml_dma_request_linux_par *req, int tid)
struct aml_dma_request_linux_par *req, size_t tid)
{
assert(dma != NULL);
assert(req != NULL);
......@@ -125,7 +125,7 @@ int aml_dma_linux_par_create_request(struct aml_dma_data *d,
}
pthread_mutex_unlock(&dma->data.lock);
for (int i = 0; i < dma->data.nbthreads; i++) {
for (size_t i = 0; i < dma->data.nbthreads; i++) {
struct aml_dma_linux_par_thread_data *rd = &req->thread_data[i];
rd->req = req;
......@@ -149,7 +149,7 @@ int aml_dma_linux_par_destroy_request(struct aml_dma_data *d,
(struct aml_dma_request_linux_par *)r;
/* we cancel and join, instead of killing, for a cleaner result */
for (int i = 0; i < dma->data.nbthreads; i++) {
for (size_t i = 0; i < dma->data.nbthreads; i++) {
pthread_cancel(req->thread_data[i].thread);
pthread_join(req->thread_data[i].thread, NULL);
}
......@@ -172,7 +172,7 @@ int aml_dma_linux_par_wait_request(struct aml_dma_data *d,
struct aml_dma_request_linux_par *req =
(struct aml_dma_request_linux_par *)r;
for (int i = 0; i < dma->data.nbthreads; i++)
for (size_t i = 0; i < dma->data.nbthreads; i++)
pthread_join(req->thread_data[i].thread, NULL);
/* destroy a completed request */
......@@ -244,7 +244,7 @@ int aml_dma_linux_par_init(struct aml_dma *d, size_t nbreqs,
sizeof(struct aml_dma_request_linux_par),
offsetof(struct aml_dma_request_linux_par, type),
AML_DMA_REQUEST_TYPE_INVALID);
for (int i = 0; i < nbreqs; i++) {
for (size_t i = 0; i < nbreqs; i++) {
struct aml_dma_request_linux_par *req =
aml_vector_get(&dma->data.requests, i);
......@@ -262,7 +262,7 @@ void aml_dma_linux_par_fini(struct aml_dma *d)
if (d == NULL || d->data == NULL)
return;
dma = (struct aml_dma_linux_par *)d->data;
for (int i = 0; i < aml_vector_size(&dma->data.requests); i++) {
for (size_t i = 0; i < aml_vector_size(&dma->data.requests); i++) {
struct aml_dma_request_linux_par *req =
aml_vector_get(&dma->data.requests, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment