From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>, Arnd Bergmann <arnd@arndb.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Will Deacon <will@kernel.org>,
"Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Nick Piggin <npiggin@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-sh@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 20/20] [RFC] sh: dma: Remove unused functionality
Date: Wed, 01 May 2024 11:12:08 +0200 [thread overview]
Message-ID: <4f302ebb109fb0528a7de4f552e78ee0dd9595c0.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <2beb81fdd7592a94329e3c9a6ba56959f6094019.1709326528.git.geert+renesas@glider.be>
Hi Geert,
On Fri, 2024-03-01 at 22:02 +0100, Geert Uytterhoeven wrote:
> dma_extend(), get_dma_info_by_name(), register_chan_caps(), and
> request_dma_bycap() are unused. Remove them, and all related code.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> arch/sh/drivers/dma/dma-api.c | 116 ----------------------------------
> arch/sh/include/asm/dma.h | 7 --
> 2 files changed, 123 deletions(-)
>
> diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
> index f49097fa634c36d4..87e5a892887360f5 100644
> --- a/arch/sh/drivers/dma/dma-api.c
> +++ b/arch/sh/drivers/dma/dma-api.c
> @@ -41,21 +41,6 @@ struct dma_info *get_dma_info(unsigned int chan)
> }
> EXPORT_SYMBOL(get_dma_info);
>
> -struct dma_info *get_dma_info_by_name(const char *dmac_name)
> -{
> - struct dma_info *info;
> -
> - list_for_each_entry(info, ®istered_dmac_list, list) {
> - if (dmac_name && (strcmp(dmac_name, info->name) != 0))
> - continue;
> - else
> - return info;
> - }
> -
> - return NULL;
> -}
> -EXPORT_SYMBOL(get_dma_info_by_name);
> -
> static unsigned int get_nr_channels(void)
> {
> struct dma_info *info;
> @@ -101,66 +86,6 @@ int get_dma_residue(unsigned int chan)
> }
> EXPORT_SYMBOL(get_dma_residue);
>
> -static int search_cap(const char **haystack, const char *needle)
> -{
> - const char **p;
> -
> - for (p = haystack; *p; p++)
> - if (strcmp(*p, needle) == 0)
> - return 1;
> -
> - return 0;
> -}
> -
> -/**
> - * request_dma_bycap - Allocate a DMA channel based on its capabilities
> - * @dmac: List of DMA controllers to search
> - * @caps: List of capabilities
> - *
> - * Search all channels of all DMA controllers to find a channel which
> - * matches the requested capabilities. The result is the channel
> - * number if a match is found, or %-ENODEV if no match is found.
> - *
> - * Note that not all DMA controllers export capabilities, in which
> - * case they can never be allocated using this API, and so
> - * request_dma() must be used specifying the channel number.
> - */
> -int request_dma_bycap(const char **dmac, const char **caps, const char *dev_id)
> -{
> - unsigned int found = 0;
> - struct dma_info *info;
> - const char **p;
> - int i;
> -
> - BUG_ON(!dmac || !caps);
> -
> - list_for_each_entry(info, ®istered_dmac_list, list)
> - if (strcmp(*dmac, info->name) == 0) {
> - found = 1;
> - break;
> - }
> -
> - if (!found)
> - return -ENODEV;
> -
> - for (i = 0; i < info->nr_channels; i++) {
> - struct dma_channel *channel = &info->channels[i];
> -
> - if (unlikely(!channel->caps))
> - continue;
> -
> - for (p = caps; *p; p++) {
> - if (!search_cap(channel->caps, *p))
> - break;
> - if (request_dma(channel->chan, dev_id) == 0)
> - return channel->chan;
> - }
> - }
> -
> - return -EINVAL;
> -}
> -EXPORT_SYMBOL(request_dma_bycap);
> -
> int request_dma(unsigned int chan, const char *dev_id)
> {
> struct dma_channel *channel = { 0 };
> @@ -213,35 +138,6 @@ void dma_wait_for_completion(unsigned int chan)
> }
> EXPORT_SYMBOL(dma_wait_for_completion);
>
> -int register_chan_caps(const char *dmac, struct dma_chan_caps *caps)
> -{
> - struct dma_info *info;
> - unsigned int found = 0;
> - int i;
> -
> - list_for_each_entry(info, ®istered_dmac_list, list)
> - if (strcmp(dmac, info->name) == 0) {
> - found = 1;
> - break;
> - }
> -
> - if (unlikely(!found))
> - return -ENODEV;
> -
> - for (i = 0; i < info->nr_channels; i++, caps++) {
> - struct dma_channel *channel;
> -
> - if ((info->first_channel_nr + i) != caps->ch_num)
> - return -EINVAL;
> -
> - channel = &info->channels[i];
> - channel->caps = caps->caplist;
> - }
> -
> - return 0;
> -}
> -EXPORT_SYMBOL(register_chan_caps);
> -
> void dma_configure_channel(unsigned int chan, unsigned long flags)
> {
> struct dma_info *info = get_dma_info(chan);
> @@ -267,18 +163,6 @@ int dma_xfer(unsigned int chan, unsigned long from,
> }
> EXPORT_SYMBOL(dma_xfer);
>
> -int dma_extend(unsigned int chan, unsigned long op, void *param)
> -{
> - struct dma_info *info = get_dma_info(chan);
> - struct dma_channel *channel = get_dma_channel(chan);
> -
> - if (info->ops->extend)
> - return info->ops->extend(channel, op, param);
> -
> - return -ENOSYS;
> -}
> -EXPORT_SYMBOL(dma_extend);
> -
> static int dma_proc_show(struct seq_file *m, void *v)
> {
> struct dma_info *info = v;
> diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
> index c8bee3f985a29393..6b6d409956d17f09 100644
> --- a/arch/sh/include/asm/dma.h
> +++ b/arch/sh/include/asm/dma.h
> @@ -56,7 +56,6 @@ struct dma_ops {
> int (*get_residue)(struct dma_channel *chan);
> int (*xfer)(struct dma_channel *chan);
> int (*configure)(struct dma_channel *chan, unsigned long flags);
> - int (*extend)(struct dma_channel *chan, unsigned long op, void *param);
> };
>
> struct dma_channel {
> @@ -118,8 +117,6 @@ extern int dma_xfer(unsigned int chan, unsigned long from,
> #define dma_read_page(chan, from, to) \
> dma_read(chan, from, to, PAGE_SIZE)
>
> -extern int request_dma_bycap(const char **dmac, const char **caps,
> - const char *dev_id);
> extern int get_dma_residue(unsigned int chan);
> extern struct dma_info *get_dma_info(unsigned int chan);
> extern struct dma_channel *get_dma_channel(unsigned int chan);
> @@ -128,10 +125,6 @@ extern void dma_configure_channel(unsigned int chan, unsigned long flags);
>
> extern int register_dmac(struct dma_info *info);
> extern void unregister_dmac(struct dma_info *info);
> -extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
> -
> -extern int dma_extend(unsigned int chan, unsigned long op, void *param);
> -extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
>
> /* arch/sh/drivers/dma/dma-sysfs.c */
> extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);
I assume we could re-add these again in case we need them, but it would be good
if Yoshinori could comment on whether we should keep these functions or not.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
next prev parent reply other threads:[~2024-05-01 9:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 21:02 [PATCH 00/20] sh: Fix missing prototypes Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 01/20] sh: pgtable: " Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 02/20] sh: fpu: Add missing forward declarations Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 03/20] sh: syscall: Add missing forward declaration for sys_cacheflush() Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 04/20] sh: tlb: Add missing forward declaration for handle_tlbmiss() Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 05/20] sh: return_address: Add missing #include <asm/ftrace.h> Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 06/20] sh: traps: Add missing #include <asm/setup.h> Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 07/20] sh: hw_breakpoint: Add missing forward declaration for arch_bp_generic_fields() Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 08/20] sh: boot: Add proper forward declarations Geert Uytterhoeven
2024-03-05 6:56 ` Yoshinori Sato
2024-03-01 21:02 ` [PATCH 09/20] sh: ftrace: Fix missing prototypes Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 10/20] sh: nommu: Add missing #include <asm/cacheflush.h> Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 11/20] sh: math-emu: Add missing #include <asm/fpu.h> Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 12/20] sh: dma: Remove unused dmac_search_free_channel() Geert Uytterhoeven
2024-05-01 9:09 ` John Paul Adrian Glaubitz
2024-05-02 7:00 ` Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 13/20] sh: sh2a: Add missing #include <asm/processor.h> Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 14/20] sh: sh7786: Remove unused sh7786_usb_use_exclock() Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 15/20] sh: smp: Fix missing prototypes Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 16/20] sh: kprobes: Merge arch_copy_kprobe() into arch_prepare_kprobe() Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 17/20] sh: kprobes: Make trampoline_probe_handler() static Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 18/20] sh: kprobes: Remove unneeded kprobe_opcode_t casts Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 19/20] sh: dwarf: Make dwarf_lookup_fde() static Geert Uytterhoeven
2024-03-01 21:02 ` [PATCH 20/20] [RFC] sh: dma: Remove unused functionality Geert Uytterhoeven
2024-05-01 9:12 ` John Paul Adrian Glaubitz [this message]
2024-05-01 13:58 ` John Paul Adrian Glaubitz
2024-05-02 7:03 ` Geert Uytterhoeven
2024-05-02 7:08 ` John Paul Adrian Glaubitz
2024-05-01 9:14 ` [PATCH 00/20] sh: Fix missing prototypes John Paul Adrian Glaubitz
2024-05-02 10:26 ` John Paul Adrian Glaubitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f302ebb109fb0528a7de4f552e78ee0dd9595c0.camel@physik.fu-berlin.de \
--to=glaubitz@physik.fu-berlin.de \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=dalias@libc.org \
--cc=geert+renesas@glider.be \
--cc=linux-sh@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=will@kernel.org \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).