fbmem: Correct position of '__maybe_unused' in proc_fb_seq_ops
Subsystems (2)
PATCH 1/1 fbmem: Correct position of '__maybe_unused' in proc_fb_seq_ops
Clang warns:
drivers/video/fbdev/core/fbmem.c:736:21: warning: attribute declaration must precede definition [-Wignored-attributes]
static const struct __maybe_unused seq_operations proc_fb_seq_ops = {
^
./include/linux/compiler_attributes.h:273:56: note: expanded from macro
'__maybe_unused'
#define __maybe_unused __attribute__((__unused__))
^
./include/linux/seq_file.h:31:8: note: previous definition is here
struct seq_operations {
^1 warning generated.
The attribute should not split the type 'struct seq_operations'. Move it before the struct keyword so that it works properly and there is no more warning.
--- drivers/video/fbdev/core/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/fbmem.c +1 -1
@@ -733,7 +733,7 @@ static int fb_seq_show(struct seq_file *m, void *v)return 0 ; } -static const struct __maybe_unused seq_operations proc_fb_seq_ops = { +static const __maybe_unused struct seq_operations proc_fb_seq_ops = { .start = fb_seq_start, .next = fb_seq_next, .stop = fb_seq_stop,
base-commit: b9d79e4ca4ff23543d6b33c736ba07c1f0a9dcb1
Signature · 6 lines
2.31.1.362.g311531c9de _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 13 lines · Nathan Chancellor
Clang warns:
drivers/video/fbdev/core/fbmem.c:736:21: warning: attribute declaration must precede definition [-Wignored-attributes]static const struct __maybe_unused seq_operations proc_fb_seq_ops = { ^ ./include/linux/compiler_attributes.h:273:56: note: expanded from macro '__maybe_unused' #define __maybe_unused __attribute__((__unused__)) ^ ./include/linux/seq_file.h:31:8: note: previous definition is here struct seq_operations { ^
Quoted 6 lines
1 warning generated.
The attribute should not split the type 'struct
seq_operations'. Move it before the struct keyword so that it works properly and there is no more warning.
Oops, sorry.
Guenter
Quoted 26 lines
Fixes b9d79e4ca4ff ("fbmem: Mark proc_fb_seq_ops as __maybe_unused")Reported-by kernel test robot <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>--- drivers/video/fbdev/core/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/video/fbdev/core/fbmem.c +1
-1@@ -733,7 +733,7 @@ static int fb_seq_show(struct seq_file *m, void *v)return 0 ; } -static const struct __maybe_unused seq_operations proc_fb_seq_ops = { +static const __maybe_unused struct seq_operations proc_fb_seq_ops = { .start = fb_seq_start, .next = fb_seq_next, .stop = fb_seq_stop,base-commit:
b9d79e4ca4ff23543d6b33c736ba07c1f0a9dcb1Signature · 1 line
2.31.1.362.g311531c9de