Commit e0852ee6 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[fix] extra fixes from warnings

There's an actual bugfix on tilings in there, as well as extra type
mismatches.
parent ba0737b7
...@@ -58,6 +58,7 @@ void *aml_scratch_par_do_thread(void *arg) ...@@ -58,6 +58,7 @@ void *aml_scratch_par_do_thread(void *arg)
aml_dma_copy(scratch->data.dma, scratch->data.tiling, req->dstptr, aml_dma_copy(scratch->data.dma, scratch->data.tiling, req->dstptr,
req->dstid, scratch->data.tiling, req->srcptr, req->srcid); req->dstid, scratch->data.tiling, req->srcptr, req->srcid);
return NULL;
} }
struct aml_scratch_par_ops aml_scratch_par_inner_ops = { struct aml_scratch_par_ops aml_scratch_par_inner_ops = {
......
...@@ -62,8 +62,7 @@ struct aml_tiling_iterator_ops aml_tiling_iterator_1d_ops = { ...@@ -62,8 +62,7 @@ struct aml_tiling_iterator_ops aml_tiling_iterator_1d_ops = {
int aml_tiling_1d_tileid(const struct aml_tiling_data *t, va_list ap) int aml_tiling_1d_tileid(const struct aml_tiling_data *t, va_list ap)
{ {
const struct aml_tiling_1d_data *data = (void)t;
(const struct aml_tiling_1d_data *)t;
size_t x = va_arg(ap, size_t); size_t x = va_arg(ap, size_t);
return x; return x;
} }
...@@ -99,7 +98,7 @@ int aml_tiling_1d_ndims(const struct aml_tiling_data *t, va_list ap) ...@@ -99,7 +98,7 @@ int aml_tiling_1d_ndims(const struct aml_tiling_data *t, va_list ap)
size_t *x = va_arg(ap, size_t *); size_t *x = va_arg(ap, size_t *);
*x = data->totalsize/data->blocksize; *x = data->totalsize/data->blocksize;
if (data->totalsize % data->blocksize != 0) if (data->totalsize % data->blocksize != 0)
*x++; *x += 1;
return 0; return 0;
} }
...@@ -107,6 +106,7 @@ int aml_tiling_1d_init_iterator(struct aml_tiling_data *t, ...@@ -107,6 +106,7 @@ int aml_tiling_1d_init_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it, int flags) struct aml_tiling_iterator *it, int flags)
{ {
assert(it->data != NULL); assert(it->data != NULL);
(void)flags;
struct aml_tiling_iterator_1d_data *data = struct aml_tiling_iterator_1d_data *data =
(struct aml_tiling_iterator_1d_data *)it->data; (struct aml_tiling_iterator_1d_data *)it->data;
...@@ -136,12 +136,15 @@ int aml_tiling_1d_create_iterator(struct aml_tiling_data *t, ...@@ -136,12 +136,15 @@ int aml_tiling_1d_create_iterator(struct aml_tiling_data *t,
int aml_tiling_1d_fini_iterator(struct aml_tiling_data *t, int aml_tiling_1d_fini_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it) struct aml_tiling_iterator *it)
{ {
(void)t;
(void)it;
return 0; return 0;
} }
int aml_tiling_1d_destroy_iterator(struct aml_tiling_data *t, int aml_tiling_1d_destroy_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator **it) struct aml_tiling_iterator **it)
{ {
(void)t;
free(*it); free(*it);
return 0; return 0;
} }
...@@ -197,7 +200,6 @@ int aml_tiling_1d_create(struct aml_tiling **t, ...@@ -197,7 +200,6 @@ int aml_tiling_1d_create(struct aml_tiling **t,
int aml_tiling_1d_init(struct aml_tiling *t, int aml_tiling_1d_init(struct aml_tiling *t,
size_t tilesize, size_t totalsize) size_t tilesize, size_t totalsize)
{ {
int err;
struct aml_tiling_1d_data *data; struct aml_tiling_1d_data *data;
if (t == NULL || t->data == NULL) if (t == NULL || t->data == NULL)
...@@ -215,6 +217,7 @@ int aml_tiling_1d_init(struct aml_tiling *t, ...@@ -215,6 +217,7 @@ int aml_tiling_1d_init(struct aml_tiling *t,
void aml_tiling_1d_fini(struct aml_tiling *t) void aml_tiling_1d_fini(struct aml_tiling *t)
{ {
/* nothing to do */ /* nothing to do */
(void)t;
} }
......
...@@ -92,7 +92,7 @@ size_t aml_tiling_2d_tilesize(const struct aml_tiling_data *t, int tileid) ...@@ -92,7 +92,7 @@ size_t aml_tiling_2d_tilesize(const struct aml_tiling_data *t, int tileid)
const struct aml_tiling_2d_data *data = const struct aml_tiling_2d_data *data =
(const struct aml_tiling_2d_data *)t; (const struct aml_tiling_2d_data *)t;
if (tileid < 0 || tileid >= data->ndims[0]*data->ndims[1]) if (tileid < 0 || tileid >= (int)(data->ndims[0]*data->ndims[1]))
return 0; return 0;
else else
return data->blocksize; return data->blocksize;
...@@ -105,7 +105,7 @@ void *aml_tiling_2d_tilestart(const struct aml_tiling_data *t, ...@@ -105,7 +105,7 @@ void *aml_tiling_2d_tilestart(const struct aml_tiling_data *t,
(const struct aml_tiling_2d_data *)t; (const struct aml_tiling_2d_data *)t;
intptr_t p = (intptr_t)ptr; intptr_t p = (intptr_t)ptr;
if (tileid < 0 || tileid >= data->ndims[0]*data->ndims[1]) if (tileid < 0 || tileid >= (int)(data->ndims[0]*data->ndims[1]))
return NULL; return NULL;
else else
return (void *)(p + tileid*data->blocksize); return (void *)(p + tileid*data->blocksize);
...@@ -128,6 +128,7 @@ int aml_tiling_2d_init_iterator(struct aml_tiling_data *t, ...@@ -128,6 +128,7 @@ int aml_tiling_2d_init_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it, int flags) struct aml_tiling_iterator *it, int flags)
{ {
assert(it->data != NULL); assert(it->data != NULL);
(void)flags;
struct aml_tiling_iterator_2d_data *data = struct aml_tiling_iterator_2d_data *data =
(struct aml_tiling_iterator_2d_data *)it->data; (struct aml_tiling_iterator_2d_data *)it->data;
it->ops = &aml_tiling_iterator_2d_ops; it->ops = &aml_tiling_iterator_2d_ops;
...@@ -156,12 +157,15 @@ int aml_tiling_2d_create_iterator(struct aml_tiling_data *t, ...@@ -156,12 +157,15 @@ int aml_tiling_2d_create_iterator(struct aml_tiling_data *t,
int aml_tiling_2d_fini_iterator(struct aml_tiling_data *t, int aml_tiling_2d_fini_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it) struct aml_tiling_iterator *it)
{ {
(void)t;
(void)it;
return 0; return 0;
} }
int aml_tiling_2d_destroy_iterator(struct aml_tiling_data *t, int aml_tiling_2d_destroy_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator **it) struct aml_tiling_iterator **it)
{ {
(void)t;
free(*it); free(*it);
return 0; return 0;
} }
...@@ -238,8 +242,8 @@ int aml_tiling_2d_init(struct aml_tiling *t, int type, ...@@ -238,8 +242,8 @@ int aml_tiling_2d_init(struct aml_tiling *t, int type,
size_t tilesize, size_t totalsize, size_t tilesize, size_t totalsize,
size_t rowsize, size_t colsize) size_t rowsize, size_t colsize)
{ {
int err;
struct aml_tiling_2d_data *data; struct aml_tiling_2d_data *data;
(void)type;
if (t == NULL || t->data == NULL) if (t == NULL || t->data == NULL)
return -AML_EINVAL; return -AML_EINVAL;
...@@ -258,6 +262,7 @@ int aml_tiling_2d_init(struct aml_tiling *t, int type, ...@@ -258,6 +262,7 @@ int aml_tiling_2d_init(struct aml_tiling *t, int type,
void aml_tiling_2d_fini(struct aml_tiling *t) void aml_tiling_2d_fini(struct aml_tiling *t)
{ {
/* nothing to do */ /* nothing to do */
(void)t;
} }
......
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