mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] uml: audio: fix -Wmissing-variable-declarations
@ 2023-08-08 17:21 Nick Desaulniers
  2023-08-08 17:22 ` Nick Desaulniers
  0 siblings, 1 reply; 2+ messages in thread
From: Nick Desaulniers @ 2023-08-08 17:21 UTC (permalink / raw)
  To: Richard Weinberger, Anton Ivanov, Johannes Berg
  Cc: Nathan Chancellor, Tom Rix, linux-um, linux-kernel, llvm,
	kernel test robot, Nick Desaulniers

I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day
bot spotted the following instance:

  arch/um/drivers/hostaudio_kern.c:316:3: warning: no previous extern
  declaration for non-static variable 'module_data'
  [-Wmissing-variable-declarations]
  } module_data;
    ^
  arch/um/drivers/hostaudio_kern.c:313:1: note: declare 'static' if the
  variable is not intended to be used outside of this translation unit
  struct {
  ^

This symbol is not referenced by more than one translation unit, so give
it static storage.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/um/drivers/hostaudio_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index 5b064d360cb7..c42b793bce65 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -310,7 +310,7 @@ static const struct file_operations hostmixer_fops = {
 	.release        = hostmixer_release,
 };
 
-struct {
+static struct {
 	int dev_audio;
 	int dev_mixer;
 } module_data;

---
base-commit: 14f9643dc90adea074a0ffb7a17d337eafc6a5cc
change-id: 20230808-um_hostaudio-21d7207deaed

Best regards,
-- 
Nick Desaulniers <ndesaulniers@google.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] uml: audio: fix -Wmissing-variable-declarations
  2023-08-08 17:21 [PATCH] uml: audio: fix -Wmissing-variable-declarations Nick Desaulniers
@ 2023-08-08 17:22 ` Nick Desaulniers
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2023-08-08 17:22 UTC (permalink / raw)
  To: Richard Weinberger, Anton Ivanov, Johannes Berg
  Cc: Nathan Chancellor, Tom Rix, linux-um, linux-kernel, llvm,
	kernel test robot

On Tue, Aug 8, 2023 at 10:21 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day
> bot spotted the following instance:
>
>   arch/um/drivers/hostaudio_kern.c:316:3: warning: no previous extern
>   declaration for non-static variable 'module_data'
>   [-Wmissing-variable-declarations]
>   } module_data;
>     ^
>   arch/um/drivers/hostaudio_kern.c:313:1: note: declare 'static' if the
>   variable is not intended to be used outside of this translation unit
>   struct {
>   ^
>
> This symbol is not referenced by more than one translation unit, so give
> it static storage.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/llvm/202308081000.tTL1ElTr-lkp@intel.com/

^ D'oh, wrong report, this should be
https://lore.kernel.org/llvm/202308081050.sZEw4cQ5-lkp@intel.com/
Resending.

> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
>  arch/um/drivers/hostaudio_kern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
> index 5b064d360cb7..c42b793bce65 100644
> --- a/arch/um/drivers/hostaudio_kern.c
> +++ b/arch/um/drivers/hostaudio_kern.c
> @@ -310,7 +310,7 @@ static const struct file_operations hostmixer_fops = {
>         .release        = hostmixer_release,
>  };
>
> -struct {
> +static struct {
>         int dev_audio;
>         int dev_mixer;
>  } module_data;
>
> ---
> base-commit: 14f9643dc90adea074a0ffb7a17d337eafc6a5cc
> change-id: 20230808-um_hostaudio-21d7207deaed
>
> Best regards,
> --
> Nick Desaulniers <ndesaulniers@google.com>
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-08 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08 17:21 [PATCH] uml: audio: fix -Wmissing-variable-declarations Nick Desaulniers
2023-08-08 17:22 ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®