Skip to content

Commit

Permalink
uml: audio: fix -Wmissing-variable-declarations
Browse files Browse the repository at this point in the history
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 <[email protected]>
Closes: https://lore.kernel.org/llvm/[email protected]/
Signed-off-by: Nick Desaulniers <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
nickdesaulniers authored and richardweinberger committed Aug 26, 2023
1 parent e30955d commit b10eee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/um/drivers/hostaudio_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b10eee7

Please sign in to comment.