Skip to contentSkip to conversation

linux-next: build warning after merge of the drivers-x86 tree

DISCUSSION Stephen Rothwell 2 participants 5 messages Dec 14, 2016 – Dec 15, 2016 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Darren,

After merging the drivers-x86 tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
drivers/platform/x86/thinkpad_acpi.c: In function 'hotkey_init':
include/linux/printk.h:299:2: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3147:8: note: 'type' was declared here

  char *type;
        ^

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
include/linux/printk.h:299:2: warning: 'in_tablet_mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3146:6: note: 'in_tablet_mode' was declared here

  int in_tablet_mode, res;
      ^

Introduced by commit

b31800283868 ("platform/x86: thinkpad_acpi: Move tablet detection into separate function")

I can't tell if this is a false positive or not.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 20 lines · Stephen Rothwell

Hi Darren,

After merging the drivers-x86 tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
drivers/platform/x86/thinkpad_acpi.c: In function 'hotkey_init':
include/linux/printk.h:299:2: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3147:8: note: 'type' was declared here

  char *type;
        ^

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
include/linux/printk.h:299:2: warning: 'in_tablet_mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3146:6: note: 'in_tablet_mode' was declared here

Quoted 8 lines
  int in_tablet_mode, res;
      ^

Introduced by commit

b31800283868 ("platform/x86: thinkpad_acpi: Move tablet detection into separate function")

I can't tell if this is a false positive or not.

That's an uninitialized local variable. Not sure how I missed that. I'll fix it up today. Thank you for the report.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#2 lore raw
Quoted 24 lines · Darren Hart
Quoted 23 lines · Stephen Rothwell

Hi Darren,

After merging the drivers-x86 tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
drivers/platform/x86/thinkpad_acpi.c: In function 'hotkey_init':
include/linux/printk.h:299:2: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3147:8: note: 'type' was declared here

  char *type;
        ^

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
include/linux/printk.h:299:2: warning: 'in_tablet_mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3146:6: note: 'in_tablet_mode' was declared here

  int in_tablet_mode, res;
      ^
Quoted 8 lines
Quoted 5 lines

Introduced by commit

b31800283868 ("platform/x86: thinkpad_acpi: Move tablet detection into separate function")

I can't tell if this is a false positive or not.

That's an uninitialized local variable. Not sure how I missed that. I'll fix it up today. Thank you for the report.

OK, no, it's a false positive because tp_features.hotkey_tablet is assigned in both places where in_tablet_mode is assigned, and if the former is 0 (global scope), the function returns without calling pr_info.

Lyude, Henrique, please confirm.

Regardless, I'll add a patch to init in_tablet_mode to 0 so it is explicit - but will not rebase as it isn't technically an error.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#3 lore raw

Hi Darren,

Quoted 29 lines · On Wed, 14 Dec 2016 14:59:14 -0800 Darren Hart <[email protected]> wrote:
Quoted 27 lines · Darren Hart
Quoted 26 lines · Stephen Rothwell

After merging the drivers-x86 tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
drivers/platform/x86/thinkpad_acpi.c: In function 'hotkey_init':
include/linux/printk.h:299:2: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3147:8: note: 'type' was declared here

  char *type;
        ^

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
include/linux/printk.h:299:2: warning: 'in_tablet_mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3146:6: note: 'in_tablet_mode' was declared here

  int in_tablet_mode, res;
      ^

Introduced by commit

b31800283868 ("platform/x86: thinkpad_acpi: Move tablet detection into separate function")

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I can't tell if this is a false positive or not.

That's an uninitialized local variable. Not sure how I missed that. I'll fix it up today. Thank you for the report.

OK, no, it's a false positive because tp_features.hotkey_tablet is assigned in both places where in_tablet_mode is assigned, and if the former is 0 (global scope), the function returns without calling pr_info.

How about "type".

Quoted 4 lines

Lyude, Henrique, please confirm.

Regardless, I'll add a patch to init in_tablet_mode to 0 so it is explicit - but will not rebase as it isn't technically an error.

No problem, it is only a warning after all.

Signature · 2 lines
Cheers,
Stephen Rothwell
#4 lore raw
Quoted 34 lines · Stephen Rothwell

Hi Darren,

Quoted 31 lines · On Wed, 14 Dec 2016 14:59:14 -0800 Darren Hart <[email protected]> wrote:
Quoted 29 lines · Darren Hart
Quoted 27 lines · Stephen Rothwell

After merging the drivers-x86 tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
drivers/platform/x86/thinkpad_acpi.c: In function 'hotkey_init':
include/linux/printk.h:299:2: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3147:8: note: 'type' was declared here

  char *type;
        ^

In file included from include/linux/kernel.h:13:0,
from drivers/platform/x86/thinkpad_acpi.c:52:
include/linux/printk.h:299:2: warning: 'in_tablet_mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/platform/x86/thinkpad_acpi.c:3146:6: note: 'in_tablet_mode' was declared here

  int in_tablet_mode, res;
      ^

Introduced by commit

b31800283868 ("platform/x86: thinkpad_acpi: Move tablet detection into separate function")

I can't tell if this is a false positive or not.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

That's an uninitialized local variable. Not sure how I missed that. I'll fix it up today. Thank you for the report.

OK, no, it's a false positive because tp_features.hotkey_tablet is assigned in both places where in_tablet_mode is assigned, and if the former is 0 (global scope), the function returns without calling pr_info.

How about "type".

Ooops, indeed. Same exact issue. I'll update the patch.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center