diff mbox series

[3/3] mm: vmalloc: mark zero_iter() static

Message ID 20230323115903.1483668-3-arnd@kernel.org (mailing list archive)
State New
Headers show
Series [1/3] mm/mmap/vma_merge: actually set next to NULL if not applicable | expand

Commit Message

Arnd Bergmann March 23, 2023, 11:58 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

The zero_iter() function was put into the global namespace,
apparently by accident:

mm/vmalloc.c:3448:8: error: no previous prototype for function 'zero_iter' [-Werror,-Wmissing-prototypes]
size_t zero_iter(struct iov_iter *iter, size_t count)
       ^
mm/vmalloc.c:3448:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
size_t zero_iter(struct iov_iter *iter, size_t count)
^

Fixes: d9cab54f7737 ("mm: vmalloc: convert vread() to vread_iter()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lorenzo Stoakes March 23, 2023, 12:06 p.m. UTC | #1
On Thu, Mar 23, 2023 at 12:58:36PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The zero_iter() function was put into the global namespace,
> apparently by accident:
>
> mm/vmalloc.c:3448:8: error: no previous prototype for function 'zero_iter' [-Werror,-Wmissing-prototypes]
> size_t zero_iter(struct iov_iter *iter, size_t count)
>        ^
> mm/vmalloc.c:3448:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> size_t zero_iter(struct iov_iter *iter, size_t count)
> ^
>
> Fixes: d9cab54f7737 ("mm: vmalloc: convert vread() to vread_iter()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  mm/vmalloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index fb216495fe5a..55f5d6fc8629 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -3445,7 +3445,7 @@ EXPORT_SYMBOL(vmalloc_32_user);
>   *
>   * Returns the number of zeroed bytes.
>   */
> -size_t zero_iter(struct iov_iter *iter, size_t count)
> +static size_t zero_iter(struct iov_iter *iter, size_t count)
>  {
>  	size_t remains = count;
>
> --
> 2.39.2
>
>

And finally, this was also fixed in the latest version (v8) see
https://lore.kernel.org/all/cover.1679566220.git.lstoakes@gmail.com

Again do forgive the noise! :)
diff mbox series

Patch

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index fb216495fe5a..55f5d6fc8629 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3445,7 +3445,7 @@  EXPORT_SYMBOL(vmalloc_32_user);
  *
  * Returns the number of zeroed bytes.
  */
-size_t zero_iter(struct iov_iter *iter, size_t count)
+static size_t zero_iter(struct iov_iter *iter, size_t count)
 {
 	size_t remains = count;