On Thu, Feb 29, 2024 at 03:15:49PM +0100, Herve Codina wrote:
> The QMC HDLC driver provides support for HDLC using the QMC (QUICC
> Multichannel Controller) to transfer the HDLC data.

...

+ array_size.h
+ bug.h

> +#include <linux/cleanup.h>
> +#include <linux/dma-mapping.h>

+ device.h
+ err.h

> +#include <linux/hdlc.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/slab.h>

+ spinlock.h
+ types.h

With this fixed (below is up to you),
Reviewed-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

...

> +free_desc:
> +     qmc_chan_reset(qmc_hdlc->qmc_chan, QMC_CHAN_ALL);
> +     for (i = 0; i < ARRAY_SIZE(qmc_hdlc->rx_descs); i++) {

I'm wondering what prevents you from doing

        while (i--) {

> +             desc = &qmc_hdlc->rx_descs[i];

> +             if (!desc->skb)
> +                     continue;

...and probably get rid of this check?

> +             dma_unmap_single(qmc_hdlc->dev, desc->dma_addr, desc->dma_size,
> +                              DMA_FROM_DEVICE);
> +             kfree_skb(desc->skb);
> +             desc->skb = NULL;
> +     }

-- 
With Best Regards,
Andy Shevchenko


Reply via email to