aboutsummaryrefslogtreecommitdiffstats
path: root/src/pru/main.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-08-13 16:48:27 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-08-14 18:32:15 -0400
commitf8bd8b97bea9273d166efdc06c3a6a54fc24ffdb (patch)
tree4fc1819b36bd3151538dac06909fe83e841b6c86 /src/pru/main.c
parentf3da473285557b0424d9b649bc67faa686d74393 (diff)
downloadkutter-f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb.tar.gz
kutter-f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb.tar.xz
kutter-f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb.zip
command: Don't pass max_size to command_encodef()
The command_encodef() can read the max_size parameter directly from the 'struct command_encoder' passed into it. Also, there is no need to check that a message will fit in a buffer if the buffer is declared to be MESSAGE_MAX in size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/pru/main.c')
-rw-r--r--src/pru/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pru/main.c b/src/pru/main.c
index 45eb8274..6eed82e3 100644
--- a/src/pru/main.c
+++ b/src/pru/main.c
@@ -135,14 +135,13 @@ void
console_sendf(const struct command_encoder *ce, va_list args)
{
// Verify space for message
- uint32_t max_size = ce->max_size;
uint32_t send_push_pos = SHARED_MEM->send_push_pos;
struct shared_response_buffer *s = &SHARED_MEM->send_data[send_push_pos];
- if (max_size > sizeof(s->data) || readl(&s->count))
+ if (readl(&s->count))
return;
// Generate message
- uint32_t msglen = command_encodef(s->data, max_size, ce, args);
+ uint32_t msglen = command_encodef(s->data, ce, args);
// Signal PRU0 to transmit message
writel(&s->count, msglen);