Re: [PATCH 12/20] sh: dma: Remove unused dmac_search_free_channel()

2024-05-02 Thread Geert Uytterhoeven
Hi Adrian,

On Wed, May 1, 2024 at 11:09 AM John Paul Adrian Glaubitz
 wrote:
> On Fri, 2024-03-01 at 22:02 +0100, Geert Uytterhoeven wrote:
> > arch/sh/drivers/dma/dma-api.c:164:5: warning: no previous prototype for 
> > 'dmac_search_free_channel' [-Wmissing-prototypes]
> >
> > dmac_search_free_channel() never had a user in upstream, remove it.
> >
> > Signed-off-by: Geert Uytterhoeven 
> > ---
> > dma_extend(), get_dma_info_by_name(), register_chan_caps(), and
> > request_dma_bycap() are also unused, but don't trigger warnings
> > ---
>
> I assume the other functions didn't trigger a warning because their symbols
> were exported. Correct me if I'm wrong.

No, because they have a forward declaration in arch/sh/include/asm/dma.h.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds



Re: [PATCH 12/20] sh: dma: Remove unused dmac_search_free_channel()

2024-05-01 Thread John Paul Adrian Glaubitz
Hi Geert,

On Fri, 2024-03-01 at 22:02 +0100, Geert Uytterhoeven wrote:
> arch/sh/drivers/dma/dma-api.c:164:5: warning: no previous prototype for 
> 'dmac_search_free_channel' [-Wmissing-prototypes]
> 
> dmac_search_free_channel() never had a user in upstream, remove it.
> 
> Signed-off-by: Geert Uytterhoeven 
> ---
> dma_extend(), get_dma_info_by_name(), register_chan_caps(), and
> request_dma_bycap() are also unused, but don't trigger warnings
> ---

I assume the other functions didn't trigger a warning because their symbols
were exported. Correct me if I'm wrong.

Adrian

>  arch/sh/drivers/dma/dma-api.c | 27 ---
>  1 file changed, 27 deletions(-)
> 
> diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
> index 89cd4a3b4ccafbe2..f49097fa634c36d4 100644
> --- a/arch/sh/drivers/dma/dma-api.c
> +++ b/arch/sh/drivers/dma/dma-api.c
> @@ -161,33 +161,6 @@ int request_dma_bycap(const char **dmac, const char 
> **caps, const char *dev_id)
>  }
>  EXPORT_SYMBOL(request_dma_bycap);
>  
> -int dmac_search_free_channel(const char *dev_id)
> -{
> - struct dma_channel *channel = { 0 };
> - struct dma_info *info = get_dma_info(0);
> - int i;
> -
> - for (i = 0; i < info->nr_channels; i++) {
> - channel = >channels[i];
> - if (unlikely(!channel))
> - return -ENODEV;
> -
> - if (atomic_read(>busy) == 0)
> - break;
> - }
> -
> - if (info->ops->request) {
> - int result = info->ops->request(channel);
> - if (result)
> - return result;
> -
> - atomic_set(>busy, 1);
> - return channel->chan;
> - }
> -
> - return -ENOSYS;
> -}
> -
>  int request_dma(unsigned int chan, const char *dev_id)
>  {
>   struct dma_channel *channel = { 0 };

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913