Re: [PATCH v4 01/12] can: m_can: Write transmit header and data in one transaction

From: Simon Horman
Date: Wed Jun 21 2023 - 10:19:23 EST


On Wed, Jun 21, 2023 at 11:23:39AM +0200, Markus Schneider-Pargmann wrote:
> Combine header and data before writing to the transmit fifo to reduce
> the overhead for peripheral chips.
>
> Signed-off-by: Markus Schneider-Pargmann <msp@xxxxxxxxxxxx>
> ---
> drivers/net/can/m_can/m_can.c | 34 +++++++++++++++++++++-------------
> 1 file changed, 21 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index a5003435802b..5251073987ee 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -317,6 +317,12 @@ struct id_and_dlc {
> u32 dlc;
> };
>
> +struct m_can_fifo_element {
> + u32 id;
> + u32 dlc;
> + u8 data[CANFD_MAX_DLEN];
> +};
> +
> static inline u32 m_can_read(struct m_can_classdev *cdev, enum m_can_reg reg)
> {
> return cdev->ops->read_reg(cdev, reg);
> @@ -1622,6 +1628,8 @@ static int m_can_next_echo_skb_occupied(struct net_device *dev, int putidx)
> static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
> {
> struct canfd_frame *cf = (struct canfd_frame *)cdev->tx_skb->data;
> + u8 len_padded = DIV_ROUND_UP(cf->len, 4);
> + struct m_can_fifo_element fifo_element;
> struct net_device *dev = cdev->net;
> struct sk_buff *skb = cdev->tx_skb;
> struct id_and_dlc fifo_header;

Hi Markus,

GCC 12.3.0 complains that fifo_header is not (no longer) used.

drivers/net/can/m_can/m_can.c:1635:20: warning: unused variable 'fifo_header' [-Wunused-variable]
struct id_and_dlc fifo_header;

--
pw-bot: changes-requested