Skip to contentSkip to conversation

ALSA: core: Remove unused copy_from_user_toio

PATCH In review [email protected] 2 participants 3 messages Oct 10, 2024 – Oct 11, 2024 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: core: Remove unused copy_from_user_toio

From: "Dr. David Alan Gilbert" <[email protected]>

copy_from_user_toio() has been unused since commit ce2d8ed8d809 ("ASoC: qcom: Convert to generic PCM copy ops")

Remove it.

---
 include/sound/core.h |  1 -
 sound/core/memory.c  | 20 --------------------
 2 files changed, 21 deletions(-)
include/sound/core.h +0 -1
index 1f3f5dccd736..b5a6f3d2bff5 100644
@@ -267,7 +267,6 @@ static inline int snd_minor_info_oss_init(void) { return 0; }
 /* memory.c */
 
 int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count);
-int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count);
 
 /* init.c */
 
sound/core/memory.c +0 -20
index 2d2d0094c897..8222a851da87 100644
@@ -63,26 +63,6 @@ int copy_to_iter_fromio(struct iov_iter *dst, const void __iomem *src,
 }
 EXPORT_SYMBOL(copy_to_iter_fromio);
 
-/**
- * copy_from_user_toio - copy data from user-space to mmio-space
- * @dst: the destination pointer on mmio-space
- * @src: the source pointer on user-space
- * @count: the data size to copy in bytes
- *
- * Copies the data from user-space to mmio-space.
- *
- * Return: Zero if successful, or non-zero on failure.
- */
-int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count)
-{
-	struct iov_iter iter;
-
-	if (import_ubuf(ITER_SOURCE, (void __user *)src, count, &iter))
-		return -EFAULT;
-	return copy_from_iter_toio((void __iomem *)dst, &iter, count);
-}
-EXPORT_SYMBOL(copy_from_user_toio);
-
 /**
  * copy_from_iter_toio - copy data from iov_iter to mmio-space
  * @dst: the destination pointer on mmio-space
Signature · 1 line
2.47.0
#1 lore raw
Quoted 7 lines · On Thu, 10 Oct 2024 22:53:40 +0200, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

copy_from_user_toio() has been unused since commit ce2d8ed8d809 ("ASoC: qcom: Convert to generic PCM copy ops")

Remove it.

It's a pair of copy_to_*(), so if any, it should be dropped only after both users are gone.

thanks,

Takashi

Quoted 53 lines
---
 include/sound/core.h |  1 -
 sound/core/memory.c  | 20 --------------------
 2 files changed, 21 deletions(-)
include/sound/core.h +0 -1
index 1f3f5dccd736..b5a6f3d2bff5 100644
@@ -267,7 +267,6 @@ static inline int snd_minor_info_oss_init(void) { return 0; }
 /* memory.c */
 
 int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count);
-int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count);
 
 /* init.c */
 
sound/core/memory.c +0 -20
index 2d2d0094c897..8222a851da87 100644
@@ -63,26 +63,6 @@ int copy_to_iter_fromio(struct iov_iter *dst, const void __iomem *src,
 }
 EXPORT_SYMBOL(copy_to_iter_fromio);
 
-/**
- * copy_from_user_toio - copy data from user-space to mmio-space
- * @dst: the destination pointer on mmio-space
- * @src: the source pointer on user-space
- * @count: the data size to copy in bytes
- *
- * Copies the data from user-space to mmio-space.
- *
- * Return: Zero if successful, or non-zero on failure.
- */
-int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count)
-{
-	struct iov_iter iter;
-
-	if (import_ubuf(ITER_SOURCE, (void __user *)src, count, &iter))
-		return -EFAULT;
-	return copy_from_iter_toio((void __iomem *)dst, &iter, count);
-}
-EXPORT_SYMBOL(copy_from_user_toio);
-
 /**
  * copy_from_iter_toio - copy data from iov_iter to mmio-space
  * @dst: the destination pointer on mmio-space
Signature · 1 line
2.47.0
#2 lore raw
Quoted 5 lines · * Takashi Iwai ([email protected]) wrote:
Quoted 3 lines · On Thu, 10 Oct 2024 22:53:40 +0200, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

Quoted 7 lines
Quoted 4 lines

copy_from_user_toio() has been unused since commit ce2d8ed8d809 ("ASoC: qcom: Convert to generic PCM copy ops")

Remove it.

It's a pair of copy_to_*(), so if any, it should be dropped only after both users are gone.

OK, fair enough.

Dave

Quoted 59 lines

thanks,

Takashi

Quoted 53 lines
---
 include/sound/core.h |  1 -
 sound/core/memory.c  | 20 --------------------
 2 files changed, 21 deletions(-)
include/sound/core.h +0 -1
index 1f3f5dccd736..b5a6f3d2bff5 100644
@@ -267,7 +267,6 @@ static inline int snd_minor_info_oss_init(void) { return 0; }
 /* memory.c */
 
 int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count);
-int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count);
 
 /* init.c */
 
sound/core/memory.c +0 -20
index 2d2d0094c897..8222a851da87 100644
@@ -63,26 +63,6 @@ int copy_to_iter_fromio(struct iov_iter *dst, const void __iomem *src,
 }
 EXPORT_SYMBOL(copy_to_iter_fromio);
 
-/**
- * copy_from_user_toio - copy data from user-space to mmio-space
- * @dst: the destination pointer on mmio-space
- * @src: the source pointer on user-space
- * @count: the data size to copy in bytes
- *
- * Copies the data from user-space to mmio-space.
- *
- * Return: Zero if successful, or non-zero on failure.
- */
-int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count)
-{
-	struct iov_iter iter;
-
-	if (import_ubuf(ITER_SOURCE, (void __user *)src, count, &iter))
-		return -EFAULT;
-	return copy_from_iter_toio((void __iomem *)dst, &iter, count);
-}
-EXPORT_SYMBOL(copy_from_user_toio);
-
 /**
  * copy_from_iter_toio - copy data from iov_iter to mmio-space
  * @dst: the destination pointer on mmio-space
Signature · 1 line
2.47.0
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/