aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal_buffers.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/src/hal_buffers.c')
-rw-r--r--os/hal/src/hal_buffers.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/os/hal/src/hal_buffers.c b/os/hal/src/hal_buffers.c
index f7b2c9f4a..1ca880f1a 100644
--- a/os/hal/src/hal_buffers.c
+++ b/os/hal/src/hal_buffers.c
@@ -388,12 +388,12 @@ size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp,
/* Smaller chunks in order to not make the critical zone too long,
this impacts throughput however.*/
- if (size > 64U) {
+ if (size > (size_t)BUFFERS_CHUNKS_SIZE) {
/* Giving the compiler a chance to optimize for a fixed size move.*/
- memcpy(bp, ibqp->ptr, 64U);
- bp += 64U;
- ibqp->ptr += 64U;
- r += 64U;
+ memcpy(bp, ibqp->ptr, BUFFERS_CHUNKS_SIZE);
+ bp += (size_t)BUFFERS_CHUNKS_SIZE;
+ ibqp->ptr += (size_t)BUFFERS_CHUNKS_SIZE;
+ r += (size_t)BUFFERS_CHUNKS_SIZE;
}
else {
memcpy(bp, ibqp->ptr, size);
@@ -751,12 +751,12 @@ size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp,
/* Smaller chunks in order to not make the critical zone too long,
this impacts throughput however.*/
- if (size > 64U) {
+ if (size > (size_t)BUFFERS_CHUNKS_SIZE) {
/* Giving the compiler a chance to optimize for a fixed size move.*/
- memcpy(obqp->ptr, bp, 64U);
- bp += 64U;
- obqp->ptr += 64U;
- w += 64U;
+ memcpy(obqp->ptr, bp, (size_t)BUFFERS_CHUNKS_SIZE);
+ bp += (size_t)BUFFERS_CHUNKS_SIZE;
+ obqp->ptr += (size_t)BUFFERS_CHUNKS_SIZE;
+ w += (size_t)BUFFERS_CHUNKS_SIZE;
}
else {
memcpy(obqp->ptr, bp, size);