Re: [Qemu-devel] [patch] firmware: qemu_fw_cfg.c: potential unintialized variable

2016-04-14 Thread Dan Carpenter
Ah... I see now. You're right. Thanks for the explanation. On my config those functions are no-ops so the variable isn't initialized. If they were enabled then *probably* it wouldn't generate a warning. Probably just silencing the warning is the way to go though... I bet GCC optimizes it awa

Re: [Qemu-devel] [patch] firmware: qemu_fw_cfg.c: potential unintialized variable

2016-04-14 Thread Gabriel L. Somlo
On Thu, Apr 14, 2016 at 12:33:37PM +0300, Dan Carpenter wrote: > It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't > initialized, which, if you got very unlucky, could cause a bug. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/fi

Re: [Qemu-devel] [patch] firmware: qemu_fw_cfg.c: potential unintialized variable

2016-04-14 Thread Gabriel L. Somlo
On Thu, Apr 14, 2016 at 10:12:53PM +0300, Dan Carpenter wrote: > On Thu, Apr 14, 2016 at 02:40:06PM -0400, Gabriel L. Somlo wrote: > > On Thu, Apr 14, 2016 at 12:33:37PM +0300, Dan Carpenter wrote: > > > It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't > > ^

Re: [Qemu-devel] [patch] firmware: qemu_fw_cfg.c: potential unintialized variable

2016-04-14 Thread Dan Carpenter
On Thu, Apr 14, 2016 at 02:40:06PM -0400, Gabriel L. Somlo wrote: > On Thu, Apr 14, 2016 at 12:33:37PM +0300, Dan Carpenter wrote: > > It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't > ^ ^ > Ifreturns > > > initi

Re: [Qemu-devel] [patch] firmware: qemu_fw_cfg.c: potential unintialized variable

2016-04-14 Thread Gabriel L. Somlo
On Thu, Apr 14, 2016 at 12:33:37PM +0300, Dan Carpenter wrote: > It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't ^ ^ Ifreturns > initialized, which, if you got very unlucky, could cause a bug. In principle I'm

[Qemu-devel] [patch] firmware: qemu_fw_cfg.c: potential unintialized variable

2016-04-14 Thread Dan Carpenter
It acpi_acquire_global_lock() return AE_NOT_CONFIGURED then "glk" isn't initialized, which, if you got very unlucky, could cause a bug. Signed-off-by: Dan Carpenter diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index d999fe3..0e20116 100644 --- a/drivers/firmware/q