can: peak_canfd: improves 32-bit alignment
authorStephane Grosjean <s.grosjean@peak-system.com>
Thu, 21 Jun 2018 13:23:26 +0000 (15:23 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 27 Jul 2018 08:40:18 +0000 (10:40 +0200)
The embedded firmware aligns its messages on 32-bit boundaries.
This patch makes sure to browse through the list of received messages
while respecting 32-bit alignment.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/peak_canfd/peak_canfd.c

index ed8561d4a90f4b5e25683a5483f0d98248d7dca2..5696d7e807513a529823ac218f8236bcf52aea8e 100644 (file)
@@ -486,7 +486,7 @@ int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv,
                if (msg_size <= 0)
                        break;
 
-               msg_ptr += msg_size;
+               msg_ptr += ALIGN(msg_size, 4);
        }
 
        if (msg_size < 0)