IPMI: Some minor fixes
Subsystems (117)
Remove some bogus docs, Fix ACPI/IPMI interactions, fix some warnings, and add register spacing detection for PCI interfaces.
PATCH 1/5 IPMI: Remove SMBus driver info from the docs
From: Corey Minyard <[email protected]>
Some documentation for the SMBus driver is in the IPMI docs, but that code is not in the kernel tree at this point. So remove the docs to avoid confusion.
--- Documentation/IPMI.txt | 65 ++--------------------------------------------- 1 files changed, 3 insertions(+), 62 deletions(-)
Documentation/IPMI.txt +3 -62
@@ -42,13 +42,7 @@ The driver interface depends on your hardware. If your system properly provides the SMBIOS info for IPMI, the driver will detect it and just work. If you have a board with a standard interface (These will generally be either "KCS", "SMIC", or "BT", consult your hardware -manual), choose the 'IPMI SI handler' option. A driver also exists -for direct I2C access to the IPMI management controller. Some boards -support this, but it is unknown if it will work on every board. For -this, choose 'IPMI SMBus handler', but be ready to try to do some -figuring to see if it will work on your system if the SMBIOS/APCI -information is wrong or not present. It is fairly safe to have both -these enabled and let the drivers auto-detect what is present. +manual), choose the 'IPMI SI handler' option. You should generally enable ACPI on your system, as systems with IPMI can have ACPI tables describing them.
@@ -58,8 +52,7 @@ their job correctly, the IPMI controller should be automatically detected (via ACPI or SMBIOS tables) and should just work. Sadly, many boards do not have this information. The driver attempts standard defaults, but they may not work. If you fall into this -situation, you need to read the section below named 'The SI Driver' or -"The SMBus Driver" on how to hand-configure your system. +situation, you need to read the section below named 'The SI Driver'. IPMI defines a standard watchdog timer. You can enable this with the 'IPMI Watchdog Timer' config option. If you compile the driver into
@@ -104,12 +97,7 @@ driver, each open file for this device ties in to the message handler as an IPMI user. ipmi_si - A driver for various system interfaces. This supports KCS, -SMIC, and BT interfaces. Unless you have an SMBus interface or your -own custom interface, you probably need to use this. - -ipmi_smb - A driver for accessing BMCs on the SMBus. It uses the -I2C kernel driver's SMBus interfaces to send and receive IPMI messages -over the SMBus. +SMIC, and BT interfaces. ipmi_watchdog - IPMI requires systems to have a very capable watchdog timer. This driver implements the standard Linux watchdog timer
@@ -482,53 +470,6 @@ for specifying an interface. Note that when removing an interface, only the first three parameters (si type, address type, and address) are used for the comparison. Any options are ignored for removing. -The SMBus Driver ----------------- - -The SMBus driver allows up to 4 SMBus devices to be configured in the -system. By default, the driver will register any SMBus interfaces it finds -in the I2C address range of 0x20 to 0x4f on any adapter. You can change this -at module load time (for a module) with: - - modprobe ipmi_smb.o - addr=<adapter1>,<i2caddr1>[,<adapter2>,<i2caddr2>[,...]] - dbg=<flags1>,<flags2>... - [defaultprobe=1] [dbg_probe=1] - -The addresses are specified in pairs, the first is the adapter ID and the -second is the I2C address on that adapter. - -The debug flags are bit flags for each BMC found, they are: -IPMI messages: 1, driver state: 2, timing: 4, I2C probe: 8 - -Setting smb_defaultprobe to zero disabled the default probing of SMBus -interfaces at address range 0x20 to 0x4f. This means that only the -BMCs specified on the smb_addr line will be detected. - -Setting smb_dbg_probe to 1 will enable debugging of the probing and -detection process for BMCs on the SMBusses. - -Discovering the IPMI compliant BMC on the SMBus can cause devices -on the I2C bus to fail. The SMBus driver writes a "Get Device ID" IPMI -message as a block write to the I2C bus and waits for a response. -This action can be detrimental to some I2C devices. It is highly recommended -that the known I2c address be given to the SMBus driver in the smb_addr -parameter. The default address range will not be used when a smb_addr -parameter is provided. - -When compiled into the kernel, the addresses can be specified on the -kernel command line as: - - ipmb_smb.addr=<adapter1>,<i2caddr1>[,<adapter2>,<i2caddr2>[,...]] - ipmi_smb.dbg=<flags1>,<flags2>... - ipmi_smb.defaultprobe=0 ipmi_smb.dbg_probe=1 - -These are the same options as on the module command line. - -Note that you might need some I2C changes if CONFIG_IPMI_PANIC_EVENT -is enabled along with this, so the I2C driver knows to run to -completion during sending a panic event. - Other Pieces ------------
Signature · 1 line
1.7.4.1
PATCH 2/5 ACPI: Reorder IPMI driver before any other ACPI drivers
In reply to [email protected]From: Matthew Garrett <[email protected]>
Drivers may make calls that require the ACPI IPMI driver to have been initialised already, so make sure that it appears earlier in the build order.
--- drivers/acpi/Makefile | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/acpi/Makefile +4 -1
@@ -47,6 +47,10 @@ acpi-y += video_detect.o endif # These are (potentially) separate modules + +# IPMI may be used by other drivers, so it has to initialise before them +obj-$(CONFIG_ACPI_IPMI) += acpi_ipmi.o + obj-$(CONFIG_ACPI_AC) += ac.o obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_FAN) += fan.o
@@ -70,6 +74,5 @@ processor-y += processor_idle.o processor_thermal.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o -obj-$(CONFIG_ACPI_IPMI) += acpi_ipmi.o obj-$(CONFIG_ACPI_APEI) += apei/
Signature · 1 line
1.7.4.1
Andrew Morton
maintainerRe: [PATCH 2/5] ACPI: Reorder IPMI driver before any other ACPI drivers
Quoted 23 lines · On Tue, 16 Oct 2012 15:53:37 -0500 [email protected] wrote:
From: Matthew Garrett <[email protected]>
Drivers may make calls that require the ACPI IPMI driver to have been initialised already, so make sure that it appears earlier in the build order.
...
index 47199e2..82422fe 100644
drivers/acpi/Makefile +4
-0@@ -47,6 +47,10 @@ acpi-y += video_detect.o endif # These are (potentially) separate modules + +# IPMI may be used by other drivers, so it has to initialise before them +obj-$(CONFIG_ACPI_IPMI) += acpi_ipmi.o + obj-$(CONFIG_ACPI_AC) += ac.o obj-$(CONFIG_ACPI_BUTTON) += button.o obj-$(CONFIG_ACPI_FAN) += fan.o
drivers/acpi/Makefile processor-y += processor_idle.o processor_thermal.o · line 78
Quoted 6 lines
drivers/acpi/Makefile +0
-1@@ -70,6 +74,5 @@ processor-y += processor_idle.o processor_thermal.o processor-$(CONFIG_CPU_FREQ) += processor_perflib.o obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o -obj-$(CONFIG_ACPI_IPMI) += acpi_ipmi.o obj-$(CONFIG_ACPI_APEI) += apei/
Relying upon link ordering is the old-fashioned way of doing things, and I have vague memories that it only works by luck - that there's no hard-and-fast rule that the linker has to obey what we think we asked it to do.
The usual way of doing this sort of thing is to use the initcall priority levels - core_initcall(), postcore_initcall(), etc. Can that be done here?
Re: [PATCH 2/5] ACPI: Reorder IPMI driver before any other ACPI drivers
Quoted 8 lines · Andrew Morton
Relying upon link ordering is the old-fashioned way of doing things, and I have vague memories that it only works by luck - that there's no hard-and-fast rule that the linker has to obey what we think we asked it to do.
The usual way of doing this sort of thing is to use the initcall priority levels -
core_initcall(),postcore_initcall(), etc. Can that be done here?
Not really - some of this code can be built as modules, so it's mostly module_init rather than anything from the initcall family.
Signature · 1 line
Matthew Garrett | [email protected]
Andrew Morton
maintainerRe: [PATCH 2/5] ACPI: Reorder IPMI driver before any other ACPI drivers
Quoted 7 lines · On Tue, 23 Oct 2012 01:00:34 +0100 Matthew Garrett <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Relying upon link ordering is the old-fashioned way of doing things, and I have vague memories that it only works by luck - that there's no hard-and-fast rule that the linker has to obey what we think we asked it to do.
Quoted 7 lines
Quoted 3 lines
The usual way of doing this sort of thing is to use the initcall priority levels -
core_initcall(),postcore_initcall(), etc. Can that be done here?Not really - some of this code can be built as modules, so it's mostly
module_initrather than anything from the initcall family.
hm. So the ACPI code has found a way to defeat depmod?
Re: [PATCH 2/5] ACPI: Reorder IPMI driver before any other ACPI drivers
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue, 23 Oct 2012 01:00:34 +0100 Matthew Garrett <[email protected]> wrote:
Not really - some of this code can be built as modules, so it's mostly
module_initrather than anything from the initcall family.hm. So the ACPI code has found a way to defeat depmod?
We don't express dependencies between available operation regions and the code that supports them. Most are set up in the core ACPI code and so the problem is avoided, but the IPMI code is a separate chunk.
Signature · 1 line
Matthew Garrett | [email protected]
PATCH 3/5 IPMI: Change link order
In reply to [email protected]From: Matthew Garrett <[email protected]>
IPMI must be initialised before ACPI in order to ensure that any IPMI services are available before ACPI driver initialisation attempts to use any IPMI operation regions.
--- drivers/Makefile | 4 ++++ drivers/char/Makefile | 1 - 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/Makefile +4 -0
@@ -17,6 +17,10 @@ obj-$(CONFIG_PARISC) += parisc/ obj-$(CONFIG_RAPIDIO) += rapidio/ obj-y += video/ obj-y += idle/ + +# IPMI must come before ACPI in order to provide IPMI opregion support +obj-$(CONFIG_IPMI_HANDLER) += char/ipmi/ + obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_SFI) += sfi/ # PnP must come after ACPI since it will eventually need to check if acpi
drivers/char/Makefile +0 -1
@@ -52,7 +52,6 @@ obj-$(CONFIG_TELCLOCK) += tlclk.o obj-$(CONFIG_MWAVE) += mwave/ obj-$(CONFIG_AGP) += agp/ obj-$(CONFIG_PCMCIA) += pcmcia/ -obj-$(CONFIG_IPMI_HANDLER) += ipmi/ obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o obj-$(CONFIG_TCG_TPM) += tpm/
Signature · 1 line
1.7.4.1
PATCH 4/5 IPMI: Fix some uninitialized warning
In reply to [email protected]From: Corey Minyard <[email protected]>
There was a spot where the compiler couldn't tell some variables would be set. So initialize them to make the warning go away.
--- drivers/char/ipmi/ipmi_msghandler.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/ipmi/ipmi_msghandler.c +1 -1
@@ -1880,7 +1880,7 @@ int ipmi_request_supply_msgs(ipmi_user_t user, struct ipmi_recv_msg *supplied_recv, int priority) { -unsigned char saddr, lun; +unsigned char saddr =0 , lun =0 ;int rv;if (!user)
Signature · 1 line
1.7.4.1
Andrew Morton
maintainerRe: [PATCH 4/5] IPMI: Fix some uninitialized warning
Quoted 15 lines · On Tue, 16 Oct 2012 15:53:39 -0500 [email protected] wrote:
From: Corey Minyard <[email protected]>
There was a spot where the compiler couldn't tell some variables would be set. So initialize them to make the warning go away.
Signed-off-by Corey Minyard <[email protected]>--- drivers/char/ipmi/ipmi_msghandler.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/char/ipmi/ipmi_msghandler.c +0
-0
drivers/char/ipmi/ipmi_msghandler.c int ipmi_request_supply_msgs(ipmi_user_t user, · line 1886
Quoted 8 lines
drivers/char/ipmi/ipmi_msghandler.c +1
-1@@ -1880,7 +1880,7 @@ int ipmi_request_supply_msgs(ipmi_user_t user, struct ipmi_recv_msg *supplied_recv, int priority) { -unsigned char saddr, lun; +unsigned char saddr =0 , lun =0 ;int rv;if (!user)
The kernel build actually generates quite a lot of "bar uninitialised" warnings for foo(&bar) expressions. I just ignore them, because later versions of gcc stopped doing that.
The fix is OK, I suppose. But it will cause additional code to be emitted. Using uninitialized_var() avoids that, and makes things clearer to the reader.
Re: [PATCH 4/5] IPMI: Fix some uninitialized warning
Quoted 25 lines · Andrew Morton
Quoted 22 lines · On Tue, 16 Oct 2012 15:53:39 -0500 [email protected] wrote:
From: Corey Minyard <[email protected]>
There was a spot where the compiler couldn't tell some variables would be set. So initialize them to make the warning go away.
Signed-off-by Corey Minyard <[email protected]>--- drivers/char/ipmi/ipmi_msghandler.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/char/ipmi/ipmi_msghandler.c +1
-1@@ -1880,7 +1880,7 @@ int ipmi_request_supply_msgs(ipmi_user_t user, struct ipmi_recv_msg *supplied_recv, int priority) { -unsigned char saddr, lun; +unsigned char saddr =0 , lun =0 ;int rv;
Quoted 8 lines
drivers/char/ipmi/ipmi_msghandler.c int ipmi_request_supply_msgs(ipmi_user_t user, · line 1886
Quoted 1 line
drivers/char/ipmi/ipmi_msghandler.c +0
-0if (!user)The kernel build actually generates quite a lot of "bar uninitialised" warnings for
foo(&bar)expressions. I just ignore them, because later versions of gcc stopped doing that.The fix is OK, I suppose. But it will cause additional code to be emitted. Using
uninitialized_var()avoids that, and makes things clearer to the reader.
Well, warnings annoy me, especially when I get the emails about them. But I suppose that's the point of the emails :).
I'll do a patch to switch it to uninitialized_var() for the next set of things I send. Thanks.
-corey
Re: [PATCH 4/5] IPMI: Fix some uninitialized warning
Quoted 3 lines · Corey Minyard
I'll do a patch to switch it to
uninitialized_var()for the next set of things I send. Thanks.
Actually, I'm seriously considering getting rid of uninitialized_var().
The thing is an abomination, and we've already had one bug due to it (real uninitialized variable that was incorrectly hidden by uninitialized_var()).
The thing is moronic. The whole thing is almost entirely due to compiler bugs (*stupid* gcc behavior), and we would have been better off with an explicit (unnecessary) initialization that at least doesn't cause random crashes etc if it turns out to be wrong.
So please don't use that abortion. Just initialize things to 0/NULL/whatever if gcc complains and you want to get rid of them. Better than the crap that is uninitialized_var(), which just causes silent random behavior if it is wrong.
Linus
PATCH 1/1 Remove uninitialized_var()
Quoted 18 lines · Linus Torvalds
Quoted 3 lines · Corey Minyard
I'll do a patch to switch it to
uninitialized_var()for the next set of things I send. Thanks.Actually, I'm seriously considering getting rid of
uninitialized_var().The thing is an abomination, and we've already had one bug due to it (real uninitialized variable that was incorrectly hidden by
uninitialized_var()).The thing is moronic. The whole thing is almost entirely due to compiler bugs (*stupid* gcc behavior), and we would have been better off with an explicit (unnecessary) initialization that at least doesn't cause random crashes etc if it turns out to be wrong.
Quoted 4 lines
So please don't use that abortion. Just initialize things to 0/NULL/whatever if gcc complains and you want to get rid of them. Better than the crap that is
uninitialized_var(), which just causes silent random behavior if it is wrong.
Yes!
Also, often these warnings are coupled with unnecessarily high code flow complexity.
The = 0 initialization will make the code a bit slower (because if the compiler cannot see through data dependencies it cannot eliminate the initialization either) - so there's incentive to clean it up a bit and thus simplify the flow of control for the compiler to see whether a particular variable is used or not.
uninitialized_var() allows fast but complex code, and is inherently dangerous as well due to it shutting off useful compiler warnings.
[ uninitialized_var() is also bad due to its long name: it takes
up screen real estate and attracts the eye and thus gives a variable artificial 'importance' which it should not necessarily have. I have looked at uninitialized_var() lines hundreds of times already, just to be annoyed that it's nothing truly important. ]
So, the patch below (99% generated via a script, some done manually) removes uninitialized_var() and all of its uses, against your latest tree from today (e657e078d3df).
There's 3 types of conversions done:
uninitialized_var(x) => x = 0 /* for scalar types */
uninitialized_var(x) => x = NULL /* for pointers */
uninitialized_var(x) => x = { } /* for structures, unions */each picked depending on the context.
Testing:
154 of the .c changes build on x86 and were thus build tested under allyesconfig and are looking good (i.e. all except one builds warning-free), 13 changes won't build on x86 but look correct in review.
[ I also ran allyes/allno/def/modconfig builds and nothing broke
the build. There's one new warning on arch/x86/, it's harmless, we'll fix it separately via x86/urgent. ]
So it looks pretty safe to me and you might as well feel tempted by this patch, to eliminate this menace from the Linux kernel once and for all ;-)
Thanks,
Ingo
---------------->
arch/arm/mach-sa1100/assabet.c | 2 +- arch/ia64/kernel/process.c | 2 +- arch/ia64/mm/discontig.c | 2 +- arch/ia64/mm/tlb.c | 2 +- arch/ia64/sn/kernel/tiocx.c | 2 +- arch/ia64/sn/pci/pcibr/pcibr_provider.c | 2 +- arch/powerpc/kvm/book3s_pr.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch/powerpc/mm/numa.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 4 ++-- arch/s390/kernel/smp.c | 2 +- arch/s390/mm/pgtable.c | 4 ++-- arch/tile/include/asm/futex.h | 2 +- arch/x86/kernel/apic/es7000_32.c | 2 +- arch/x86/kernel/quirks.c | 10 +++++----- arch/x86/kvm/mmu.c | 2 +- arch/x86/kvm/paging_tmpl.h | 2 +- arch/x86/mm/numa.c | 2 +- arch/x86/xen/p2m.c | 8 ++++---- arch/xtensa/variants/s6000/delay.c | 4 ++-- drivers/acpi/acpi_pad.c | 2 +- drivers/acpi/acpica/tbutils.c | 2 +- drivers/ata/libata-scsi.c | 2 +- drivers/atm/zatm.c | 2 +- drivers/block/nvme.c | 2 +- drivers/char/mmtimer.c | 2 +- drivers/firewire/ohci.c | 14 +++++++------- drivers/gpu/drm/drm_edid.c | 2 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +- drivers/hid/uhid.c | 2 +- drivers/i2c/busses/i2c-mxs.c | 2 +- drivers/ide/ide-acpi.c | 2 +- drivers/ide/ide-atapi.c | 2 +- drivers/ide/ide-io-std.c | 4 ++-- drivers/ide/ide-io.c | 8 ++++---- drivers/ide/ide-sysfs.c | 2 +- drivers/ide/ide-taskfile.c | 2 +- drivers/ide/umc8672.c | 2 +- drivers/infiniband/core/uverbs_cmd.c | 6 +++--- drivers/infiniband/core/verbs.c | 4 ++-- drivers/infiniband/hw/cxgb3/iwch_qp.c | 2 +- drivers/infiniband/hw/mlx4/qp.c | 8 ++++---- drivers/infiniband/hw/mthca/mthca_qp.c | 10 +++++----- drivers/input/serio/serio_raw.c | 2 +- drivers/iommu/intel-iommu.c | 2 +- drivers/iommu/omap-iommu-debug.c | 2 +- drivers/iommu/tegra-smmu.c | 4 ++-- drivers/isdn/hardware/eicon/debug.c | 2 +- drivers/lguest/lguest_user.c | 2 +- drivers/md/dm-ioctl.c | 2 +- drivers/md/dm-snap-persistent.c | 2 +- drivers/md/dm-table.c | 8 ++++---- drivers/md/raid5.c | 2 +- drivers/media/dvb-frontends/af9013.c | 2 +- drivers/media/dvb-frontends/af9033.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/platform/omap3isp/ispqueue.c | 2 +- drivers/media/tuners/tda18212.c | 2 +- drivers/media/tuners/tda18218.c | 2 +- drivers/media/usb/dvb-usb-v2/af9015.c | 2 +- drivers/media/usb/dvb-usb/dib0700_core.c | 2 +- drivers/media/usb/gspca/vicam.c | 2 +- drivers/media/usb/uvc/uvc_video.c | 8 ++++---- drivers/memstick/host/jmb38x_ms.c | 2 +- drivers/memstick/host/tifm_ms.c | 2 +- drivers/mmc/host/sdhci.c | 4 ++-- drivers/mtd/nand/nand_ecc.c | 2 +- drivers/mtd/nand/s3c2410.c | 2 +- drivers/mtd/ubi/attach.c | 2 +- drivers/mtd/ubi/eba.c | 2 +- drivers/mtd/ubi/wl.c | 2 +- drivers/net/dsa/mv88e6060.c | 2 +- drivers/net/dsa/mv88e6xxx.c | 2 +- drivers/net/ethernet/broadcom/bnx2.c | 4 ++-- drivers/net/ethernet/neterion/s2io.c | 2 +- drivers/net/ethernet/qlogic/qla3xxx.c | 2 +- drivers/net/ethernet/realtek/r8169.c | 2 +- drivers/net/ethernet/sis/sis900.c | 2 +- drivers/net/ethernet/sun/cassini.c | 2 +- drivers/net/ethernet/sun/niu.c | 6 +++--- drivers/net/wan/z85230.c | 2 +- drivers/net/wireless/ath/ath6kl/init.c | 2 +- drivers/net/wireless/ath/ath9k/init.c | 2 +- drivers/net/wireless/b43/debugfs.c | 2 +- drivers/net/wireless/b43/dma.c | 2 +- drivers/net/wireless/b43/lo.c | 2 +- drivers/net/wireless/b43/main.c | 2 +- drivers/net/wireless/b43/phy_n.c | 2 +- drivers/net/wireless/b43/xmit.c | 12 ++++++------ drivers/net/wireless/b43legacy/debugfs.c | 2 +- drivers/net/wireless/b43legacy/main.c | 2 +- drivers/net/wireless/iwlegacy/3945.c | 2 +- drivers/net/wireless/iwlegacy/4965-mac.c | 2 +- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 6 +++--- drivers/net/xen-netback/netback.c | 2 +- drivers/pci/pcie/aer/aerdrv_core.c | 2 +- drivers/platform/x86/hdaps.c | 4 ++-- drivers/s390/cio/cio.c | 2 +- drivers/scsi/dc395x.c | 2 +- drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/spi/spi-davinci.c | 2 +- drivers/ssb/driver_chipcommon.c | 4 ++-- drivers/staging/zsmalloc/zsmalloc-main.c | 2 +- drivers/tty/cyclades.c | 2 +- drivers/tty/isicom.c | 2 +- drivers/usb/gadget/uvc_queue.c | 2 +- drivers/usb/musb/cppi_dma.c | 2 +- drivers/usb/storage/sddr55.c | 4 ++-- drivers/vhost/net.c | 4 ++-- drivers/vhost/vhost.c | 2 +- drivers/video/matrox/matroxfb_maven.c | 6 +++--- drivers/video/pm3fb.c | 6 +++--- drivers/video/riva/riva_hw.c | 4 ++-- drivers/virtio/virtio_ring.c | 2 +- fs/afs/dir.c | 2 +- fs/afs/security.c | 2 +- fs/binfmt_flat.c | 2 +- fs/dlm/netlink.c | 2 +- fs/fat/dir.c | 2 +- fs/fuse/control.c | 4 ++-- fs/gfs2/recovery.c | 2 +- fs/hfsplus/unicode.c | 2 +- fs/isofs/namei.c | 4 ++-- fs/jffs2/erase.c | 2 +- fs/nfsd/nfsctl.c | 2 +- fs/ocfs2/alloc.c | 4 ++-- fs/ocfs2/dir.c | 14 +++++++------- fs/ocfs2/extent_map.c | 4 ++-- fs/ocfs2/namei.c | 2 +- fs/ocfs2/refcounttree.c | 2 +- fs/ocfs2/stack_user.c | 2 +- fs/ocfs2/xattr.c | 2 +- fs/omfs/file.c | 2 +- fs/ubifs/budget.c | 2 +- fs/ubifs/commit.c | 6 +++--- fs/ubifs/dir.c | 2 +- fs/ubifs/file.c | 4 ++-- fs/ubifs/journal.c | 4 ++-- fs/ubifs/lpt.c | 2 +- fs/ubifs/tnc.c | 6 +++--- fs/ubifs/tnc_misc.c | 4 ++-- fs/udf/balloc.c | 2 +- fs/xfs/xfs_bmap.c | 2 +- fs/xfs/xfs_file.c | 4 ++-- include/linux/compiler-gcc.h | 6 ------ include/linux/compiler-intel.h | 2 -- include/linux/mm.h | 2 +- ipc/msg.c | 2 +- kernel/async.c | 4 ++-- kernel/audit.c | 2 +- kernel/debug/kdb/kdb_io.c | 2 +- kernel/events/uprobes.c | 2 +- kernel/exit.c | 2 +- kernel/futex.c | 10 +++++----- kernel/futex_compat.c | 2 +- kernel/lockdep.c | 14 +++++++------- lib/dma-debug.c | 2 +- lib/radix-tree.c | 4 ++-- mm/frontswap.c | 2 +- mm/ksm.c | 2 +- mm/memcontrol.c | 8 ++++---- mm/memory.c | 2 +- mm/mempolicy.c | 6 +++--- mm/oom_kill.c | 2 +- mm/page-writeback.c | 4 ++-- mm/page_alloc.c | 2 +- mm/percpu.c | 2 +- mm/slub.c | 2 +- mm/swap.c | 4 ++-- net/dccp/options.c | 2 +- net/ipv6/ip6_flowlabel.c | 2 +- net/netfilter/nf_conntrack_ftp.c | 2 +- net/netfilter/nfnetlink_queue_core.c | 4 ++-- net/netfilter/xt_socket.c | 10 +++++----- net/sched/cls_flow.c | 2 +- net/sched/sch_cbq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_htb.c | 2 +- net/sched/sch_sfq.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 +- sound/core/control_compat.c | 2 +- sound/isa/sb/sb16_csp.c | 2 +- sound/usb/endpoint.c | 2 +- tools/virtio/linux/virtio.h | 2 -- 185 files changed, 281 insertions(+), 291 deletions(-)
arch/arm/mach-sa1100/assabet.c +1 -1
@@ -388,7 +388,7 @@ static void __init map_sa1100_gpio_regs( void )*/ static void __init get_assabet_scr (void ) { -unsigned long uninitialized_var (scr ), i; +unsigned long scr =0 , i;GPDR |=0x3fc ;/* Configure GPIO 9:2 as outputs */ GPSR =0x3fc ;/* Write 0xFF to GPIO 9:2 */
arch/ia64/kernel/process.c +1 -1
@@ -493,7 +493,7 @@ static void do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg) { unsigned long mask, sp, nat_bits = 0, ar_rnat, urbs_end, cfm; -unsigned long uninitialized_var (ip );/* GCC be quiet */ +unsigned long ip =0 ;/* GCC be quiet */ elf_greg_t *dst = arg;struct pt_regs *pt;char nat;
arch/ia64/mm/discontig.c +1 -1
@@ -185,7 +185,7 @@ static void *per_cpu_node_setup(void *cpu_data, int node)void __init setup_per_cpu_areas (void ) {struct pcpu_alloc_info *ai; -struct pcpu_group_info *uninitialized_var (gi ); +struct pcpu_group_info *gi =NULL ;unsigned int *cpu_map;void *base;unsigned long base_offset;
arch/ia64/mm/tlb.c +1 -1
@@ -340,7 +340,7 @@ EXPORT_SYMBOL(flush_tlb_range);void __devinit ia64_tlb_init (void ) { -ia64_ptce_info_t uninitialized_var (ptce_info );/* GCC be quiet */ +ia64_ptce_info_t ptce_info =0 ;/* GCC be quiet */ u64 tr_pgbits;long status;pal_vm_info_1_u_t vm_info_1;
arch/ia64/sn/kernel/tiocx.c +1 -1
@@ -371,7 +371,7 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)static int is_fpga_tio (int nasid,int *bt) { -u16 uninitialized_var (ioboard_type );/* GCC be quiet */ +u16 ioboard_type =0 ;/* GCC be quiet */ long rc; rc =ia64_sn_sysctl_ioboard_get (nasid, &ioboard_type);
arch/ia64/sn/pci/pcibr/pcibr_provider.c +1 -1
@@ -82,7 +82,7 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)u16 sn_ioboard_to_pci_bus (struct pci_bus *pci_bus) {long rc; -u16 uninitialized_var (ioboard );/* GCC be quiet */ +u16 ioboard =0 ;/* GCC be quiet */ nasid_t nasid =NASID_GET (SN_PCIBUS_BUSSOFT (pci_bus)->bs_base); rc =ia64_sn_sysctl_ioboard_get (nasid, &ioboard);
arch/powerpc/kvm/book3s_pr.c +1 -1
@@ -1012,7 +1012,7 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)#ifdef CONFIG_ALTIVEC vector128 vr[32 ];vector128 vscr; -unsigned long uninitialized_var (vrsave ); +unsigned long vrsave =0 ;int used_vr;#endif #ifdef CONFIG_VSX
arch/powerpc/kvm/powerpc.c +1 -1
@@ -447,7 +447,7 @@ static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,static void kvmppc_complete_mmio_load (struct kvm_vcpu *vcpu,struct kvm_run *run) { -u64 uninitialized_var (gpr ); +u64 gpr =0 ;if (run->mmio.len >sizeof (gpr)) {printk (KERN_ERR "bad MMIO length: %d\n" , run->mmio.len);
arch/powerpc/mm/numa.c +1 -1
@@ -637,7 +637,7 @@ static inline int __init read_usm_ranges(const u32 **usm)*/ static void __init parse_drconf_memory (struct device_node *memory) { -const u32 *uninitialized_var (dm ), *usm; +const u32 *dm =NULL , *usm;unsigned int n, rc, ranges, is_kexec_kdump =0 ;unsigned long lmb_size, base, size, sz;int nid;
arch/powerpc/platforms/pseries/iommu.c +2 -2
@@ -930,8 +930,8 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)int page_shift;u64 dma_addr, max_addr;struct device_node *dn; -const u32 *uninitialized_var (ddw_avail ); -const u32 *uninitialized_var (ddw_extensions ); +const u32 *ddw_avail =NULL ; +const u32 *ddw_extensions =NULL ;u32 ddw_restore_token =0 ;struct direct_window *window;struct property *win64;
arch/s390/kernel/smp.c +1 -1
@@ -126,7 +126,7 @@ static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm)static inline int pcpu_stopped (struct pcpu *pcpu) { -u32 uninitialized_var (status ); +u32 status =0 ;if (__pcpu_sigp (pcpu->address,SIGP_SENSE ,0 , &status) !=SIGP_CC_STATUS_STORED )
arch/s390/mm/pgtable.c +2 -2
@@ -609,8 +609,8 @@ static inline unsigned int atomic_xor_bits(atomic_t *v, unsigned int bits)*/ unsigned long *page_table_alloc (struct mm_struct *mm,unsigned long vmaddr) { -unsigned long *uninitialized_var (table ); -struct page *uninitialized_var (page ); +unsigned long *table =NULL ; +struct page *page =NULL ;unsigned int mask, bit;if (mm_has_pgste (mm))
arch/tile/include/asm/futex.h +1 -1
@@ -111,7 +111,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int uninitialized_var (val ), ret; +int val =0 , ret;__futex_prolog ();
arch/x86/kernel/apic/es7000_32.c +1 -1
@@ -529,7 +529,7 @@ static inline int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask, unsigned int *dest_id) { unsigned int round = 0; -unsigned int cpu,uninitialized_var (apicid ); +unsigned int cpu, apicid =0 ;/* * The cpus in the mask must all be on the apic cluster.
arch/x86/kernel/quirks.c +5 -5
@@ -94,7 +94,7 @@ static void ich_force_hpet_resume(void)static void ich_force_enable_hpet (struct pci_dev *dev) {u32 val; -u32 uninitialized_var (rcba ); +u32 rcba =0 ;int err =0 ;if (hpet_address || force_hpet_address)
@@ -184,7 +184,7 @@ static void hpet_print_force_info(void)static void old_ich_force_hpet_resume (void ) {u32 val; -u32 uninitialized_var (gen_cntl ); +u32 gen_cntl =0 ;if (!force_hpet_address || !cached_dev)return ;
@@ -206,7 +206,7 @@ static void old_ich_force_hpet_resume(void)static void old_ich_force_enable_hpet (struct pci_dev *dev) {u32 val; -u32 uninitialized_var (gen_cntl ); +u32 gen_cntl =0 ;if (hpet_address || force_hpet_address)return ;
@@ -297,7 +297,7 @@ static void vt8237_force_hpet_resume(void)static void vt8237_force_enable_hpet (struct pci_dev *dev) { -u32 uninitialized_var (val ); +u32 val =0 ;if (hpet_address || force_hpet_address)return ;
@@ -424,7 +424,7 @@ static void nvidia_force_hpet_resume(void)static void nvidia_force_enable_hpet (struct pci_dev *dev) { -u32 uninitialized_var (val ); +u32 val =0 ;if (hpet_address || force_hpet_address)return ;
arch/x86/kvm/mmu.c +1 -1
@@ -1347,7 +1347,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, struct kvm_memory_slot *slot, unsigned long data) {u64 *sptep; -struct rmap_iterator uninitialized_var (iter ); +struct rmap_iterator iter = { };int young =0 ;/*
arch/x86/kvm/paging_tmpl.h +1 -1
@@ -149,7 +149,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, {int ret;pt_element_t pte; -pt_element_t __user *uninitialized_var (ptep_user ); +pt_element_t __user *ptep_user =NULL ;gfn_t table_gfn;unsigned index, pt_access, pte_access, accessed_dirty, shift;gpa_t pte_gpa;
arch/x86/mm/numa.c +1 -1
@@ -490,7 +490,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)static int __init numa_register_memblks (struct numa_meminfo *mi) { -unsigned long uninitialized_var (pfn_align ); +unsigned long pfn_align =0 ;int i, nid;/* Account for nodes with cpus and no memory */
arch/x86/xen/p2m.c +4 -4
@@ -875,7 +875,7 @@ int m2p_add_override(unsigned long mfn, struct page *page, {unsigned long flags;unsigned long pfn; -unsigned long uninitialized_var (address ); +unsigned long address =0 ;unsigned level;pte_t *ptep =NULL ;int ret =0 ;
@@ -938,7 +938,7 @@ int m2p_remove_override(struct page *page,unsigned long flags;unsigned long mfn;unsigned long pfn; -unsigned long uninitialized_var (address ); +unsigned long address =0 ;unsigned level;pte_t *ptep =NULL ;int ret =0 ;
@@ -1079,8 +1079,8 @@ static int p2m_dump_show(struct seq_file *m, void *v) [TYPE_PFN] = "pfn", [TYPE_UNKNOWN] = "abnormal"};unsigned long pfn, prev_pfn_type =0 , prev_pfn_level =0 ; -unsigned int uninitialized_var (prev_level ); -unsigned int uninitialized_var (prev_type ); +unsigned int prev_level =0 ; +unsigned int prev_type =0 ;if (!p2m_top)return 0 ;
arch/xtensa/variants/s6000/delay.c +2 -2
@@ -6,8 +6,8 @@#define LOOPS 10void platform_calibrate_ccount (void ) { -u32 uninitialized_var (a ); -u32 uninitialized_var (u ); +u32 a =0 ; +u32 u =0 ;u32 b;u32 tstamp =S6_REG_GREG1 +S6_GREG1_GLOBAL_TIMER ;int i =LOOPS +1 ;
drivers/acpi/acpi_pad.c +1 -1
@@ -103,7 +103,7 @@ static void round_robin_cpu(unsigned int tsk_index)cpumask_var_t tmp;int cpu;unsigned long min_weight =-1 ; -unsigned long uninitialized_var (preferred_cpu ); +unsigned long preferred_cpu =0 ;if (!alloc_cpumask_var (&tmp,GFP_KERNEL ))return ;
drivers/acpi/acpica/tbutils.c +1 -1
@@ -628,7 +628,7 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)u32 table_count;struct acpi_table_header *table;acpi_physical_address address; -acpi_physical_address uninitialized_var (rsdt_address ); +acpi_physical_address rsdt_address =0 ;u32 length;u8 *table_entry;acpi_status status;
drivers/ata/libata-scsi.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t ata_scsi_park_show(struct device *device,struct ata_link *link;struct ata_device *dev;unsigned long flags, now; -unsigned int uninitialized_var (msecs ); +unsigned int msecs =0 ;int rc =0 ; ap =ata_shost_to_port (sdev->host);
drivers/atm/zatm.c +1 -1
@@ -937,7 +937,7 @@ static int open_tx_first(struct atm_vcc *vcc) vcc->qos.txtp.max_pcr >= ATM_OC3_PCR);if (unlimited && zatm_dev->ubr !=-1 ) zatm_vcc->shaper = zatm_dev->ubr; else { - int uninitialized_var(pcr); + int pcr = 0; if (unlimited) vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU; if ((zatm_vcc->shaper = alloc_shaper(vcc->dev,&pcr,
drivers/block/nvme.c +1 -1
@@ -1197,7 +1197,7 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,struct nvme_admin_cmd cmd;struct nvme_command c;int status, length; -struct nvme_iod *uninitialized_var (iod ); +struct nvme_iod *iod =NULL ;if (!capable (CAP_SYS_ADMIN ))return -EACCES ;
drivers/char/mmtimer.c +1 -1
@@ -616,7 +616,7 @@ static int sgi_timer_del(struct k_itimer *timr)if (timr->it.mmtimer.clock !=TIMER_OFF ) {unsigned long expires = timr->it.mmtimer.expires;struct rb_node *n = timers[nodeid].timer_head.rb_node; -struct mmtimer *uninitialized_var (t ); +struct mmtimer *t =NULL ;int r =0 ; timr->it.mmtimer.clock =TIMER_OFF ;
drivers/firewire/ohci.c +7 -7
@@ -1103,7 +1103,7 @@ static void context_tasklet(unsigned long data)static int context_add_buffer (struct context *ctx) {struct descriptor_buffer *desc; -dma_addr_t uninitialized_var (bus_addr ); +dma_addr_t bus_addr =0 ;int offset;/*
@@ -1265,7 +1265,7 @@ static int at_context_queue_packet(struct context *ctx, struct fw_packet *packet) {struct fw_ohci *ohci = ctx->ohci; -dma_addr_t d_bus,uninitialized_var (payload_bus ); +dma_addr_t d_bus, payload_bus =0 ;struct driver_data *driver_data;struct descriptor *d, *last;__le32 *header;
@@ -2438,7 +2438,7 @@ static int ohci_set_config_rom(struct fw_card *card, {struct fw_ohci *ohci;__be32 *next_config_rom; -dma_addr_t uninitialized_var (next_config_rom_bus ); +dma_addr_t next_config_rom_bus =0 ; ohci =fw_ohci (card);
@@ -2922,10 +2922,10 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card, int type, int channel, size_t header_size) { struct fw_ohci *ohci = fw_ohci(card); -struct iso_context *uninitialized_var (ctx ); -descriptor_callback_t uninitialized_var (callback ); -u64 *uninitialized_var (channels ); -u32 *uninitialized_var (mask ),uninitialized_var (regs ); +struct iso_context *ctx =NULL ; +descriptor_callback_t callback =0 ; +u64 *channels =NULL ; +u32 *mask =NULL , regs =0 ;int index, ret = -EBUSY ;spin_lock_irq (&ohci->lock);
drivers/gpu/drm/drm_edid.c +1 -1
@@ -1369,7 +1369,7 @@ static int drm_cvt_modes(struct drm_connector *connector,const u8 empty[3 ] = {0 ,0 ,0 };for (i =0 ; i <4 ; i++) { -int uninitialized_var (width ), height; +int width =0 , height; cvt = &(timing->data.other_data.data.cvt[i]);if (!memcmp (cvt->code, empty,3 ))
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
@@ -103,7 +103,7 @@ static void i915_warn_stolen(struct drm_device *dev)static void i915_setup_compression (struct drm_device *dev,int size) {struct drm_i915_private *dev_priv = dev->dev_private; -struct drm_mm_node *compressed_fb, *uninitialized_var (compressed_llb ); +struct drm_mm_node *compressed_fb, *compressed_llb =NULL ;unsigned long cfb_base;unsigned long ll_base =0 ;
drivers/hid/uhid.c +1 -1
@@ -154,7 +154,7 @@ static int uhid_hid_get_raw(struct hid_device *hid, unsigned char rnum,struct uhid_event *ev;unsigned long flags;int ret; -size_t uninitialized_var (len ); +size_t len =0 ;struct uhid_feature_answer_req *req;if (!uhid->running)
drivers/i2c/busses/i2c-mxs.c +1 -1
@@ -251,7 +251,7 @@ static int mxs_i2c_wait_for_data(struct mxs_i2c_dev *i2c)static int mxs_i2c_finish_read (struct mxs_i2c_dev *i2c,u8 *buf,int len) { -u32 uninitialized_var (data ); +u32 data =0 ;int i;for (i =0 ; i < len; i++) {
drivers/ide/ide-acpi.c +1 -1
@@ -170,7 +170,7 @@ err:static acpi_handle ide_acpi_hwif_get_handle (ide_hwif_t *hwif) {struct device *dev = hwif->gendev.parent; -acpi_handle uninitialized_var (dev_handle ); +acpi_handle dev_handle =0 ;u64 pcidevfn;acpi_handle chan_handle;int err;
drivers/ide/ide-atapi.c +1 -1
@@ -581,7 +581,7 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)static ide_startstop_t ide_transfer_pc (ide_drive_t *drive) { -struct ide_atapi_pc *uninitialized_var (pc ); +struct ide_atapi_pc *pc =NULL ;ide_hwif_t *hwif = drive->hwif;struct request *rq = hwif->rq;ide_expiry_t *expiry;
drivers/ide/ide-io-std.c +2 -2
@@ -172,7 +172,7 @@ void ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,u8 mmio = (hwif->host_flags &IDE_HFLAG_MMIO ) ?1 :0 ;if (io_32bit) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;if ((io_32bit &2 ) && !mmio) {local_irq_save (flags);
@@ -216,7 +216,7 @@ void ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,u8 mmio = (hwif->host_flags &IDE_HFLAG_MMIO ) ?1 :0 ;if (io_32bit) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;if ((io_32bit &2 ) && !mmio) {local_irq_save (flags);
drivers/ide/ide-io.c +4 -4
@@ -613,12 +613,12 @@ static int drive_is_ready(ide_drive_t *drive)void ide_timer_expiry (unsigned long data) {ide_hwif_t *hwif = (ide_hwif_t *)data; -ide_drive_t *uninitialized_var (drive ); +ide_drive_t *drive =NULL ;ide_handler_t *handler;unsigned long flags;int wait =-1 ;int plug_device =0 ; -struct request *uninitialized_var (rq_in_flight ); +struct request *rq_in_flight =NULL ;spin_lock_irqsave (&hwif->lock, flags);
@@ -771,13 +771,13 @@ irqreturn_t ide_intr (int irq, void *dev_id) {ide_hwif_t *hwif = (ide_hwif_t *)dev_id;struct ide_host *host = hwif->host; -ide_drive_t *uninitialized_var (drive ); +ide_drive_t *drive =NULL ;ide_handler_t *handler;unsigned long flags;ide_startstop_t startstop;irqreturn_t irq_ret =IRQ_NONE ;int plug_device =0 ; -struct request *uninitialized_var (rq_in_flight ); +struct request *rq_in_flight =NULL ;if (host->host_flags &IDE_HFLAG_SERIALIZE ) {if (hwif != host->cur_port)
drivers/ide/ide-sysfs.c +1 -1
@@ -113,7 +113,7 @@ static struct device_attribute *ide_port_attrs[] = {int ide_sysfs_register_port (ide_hwif_t *hwif) { -int i,uninitialized_var (rc ); +int i, rc =0 ;for (i =0 ; ide_port_attrs[i]; i++) { rc =device_create_file (hwif->portdev, ide_port_attrs[i]);
drivers/ide/ide-taskfile.c +1 -1
@@ -226,7 +226,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,ide_hwif_t *hwif = drive->hwif;struct scatterlist *sg = hwif->sg_table;struct scatterlist *cursg = cmd->cursg; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;struct page *page;unsigned int offset;u8 *buf;
drivers/ide/umc8672.c +1 -1
@@ -107,7 +107,7 @@ static void umc_set_speeds(u8 speeds[])static void umc_set_pio_mode (ide_hwif_t *hwif,ide_drive_t *drive) {ide_hwif_t *mate = hwif->mate; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;const u8 pio = drive->pio_mode -XFER_PIO_0 ; printk("%s: setting umc8672 to PIO mode%d (speed %d)\n",
drivers/infiniband/core/uverbs_cmd.c +3 -3
@@ -1386,7 +1386,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,struct ib_device *device;struct ib_pd *pd =NULL ;struct ib_xrcd *xrcd =NULL ; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL ;struct ib_cq *scq =NULL , *rcq =NULL ;struct ib_srq *srq =NULL ;struct ib_qp *qp;
@@ -1573,7 +1573,7 @@ ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,struct ib_udata udata;struct ib_uqp_object *obj;struct ib_xrcd *xrcd; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL ;struct ib_qp *qp;struct ib_qp_open_attr attr;int ret;
@@ -2475,7 +2475,7 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,struct ib_usrq_object *obj;struct ib_pd *pd;struct ib_srq *srq; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL ;struct ib_srq_init_attr attr;int ret;
drivers/infiniband/core/verbs.c +2 -2
@@ -314,8 +314,8 @@ int ib_destroy_srq(struct ib_srq *srq) {struct ib_pd *pd;enum ib_srq_type srq_type; -struct ib_xrcd *uninitialized_var (xrcd ); -struct ib_cq *uninitialized_var (cq ); +struct ib_xrcd *xrcd =NULL ; +struct ib_cq *cq =NULL ;int ret;if (atomic_read (&srq->usecnt))
drivers/infiniband/hw/cxgb3/iwch_qp.c +1 -1
@@ -351,7 +351,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, struct ib_send_wr **bad_wr) {int err =0 ; -u8 uninitialized_var (t3_wr_flit_cnt ); +u8 t3_wr_flit_cnt =0 ;enum t3_wr_opcode t3_wr_opcode =0 ;enum t3_wr_flags t3_wr_flags;struct iwch_qp *qhp;
drivers/infiniband/hw/mlx4/qp.c +4 -4
@@ -2187,12 +2187,12 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,int nreq;int err =0 ;unsigned ind; -int uninitialized_var (stamp ); -int uninitialized_var (size ); -unsigned uninitialized_var (seglen ); +int stamp =0 ; +int size =0 ; +unsigned seglen =0 ;__be32 dummy;__be32 *lso_wqe; -__be32 uninitialized_var (lso_hdr_sz ); +__be32 lso_hdr_sz =0 ;__be32 blh;int i;
drivers/infiniband/hw/mthca/mthca_qp.c +5 -5
@@ -1617,8 +1617,8 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,* without initializing f0 and size0, and they are in fact * never used uninitialized. */ -int uninitialized_var (size0 ); -u32 uninitialized_var (f0 ); +int size0 =0 ; +u32 f0 =0 ;int ind;u8 op0 =0 ;
@@ -1818,7 +1818,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,* without initializing size0, and it is in fact never used * uninitialized. */ -int uninitialized_var (size0 ); +int size0 =0 ;int ind;void *wqe;void *prev_wqe;
@@ -1932,8 +1932,8 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,* without initializing f0 and size0, and they are in fact * never used uninitialized. */ -int uninitialized_var (size0 ); -u32 uninitialized_var (f0 ); +int size0 =0 ; +u32 f0 =0 ;int ind;u8 op0 =0 ;
drivers/input/serio/serio_raw.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, {struct serio_raw_client *client = file->private_data;struct serio_raw *serio_raw = client->serio_raw; -char uninitialized_var (c ); +char c =0 ;ssize_t read =0 ;int error;
drivers/iommu/intel-iommu.c +1 -1
@@ -1789,7 +1789,7 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, unsigned long nr_pages, int prot) {struct dma_pte *first_pte =NULL , *pte =NULL ; -phys_addr_t uninitialized_var (pteval ); +phys_addr_t pteval =0 ;int addr_width =agaw_to_width (domain->agaw) -VTD_PAGE_SHIFT ;unsigned long sg_res;unsigned int largepage_lvl =0 ;
drivers/iommu/omap-iommu-debug.c +1 -1
@@ -220,7 +220,7 @@ static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,struct omap_iommu *obj =dev_to_omap_iommu (dev);char *p, *buf;struct iovm_struct *tmp; -int uninitialized_var (i ); +int i =0 ;ssize_t bytes; buf = (char *)__get_free_page (GFP_KERNEL );
drivers/iommu/tegra-smmu.c +2 -2
@@ -1155,8 +1155,8 @@ static int tegra_smmu_probe(struct platform_device *pdev)struct smmu_device *smmu;struct device *dev = &pdev->dev;int i, asids, err =0 ; -dma_addr_t uninitialized_var (base ); -size_t bytes,uninitialized_var (size ); +dma_addr_t base =0 ; +size_t bytes, size =0 ;if (smmu_handle)return -EIO ;
drivers/isdn/hardware/eicon/debug.c +1 -1
@@ -1187,7 +1187,7 @@ int SuperTraceASSIGN(void *AdapterHandle, byte *data) {if ((features[0 ] &DIVA_XDI_EXTENDED_FEATURES_VALID ) && (features[0 ] &DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA )) { -dword uninitialized_var (rx_dma_magic ); +dword rx_dma_magic =0 ;if ((pC->dma_handle =diva_get_dma_descriptor (pC->request, &rx_dma_magic)) >=0 ) { pC->xbuffer[0 ] =LLI ; pC->xbuffer[1 ] =8 ;
drivers/lguest/lguest_user.c +1 -1
@@ -408,7 +408,7 @@ static ssize_t write(struct file *file, const char __user *in,struct lguest *lg = file->private_data;const unsigned long __user *input = (const unsigned long __user *)in;unsigned long req; -struct lg_cpu *uninitialized_var (cpu ); +struct lg_cpu *cpu =NULL ;unsigned int cpu_id = *off;/* The first value tells us what this request is. */
drivers/md/dm-ioctl.c +1 -1
@@ -1615,7 +1615,7 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)int r =0 ;int wipe_buffer;unsigned int cmd; -struct dm_ioctl *uninitialized_var (param ); +struct dm_ioctl *param =NULL ;ioctl_fn fn =NULL ;size_t input_param_size;
drivers/md/dm-snap-persistent.c +1 -1
@@ -552,7 +552,7 @@ static int persistent_read_metadata(struct dm_exception_store *store, chunk_t old, chunk_t new), void *callback_context) { - int r, uninitialized_var(new_snapshot); + int r, new_snapshot = 0;struct pstore *ps =get_info (store);/*
drivers/md/dm-table.c +4 -4
@@ -459,7 +459,7 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, struct dm_dev **result) {int r; -dev_t uninitialized_var (dev ); +dev_t dev =0 ;struct dm_dev_internal *dd;unsigned int major, minor;struct dm_table *t = ti->table;
@@ -689,7 +689,7 @@ static int validate_hardware_logical_block_alignment(struct dm_table *table,*/ unsigned short remaining =0 ; -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL ;struct queue_limits ti_limits;unsigned i =0 ;
@@ -1230,7 +1230,7 @@ static int count_device(struct dm_target *ti, struct dm_dev *dev,*/ bool dm_table_has_no_data_devices (struct dm_table *table) { -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL ;unsigned i =0 , num_devices =0 ;while (i <dm_table_get_num_targets (table)) {
@@ -1253,7 +1253,7 @@ bool dm_table_has_no_data_devices(struct dm_table *table)int dm_calculate_queue_limits (struct dm_table *table,struct queue_limits *limits) { -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL ;struct queue_limits ti_limits;unsigned i =0 ;
drivers/md/raid5.c +1 -1
@@ -1865,7 +1865,7 @@ static void raid5_end_write_request(struct bio *bi, int error)struct stripe_head *sh = bi->bi_private;struct r5conf *conf = sh->raid_conf;int disks = sh->disks, i; -struct md_rdev *uninitialized_var (rdev ); +struct md_rdev *rdev =NULL ;int uptodate =test_bit (BIO_UPTODATE , &bi->bi_flags);sector_t first_bad;int bad_sectors;
drivers/media/dvb-frontends/af9013.c +1 -1
@@ -419,7 +419,7 @@ static int af9013_statistics_snr_result(struct dvb_frontend *fe)int ret, i, len;u8 buf[3 ], tmp;u32 snr_val; -const struct af9013_snr *uninitialized_var (snr_lut ); +const struct af9013_snr *snr_lut =NULL ;dev_dbg (&state->i2c->dev,"%s:\n" , __func__);
drivers/media/dvb-frontends/af9033.c +1 -1
@@ -714,7 +714,7 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr)int ret, i, len;u8 buf[3 ], tmp;u32 snr_val; -const struct val_snr *uninitialized_var (snr_lut ); +const struct val_snr *snr_lut =NULL ;/* read value */ ret =af9033_rd_regs (state,0x80002c , buf,3 );
drivers/media/dvb-frontends/cxd2820r_core.c +1 -1
@@ -567,7 +567,7 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)static void cxd2820r_release (struct dvb_frontend *fe) {struct cxd2820r_priv *priv = fe->demodulator_priv; -int uninitialized_var (ret );/* silence compiler warning */ +int ret =0 ;/* silence compiler warning */ dev_dbg (&priv->i2c->dev,"%s\n" , __func__);
drivers/media/platform/omap3isp/ispqueue.c +1 -1
@@ -1082,7 +1082,7 @@ static const struct vm_operations_struct isp_video_queue_vm_ops = {int omap3isp_video_queue_mmap (struct isp_video_queue *queue,struct vm_area_struct *vma) { -struct isp_video_buffer *uninitialized_var (buf ); +struct isp_video_buffer *buf =NULL ;unsigned long size;unsigned int i;int ret =0 ;
drivers/media/tuners/tda18212.c +1 -1
@@ -277,7 +277,7 @@ struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, {struct tda18212_priv *priv =NULL ;int ret; -u8 uninitialized_var (val ); +u8 val =0 ; priv =kzalloc (sizeof (struct tda18212_priv ),GFP_KERNEL );if (priv ==NULL )
drivers/media/tuners/tda18218.c +1 -1
@@ -277,7 +277,7 @@ struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct tda18218_config *cfg) { struct tda18218_priv *priv = NULL; -u8 uninitialized_var (val ); +u8 val =0 ;int ret;/* chip default registers values */ static u8 def_regs[] = {
drivers/media/usb/dvb-usb-v2/af9015.c +1 -1
@@ -208,7 +208,7 @@ static int af9015_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],struct af9015_state *state =d_to_priv (d);int ret =0 , i =0 ;u16 addr; -u8 uninitialized_var (mbox ), addr_len; +u8 mbox =0 , addr_len;struct req_t req;/*
drivers/media/usb/dvb-usb/dib0700_core.c +1 -1
@@ -675,7 +675,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) {struct dvb_usb_device *d = purb->context;struct dib0700_rc_response *poll_reply; -u32 uninitialized_var (keycode ); +u32 keycode =0 ;u8 toggle;deb_info ("%s()\n" , __func__);
drivers/media/usb/gspca/vicam.c +1 -1
@@ -239,7 +239,7 @@ static int sd_init(struct gspca_dev *gspca_dev) {int ret;const struct ihex_binrec *rec; -const struct firmware *uninitialized_var (fw ); +const struct firmware *fw =NULL ;u8 *firmware_buf; ret = request_ihex_firmware(&fw, VICAM_FIRMWARE,
drivers/media/usb/uvc/uvc_video.c +4 -4
@@ -702,9 +702,9 @@ static void uvc_video_stats_decode(struct uvc_streaming *stream,unsigned int header_size;bool has_pts = false;bool has_scr = false; -u16 uninitialized_var (scr_sof ); -u32 uninitialized_var (scr_stc ); -u32 uninitialized_var (pts ); +u16 scr_sof =0 ; +u32 scr_stc =0 ; +u32 pts =0 ;if (stream->stats.stream.nb_frames ==0 && stream->stats.frame.nb_packets ==0 )
@@ -1588,7 +1588,7 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)struct usb_host_endpoint *best_ep =NULL ;unsigned int best_psize =UINT_MAX ;unsigned int bandwidth; -unsigned int uninitialized_var (altsetting ); +unsigned int altsetting =0 ;int intfnum = stream->intfnum;/* Isochronous endpoint, select the alternate setting. */
drivers/memstick/host/jmb38x_ms.c +1 -1
@@ -315,7 +315,7 @@ static int jmb38x_ms_transfer_data(struct jmb38x_ms_host *host) }while (length) { -unsigned int uninitialized_var (p_off ); +unsigned int p_off =0 ;if (host->req->long_data) { pg = nth_page(sg_page(&host->req->sg),
drivers/memstick/host/tifm_ms.c +1 -1
@@ -200,7 +200,7 @@ static unsigned int tifm_ms_transfer_data(struct tifm_ms *host) host->block_pos);while (length) { -unsigned int uninitialized_var (p_off ); +unsigned int p_off =0 ;if (host->req->long_data) { pg = nth_page(sg_page(&host->req->sg),
drivers/mmc/host/sdhci.c +2 -2
@@ -175,7 +175,7 @@ static void sdhci_disable_card_detection(struct sdhci_host *host)static void sdhci_reset (struct sdhci_host *host,u8 mask) {unsigned long timeout; -u32 uninitialized_var (ier ); +u32 ier =0 ;if (host->quirks &SDHCI_QUIRK_NO_CARD_NO_RESET ) { if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
@@ -311,7 +311,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) {unsigned long flags;size_t blksize, len, chunk; -u32 uninitialized_var (scratch ); +u32 scratch =0 ;u8 *buf;DBG ("PIO reading\n" );
drivers/mtd/nand/nand_ecc.c +1 -1
@@ -167,7 +167,7 @@ void __nand_calculate_ecc(const unsigned char *buf, unsigned int eccsize,/* rp0..rp15..rp17 are the various accumulated parities (per byte) */ uint32_t rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;uint32_t rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15, rp16; -uint32_t uninitialized_var (rp17 );/* to make compiler happy */ +uint32_t rp17 =0 ;/* to make compiler happy */ uint32_t par;/* the cumulative parity for all data */ uint32_t tmppar;/* the cumulative parity for this iteration; for rp12, rp14 and rp16 at the end of the
drivers/mtd/nand/s3c2410.c +1 -1
@@ -234,7 +234,7 @@ static int s3c2410_nand_setrate(struct s3c2410_nand_info *info)int tacls_max = (info->cpu_type ==TYPE_S3C2412 ) ?8 :4 ;int tacls, twrph0, twrph1;unsigned long clkrate =clk_get_rate (info->clk); -unsigned long uninitialized_var (set ), cfg,uninitialized_var (mask ); +unsigned long set =0 , cfg, mask =0 ;unsigned long flags;/* calculate the timing information for the controller */
drivers/mtd/ubi/attach.c +1 -1
@@ -821,7 +821,7 @@ out_unlock:static int scan_peb (struct ubi_device *ubi,struct ubi_attach_info *ai,int pnum,int *vid,unsigned long long *sqnum) { -long long uninitialized_var (ec ); +long long ec =0 ;int err, bitflips =0 , vol_id =-1 , ec_err =0 ;dbg_bld ("scan PEB %d" , pnum);
drivers/mtd/ubi/eba.c +1 -1
@@ -374,7 +374,7 @@ int ubi_eba_read_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum, {int err, pnum, scrub =0 , vol_id = vol->vol_id;struct ubi_vid_hdr *vid_hdr; -uint32_t uninitialized_var (crc ); +uint32_t crc =0 ; err =leb_read_lock (ubi, vol_id, lnum);if (err)
drivers/mtd/ubi/wl.c +1 -1
@@ -994,7 +994,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk, int cancel) {int err, scrubbing =0 , torture =0 , protect =0 , erroneous =0 ; -int vol_id =-1 ,uninitialized_var (lnum ); +int vol_id =-1 , lnum =0 ;#ifdef CONFIG_MTD_UBI_FASTMAP int anchor = wrk->anchor;#endif
drivers/net/dsa/mv88e6060.c +1 -1
@@ -224,7 +224,7 @@ static void mv88e6060_poll_link(struct dsa_switch *ds)for (i =0 ; i <DSA_MAX_PORTS ; i++) {struct net_device *dev; -int uninitialized_var (port_status ); +int port_status =0 ;int link;int speed;int duplex;
drivers/net/dsa/mv88e6xxx.c +1 -1
@@ -359,7 +359,7 @@ void mv88e6xxx_poll_link(struct dsa_switch *ds)for (i =0 ; i <DSA_MAX_PORTS ; i++) {struct net_device *dev; -int uninitialized_var (port_status ); +int port_status =0 ;int link;int speed;int duplex;
drivers/net/ethernet/broadcom/bnx2.c +2 -2
@@ -1432,7 +1432,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp)static void bnx2_enable_forced_2g5 (struct bnx2 *bp) { -u32 uninitialized_var (bmcr ); +u32 bmcr =0 ;int err;if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ))
@@ -1476,7 +1476,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp)static void bnx2_disable_forced_2g5 (struct bnx2 *bp) { -u32 uninitialized_var (bmcr ); +u32 bmcr =0 ;int err;if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ))
drivers/net/ethernet/neterion/s2io.c +1 -1
@@ -7331,7 +7331,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)int ring_no = ring_data->ring_no;u16 l3_csum, l4_csum;unsigned long long err = rxdp->Control_1 &RXD_T_CODE ; -struct lro *uninitialized_var (lro ); +struct lro *lro =NULL ;u8 err_mask;struct swStat *swstats = &sp->mac_control.stats_info->sw_stat;
drivers/net/ethernet/qlogic/qla3xxx.c +1 -1
@@ -3778,7 +3778,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,struct net_device *ndev =NULL ;struct ql3_adapter *qdev =NULL ;static int cards_found; -int uninitialized_var (pci_using_dac ), err; +int pci_using_dac =0 , err; err =pci_enable_device (pdev);if (err) {
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -5669,7 +5669,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, {struct skb_shared_info *info =skb_shinfo (skb);unsigned int cur_frag, entry; -struct TxDesc *uninitialized_var (txd ); +struct TxDesc * txd =NULL ;struct device *d = &tp->pci_dev->dev; entry = tp->cur_tx;
drivers/net/ethernet/sis/sis900.c +1 -1
@@ -1319,7 +1319,7 @@ static void sis900_timer(unsigned long data)u16 status;if (!sis_priv->autong_complete){ -int uninitialized_var (speed ), duplex =0 ; +int speed =0 , duplex =0 ;sis900_read_mode (net_dev, &speed, &duplex);if (duplex){
drivers/net/ethernet/sun/cassini.c +1 -1
@@ -2305,7 +2305,7 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget) drops =0 ;while (1 ) {struct cas_rx_comp *rxc = rxcs + entry; -struct sk_buff *uninitialized_var (skb ); +struct sk_buff *skb =NULL ;int type, len;u64 words[4 ];int i, dring;
drivers/net/ethernet/sun/niu.c +3 -3
@@ -428,7 +428,7 @@ static int serdes_init_niu_1g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;u16 pll_cfg, pll_sts;int max_retry =100 ; -u64 uninitialized_var (sig ), mask, val; +u64 sig =0 , mask, val;u32 tx_cfg, rx_cfg;unsigned long i;int err;
@@ -525,7 +525,7 @@ static int serdes_init_niu_10g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;u32 tx_cfg, rx_cfg, pll_cfg, pll_sts;int max_retry =100 ; -u64 uninitialized_var (sig ), mask, val; +u64 sig =0 , mask, val;unsigned long i;int err;
@@ -713,7 +713,7 @@ static int esr_write_glue0(struct niu *np, unsigned long chan, u32 val)static int esr_reset (struct niu *np) { -u32 uninitialized_var (reset ); +u32 reset =0 ;int err; err = mdio_write(np, np->port, NIU_ESR_DEV_ADDR,
drivers/net/wan/z85230.c +1 -1
@@ -707,7 +707,7 @@ EXPORT_SYMBOL(z8530_nop);irqreturn_t z8530_interrupt (int irq,void *dev_id) {struct z8530_dev *dev=dev_id; -u8 uninitialized_var (intr ); +u8 intr =0 ;static volatile int locker=0 ;int work=0 ;struct z8530_irqhandler *irqs;
drivers/net/wireless/ath/ath6kl/init.c +1 -1
@@ -1475,7 +1475,7 @@ static int ath6kl_init_upload(struct ath6kl *ar)int ath6kl_init_hw_params (struct ath6kl *ar) { -const struct ath6kl_hw *uninitialized_var (hw ); +const struct ath6kl_hw *hw =NULL ;int i;for (i =0 ; i <ARRAY_SIZE (hw_list); i++) {
drivers/net/wireless/ath/ath9k/init.c +1 -1
@@ -222,7 +222,7 @@ static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clstruct ath_hw *ah = (struct ath_hw *) hw_priv;struct ath_common *common =ath9k_hw_common (ah);struct ath_softc *sc = (struct ath_softc *) common->priv; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;u32 val;if (NR_CPUS >1 && ah->config.serialize_regmode ==SER_REG_MODE_ON ) {
drivers/net/wireless/b43/debugfs.c +1 -1
@@ -506,7 +506,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,struct b43_wldev *dev;struct b43_debugfs_fops *dfops;struct b43_dfs_file *dfile; -ssize_t uninitialized_var (ret ); +ssize_t ret =0 ;char *buf;const size_t bufsize =1024 *16 ;/* 16 kiB buffer */ const size_t buforder =get_order (bufsize);
drivers/net/wireless/b43/dma.c +1 -1
@@ -50,7 +50,7 @@static u32 b43_dma_address (struct b43_dma *dma,dma_addr_t dmaaddr,enum b43_addrtype addrtype) { -u32 uninitialized_var (addr ); +u32 addr =0 ;switch (addrtype) {case B43_DMA_ADDR_LOW :
drivers/net/wireless/b43/lo.c +1 -1
@@ -742,7 +742,7 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev, };int max_rx_gain;struct b43_lo_calib *cal; -struct lo_g_saved_values uninitialized_var (saved_regs ); +struct lo_g_saved_values saved_regs = { };/* Values from the "TXCTL Register and Value Table" */ u16 txctl_reg;u16 txctl_value;
drivers/net/wireless/b43/main.c +1 -1
@@ -3705,7 +3705,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)struct b43_wldev *down_dev;struct b43_wldev *d;int err; -bool uninitialized_var (gmode ); +bool gmode =0 ;int prev_status;/* Find a device and PHY which supports the band. */
drivers/net/wireless/b43/phy_n.c +1 -1
@@ -4569,7 +4569,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,u8 rfctl[2 ];u8 afectl_core;u16 tmp[6 ]; -u16 uninitialized_var (cur_hpf1 ),uninitialized_var (cur_hpf2 ), cur_lna; +u16 cur_hpf1 =0 , cur_hpf2 =0 , cur_lna;u32 real, imag;enum ieee80211_band band;
drivers/net/wireless/b43/xmit.c +6 -6
@@ -427,10 +427,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,if ((rates[0 ].flags &IEEE80211_TX_RC_USE_RTS_CTS ) || (rates[0 ].flags &IEEE80211_TX_RC_USE_CTS_PROTECT )) {unsigned int len; -struct ieee80211_hdr *uninitialized_var (hdr ); +struct ieee80211_hdr *hdr =NULL ;int rts_rate, rts_rate_fb;int rts_rate_ofdm, rts_rate_fb_ofdm; -struct b43_plcp_hdr6 *uninitialized_var (plcp ); +struct b43_plcp_hdr6 *plcp =NULL ;struct ieee80211_rate *rts_cts_rate; rts_cts_rate =ieee80211_get_rts_cts_rate (dev->wl->hw, info);
@@ -441,7 +441,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, rts_rate_fb_ofdm =b43_is_ofdm_rate (rts_rate_fb);if (rates[0 ].flags &IEEE80211_TX_RC_USE_CTS_PROTECT ) { -struct ieee80211_cts *uninitialized_var (cts ); +struct ieee80211_cts *cts =NULL ;switch (dev->fw.hdr_format) {case B43_FW_HDR_598 :
@@ -463,7 +463,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, mac_ctl |=B43_TXH_MAC_SENDCTS ; len =sizeof (struct ieee80211_cts ); }else { -struct ieee80211_rts *uninitialized_var (rts ); +struct ieee80211_rts *rts =NULL ;switch (dev->fw.hdr_format) {case B43_FW_HDR_598 :
@@ -659,8 +659,8 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)const struct b43_rxhdr_fw4 *rxhdr = _rxhdr;__le16 fctl;u16 phystat0, phystat3; -u16 uninitialized_var (chanstat ),uninitialized_var (mactime ); -u32 uninitialized_var (macstat ); +u16 chanstat =0 , mactime =0 ; +u32 macstat =0 ;u16 chanid;u16 phytype;int padding, rate_idx;
drivers/net/wireless/b43legacy/debugfs.c +1 -1
@@ -203,7 +203,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,struct b43legacy_wldev *dev;struct b43legacy_debugfs_fops *dfops;struct b43legacy_dfs_file *dfile; -ssize_t uninitialized_var (ret ); +ssize_t ret =0 ;char *buf;const size_t bufsize =1024 *16 ;/* 16 KiB buffer */ const size_t buforder =get_order (bufsize);
drivers/net/wireless/b43legacy/main.c +1 -1
@@ -2588,7 +2588,7 @@ static void b43legacy_put_phy_into_reset(struct b43legacy_wldev *dev)static int b43legacy_switch_phymode (struct b43legacy_wl *wl,unsigned int new_mode) { -struct b43legacy_wldev *uninitialized_var (up_dev ); +struct b43legacy_wldev *up_dev =NULL ;struct b43legacy_wldev *down_dev;int err;bool gmode = false;
drivers/net/wireless/iwlegacy/3945.c +1 -1
@@ -2092,7 +2092,7 @@ il3945_txpower_set_from_eeprom(struct il_priv *il)/* set tx power value for all OFDM rates */ for (rate_idx =0 ; rate_idx <IL_OFDM_RATES ; rate_idx++) { -s32 uninitialized_var (power_idx ); +s32 power_idx =0 ;int rc;/* use channel group's clip-power table,
drivers/net/wireless/iwlegacy/4965-mac.c +1 -1
@@ -2754,7 +2754,7 @@ il4965_hdl_tx(struct il_priv *il, struct il_rx_buf *rxb)struct ieee80211_tx_info *info;struct il4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0 ];u32 status =le32_to_cpu (tx_resp->u.status); -int uninitialized_var (tid ); +int tid =0 ;int sta_id;int freed;u8 *qc =NULL ;
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +3 -3
@@ -643,7 +643,7 @@ static void _rtl92cu_init_chipN_one_out_ep_priority(struct ieee80211_hw *hw, bool wmm_enable, u8 queue_sel) { -u16 uninitialized_var (value ); +u16 value =0 ;switch (queue_sel) {case TX_SELE_HQ :
@@ -669,8 +669,8 @@ static void _rtl92cu_init_chipN_two_out_ep_priority(struct ieee80211_hw *hw, u8 queue_sel) {u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ; -u16 uninitialized_var (valueHi ); -u16 uninitialized_var (valueLow ); +u16 valueHi =0 ; +u16 valueLow =0 ;switch (queue_sel) {case (TX_SELE_HQ |TX_SELE_LQ ):
drivers/net/xen-netback/netback.c +1 -1
@@ -412,7 +412,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,* These variables are used iff get_page_ext returns true, * in which case they are guaranteed to be initialized. */ -unsigned int uninitialized_var (group ),uninitialized_var (idx ); +unsigned int group =0 , idx =0 ;int foreign =get_page_ext (page, &group, &idx);unsigned long bytes;
drivers/pci/pcie/aer/aerdrv_core.c +1 -1
@@ -783,7 +783,7 @@ void aer_isr(struct work_struct *work) { struct aer_rpc *rpc = container_of(work, struct aer_rpc, dpc_handler);struct pcie_device *p_device = rpc->rpd; -struct aer_err_source uninitialized_var (e_src ); +struct aer_err_source e_src = { };mutex_lock (&rpc->rpc_mutex);while (get_e_source (rpc, &e_src))
drivers/platform/x86/hdaps.c +2 -2
@@ -379,7 +379,7 @@ static ssize_t hdaps_variance_show(struct device *dev,static ssize_t hdaps_temp1_show (struct device *dev,struct device_attribute *attr,char *buf) { -u8 uninitialized_var (temp ); +u8 temp =0 ;int ret; ret =hdaps_readb_one (HDAPS_PORT_TEMP1 , &temp);
@@ -392,7 +392,7 @@ static ssize_t hdaps_temp1_show(struct device *dev,static ssize_t hdaps_temp2_show (struct device *dev,struct device_attribute *attr,char *buf) { -u8 uninitialized_var (temp ); +u8 temp =0 ;int ret; ret =hdaps_readb_one (HDAPS_PORT_TEMP2 , &temp);
drivers/s390/cio/cio.c +1 -1
@@ -1029,7 +1029,7 @@ extern void do_reipl_asm(__u32 schid);/* Make sure all subchannels are quiet before we re-ipl an lpar. */ void reipl_ccw_dev (struct ccw_dev_id *devid) { -struct subchannel_id uninitialized_var (schid ); +struct subchannel_id schid = { };s390_reset_system (NULL ,NULL );if (reipl_find_schid (devid, &schid) !=0 )
drivers/scsi/dc395x.c +1 -1
@@ -4268,7 +4268,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)const unsigned srbs_per_page =PAGE_SIZE /SEGMENTX_LEN ;int srb_idx =0 ;unsigned i =0 ; -struct SGentry *uninitialized_var (ptr ); +struct SGentry *ptr =NULL ;for (i =0 ; i < DC395x_MAX_SRB_CNT; i++) acb->srb_array[i].segment_x =NULL ;
drivers/scsi/pm8001/pm8001_hwi.c +1 -1
@@ -3874,7 +3874,7 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha) {struct outbound_queue_table *circularQ;void *pMsg1 =NULL ; -u8 uninitialized_var (bc ); +u8 bc =0 ;u32 ret =MPI_IO_STATUS_FAIL ;unsigned long flags;
drivers/spi/spi-davinci.c +1 -1
@@ -529,7 +529,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)u32 errors =0 ;struct davinci_spi_config *spicfg;struct davinci_spi_platform_data *pdata; -unsigned uninitialized_var (rx_buf_count ); +unsigned rx_buf_count =0 ;void *dummy_buf =NULL ;struct scatterlist sg_rx, sg_tx;
drivers/ssb/driver_chipcommon.c +2 -2
@@ -117,7 +117,7 @@ void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,static enum ssb_clksrc chipco_pctl_get_slowclksrc (struct ssb_chipcommon *cc) {struct ssb_bus *bus = cc->dev->bus; -u32 uninitialized_var (tmp ); +u32 tmp =0 ;if (cc->dev->id.revision <6 ) { if (bus->bustype == SSB_BUSTYPE_SSB ||
@@ -147,7 +147,7 @@ static enum ssb_clksrc chipco_pctl_get_slowclksrc(struct ssb_chipcommon *cc)/* Get maximum or minimum (depending on get_max flag) slowclock frequency. */ static int chipco_pctl_clockfreqlimit (struct ssb_chipcommon *cc,int get_max) { -int uninitialized_var (limit ); +int limit =0 ;enum ssb_clksrc clocksrc;int divisor =1 ;u32 tmp;
drivers/staging/zsmalloc/zsmalloc-main.c +1 -1
@@ -555,7 +555,7 @@ static void init_zspage(struct page *first_page, struct size_class *class)static struct page *alloc_zspage (struct size_class *class,gfp_t flags) {int i, error; -struct page *first_page =NULL , *uninitialized_var (prev_page ); +struct page *first_page =NULL , *prev_page =NULL ;/* * Allocate individual pages and link them together as:
drivers/tty/cyclades.c +1 -1
@@ -3698,7 +3698,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,struct cyclades_card *card;void __iomem *addr0 =NULL , *addr2 =NULL ;char *card_name =NULL ; -u32 uninitialized_var (mailbox ); +u32 mailbox =0 ;unsigned int device_id, nchan =0 , card_no, i, j;unsigned char plx_ver;int retval, irq;
drivers/tty/isicom.c +1 -1
@@ -1551,7 +1551,7 @@ static unsigned int card_count;static int __devinit isicom_probe (struct pci_dev *pdev,const struct pci_device_id *ent) { -unsigned int uninitialized_var (signature ), index; +unsigned int signature =0 , index;int retval = -EPERM ;struct isi_board *board =NULL ;
drivers/usb/gadget/uvc_queue.c +1 -1
@@ -413,7 +413,7 @@ static struct vm_operations_struct uvc_vm_ops = {static int uvc_queue_mmap (struct uvc_video_queue *queue,struct vm_area_struct *vma) { -struct uvc_buffer *uninitialized_var (buffer ); +struct uvc_buffer *buffer =NULL ;struct page *page;unsigned long addr, start, size;unsigned int i;
drivers/usb/musb/cppi_dma.c +1 -1
@@ -1167,7 +1167,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)struct musb_hw_ep *hw_ep =NULL ;u32 rx, tx;int i, index; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ; cppi = container_of(musb->dma_controller, struct cppi, controller);if (cppi->irq)
drivers/usb/storage/sddr55.c +2 -2
@@ -563,8 +563,8 @@ static int sddr55_reset(struct us_data *us)static unsigned long sddr55_get_capacity (struct us_data *us) { -unsigned char uninitialized_var (manufacturerID ); -unsigned char uninitialized_var (deviceID ); +unsigned char manufacturerID =0 ; +unsigned char deviceID =0 ;int result;struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra;
drivers/vhost/net.c +2 -2
@@ -145,7 +145,7 @@ static void handle_tx(struct vhost_net *net)int err, wmem;size_t hdr_size;struct socket *sock; -struct vhost_ubuf_ref *uninitialized_var (ubufs ); +struct vhost_ubuf_ref *ubufs =NULL ;bool zcopy;/* TODO: check that we are running from vhost_worker? */
@@ -364,7 +364,7 @@ err:static void handle_rx (struct vhost_net *net) {struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_RX ]; -unsigned uninitialized_var (in ), log; +unsigned in =0 , log;struct vhost_log *vq_log;struct msghdr msg = { .msg_name =NULL ,
drivers/vhost/vhost.c +1 -1
@@ -189,7 +189,7 @@ static int vhost_worker(void *data) {struct vhost_dev *dev = data;struct vhost_work *work =NULL ; -unsigned uninitialized_var (seq ); +unsigned seq =0 ;mm_segment_t oldfs =get_fs ();set_fs (USER_DS );
drivers/video/matrox/matroxfb_maven.c +3 -3
@@ -285,7 +285,7 @@ static int matroxfb_mavenclock(const struct matrox_pll_ctl *ctl, unsigned int* in, unsigned int* feed, unsigned int* post, unsigned int* htotal2) { unsigned int fvco; -unsigned int uninitialized_var (p ); +unsigned int p =0 ; fvco =matroxfb_PLL_mavenclock (&maven1000_pll, ctl, htotal, vtotal, in, feed, &p, htotal2);if (!fvco)
@@ -717,8 +717,8 @@ static int maven_find_exact_clocks(unsigned int ht, unsigned int vt,for (x =0 ; x <8 ; x++) {unsigned int c; -unsigned int uninitialized_var (a ),uninitialized_var (b ), -uninitialized_var (h2 ); +unsigned int a =0 , b =0 , + h2 =0 ;unsigned int h = ht +2 + x;if (!matroxfb_mavenclock ((m->mode ==MATROXFB_OUTPUT_MODE_PAL ) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) {
drivers/video/pm3fb.c +3 -3
@@ -828,9 +828,9 @@ static void pm3fb_write_mode(struct fb_info *info)wmb (); { -unsigned char uninitialized_var (m );/* ClkPreScale */ -unsigned char uninitialized_var (n );/* ClkFeedBackScale */ -unsigned char uninitialized_var (p );/* ClkPostScale */ +unsigned char m =0 ;/* ClkPreScale */ +unsigned char n =0 ;/* ClkFeedBackScale */ +unsigned char p =0 ;/* ClkPostScale */ unsigned long pixclock =PICOS2KHZ (info->var.pixclock); (void )pm3fb_calculate_clock (pixclock, &m, &n, &p);
drivers/video/riva/riva_hw.c +2 -2
@@ -1243,8 +1243,8 @@ int CalcStateExt ) {int pixelDepth; -int uninitialized_var (VClk ),uninitialized_var (m ), -uninitialized_var (n ),uninitialized_var (p ); +int VClk =0 ,m =0 , + n =0 , p =0 ;/* * Save mode parameters.
drivers/virtio/virtio_ring.c +1 -1
@@ -206,7 +206,7 @@ int virtqueue_add_buf(struct virtqueue *_vq, gfp_t gfp) {struct vring_virtqueue *vq =to_vvq (_vq); -unsigned int i, avail,uninitialized_var (prev ); +unsigned int i, avail, prev =0 ;int head;START_USE (vq);
fs/afs/dir.c +1 -1
@@ -601,7 +601,7 @@ success:static int afs_d_revalidate (struct dentry *dentry,unsigned int flags) {struct afs_vnode *vnode, *dir; -struct afs_fid uninitialized_var (fid ); +struct afs_fid fid = { };struct dentry *parent;struct key *key;void *dir_version;
fs/afs/security.c +1 -1
@@ -288,7 +288,7 @@ static int afs_check_permit(struct afs_vnode *vnode, struct key *key,int afs_permission (struct inode *inode,int mask) {struct afs_vnode *vnode =AFS_FS_I (inode); -afs_access_t uninitialized_var (access ); +afs_access_t access =0 ;struct key *key;int ret;
fs/binfmt_flat.c +1 -1
@@ -127,7 +127,7 @@ static unsigned long create_flat_tables(char * p = (char *)pp;int argc = bprm->argc;int envc = bprm->envc; -char uninitialized_var (dummy ); +char dummy =0 ; sp = (unsigned long *)p; sp -= (envc + argc +2 ) +1 + (flat_argvp_envp_on_stack () ?2 :0 );
fs/dlm/netlink.c +1 -1
@@ -114,7 +114,7 @@ static void fill_data(struct dlm_lock_data *data, struct dlm_lkb *lkb)void dlm_timeout_warn (struct dlm_lkb *lkb) { -struct sk_buff *uninitialized_var (send_skb ); +struct sk_buff *send_skb =NULL ;struct dlm_lock_data *data;size_t size;int rv;
fs/fat/dir.c +1 -1
@@ -1249,7 +1249,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,struct super_block *sb = dir->i_sb;struct msdos_sb_info *sbi =MSDOS_SB (sb);struct buffer_head *bh, *prev, *bhs[3 ];/* 32*slots (672bytes) */ -struct msdos_dir_entry *uninitialized_var (de ); +struct msdos_dir_entry *de =NULL ;int err, free_slots, i, nr_bhs;loff_t pos, i_pos;
fs/fuse/control.c +2 -2
@@ -117,7 +117,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned uninitialized_var(val); + unsigned val = 0;ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
@@ -154,7 +154,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned uninitialized_var(val); + unsigned val = 0;ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
fs/gfs2/recovery.c +1 -1
@@ -151,7 +151,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk, struct gfs2_log_header_host *head) {struct buffer_head *bh; -struct gfs2_log_header_host uninitialized_var (lh ); +struct gfs2_log_header_host lh = { };const u32 nothing =0 ;u32 hash;int error;
fs/hfsplus/unicode.c +1 -1
@@ -350,7 +350,7 @@ int hfsplus_hash_dentry(const struct dentry *dentry, const struct inode *inode, astr = str->name; len = str->len;while (len >0 ) { -int uninitialized_var (dsize ); +int dsize =0 ; size =asc2unichar (sb, astr, len, &c); astr += size; len -= size;
fs/isofs/namei.c +2 -2
@@ -166,8 +166,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,struct dentry *isofs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) {int found; -unsigned long uninitialized_var (block ); -unsigned long uninitialized_var (offset ); +unsigned long block =0 ; +unsigned long offset =0 ;struct inode *inode;struct page *page;
fs/jffs2/erase.c +1 -1
@@ -428,7 +428,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb {size_t retlen;int ret; -uint32_t uninitialized_var (bad_offset ); +uint32_t bad_offset =0 ;switch (jffs2_block_check_erase (c, jeb, &bad_offset)) {case -EAGAIN : goto refile;
fs/nfsd/nfsctl.c +1 -1
@@ -315,7 +315,7 @@ static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)static ssize_t write_filehandle (struct file *file,char *buf,size_t size) {char *dname, *path; -int uninitialized_var (maxsize ); +int maxsize =0 ;char *mesg = buf;int len;struct auth_domain *dom;
fs/ocfs2/alloc.c +2 -2
@@ -4671,7 +4671,7 @@ int ocfs2_insert_extent(handle_t *handle, struct ocfs2_alloc_context *meta_ac) {int status; -int uninitialized_var (free_records ); +int free_records =0 ;struct buffer_head *last_eb_bh =NULL ;struct ocfs2_insert_type insert = {0 , };struct ocfs2_extent_rec rec;
@@ -6807,7 +6807,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, {int ret, i, has_data, num_pages =0 ;handle_t *handle; -u64 uninitialized_var (block ); +u64 block =0 ;struct ocfs2_inode_info *oi =OCFS2_I (inode);struct ocfs2_super *osb =OCFS2_SB (inode->i_sb);struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
fs/ocfs2/dir.c +7 -7
@@ -876,9 +876,9 @@ static int ocfs2_dx_dir_lookup(struct inode *inode, u64 *ret_phys_blkno) {int ret =0 ; -unsigned int cend,uninitialized_var (clen ); -u32 uninitialized_var (cpos ); -u64 uninitialized_var (blkno ); +unsigned int cend, clen =0 ; +u32 cpos =0 ; +u64 blkno =0 ;u32 name_hash = hinfo->major_hash; ret = ocfs2_dx_dir_lookup_rec(inode, el, name_hash, &cpos, &blkno,
@@ -922,7 +922,7 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, struct ocfs2_dir_lookup_result *res) {int ret, i, found; -u64 uninitialized_var (phys ); +u64 phys =0 ;struct buffer_head *dx_leaf_bh =NULL ;struct ocfs2_dx_leaf *dx_leaf;struct ocfs2_dx_entry *dx_entry =NULL ;
@@ -4486,9 +4486,9 @@ out:int ocfs2_dx_dir_truncate (struct inode *dir,struct buffer_head *di_bh) {int ret; -unsigned int uninitialized_var (clen ); -u32 major_hash =UINT_MAX , p_cpos,uninitialized_var (cpos ); -u64 uninitialized_var (blkno ); +unsigned int clen =0 ; +u32 major_hash =UINT_MAX , p_cpos, cpos =0 ; +u64 blkno =0 ;struct ocfs2_super *osb =OCFS2_SB (dir->i_sb);struct buffer_head *dx_root_bh =NULL ;struct ocfs2_dx_root_block *dx_root;
fs/ocfs2/extent_map.c +2 -2
@@ -416,7 +416,7 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, {int i, ret, tree_height, len;struct ocfs2_dinode *di; -struct ocfs2_extent_block *uninitialized_var (eb ); +struct ocfs2_extent_block *eb =NULL ;struct ocfs2_extent_list *el;struct ocfs2_extent_rec *rec;struct buffer_head *eb_bh =NULL ;
@@ -611,7 +611,7 @@ int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, unsigned int *extent_flags) {int ret; -unsigned int uninitialized_var (hole_len ), flags =0 ; +unsigned int hole_len =0 , flags =0 ;struct buffer_head *di_bh =NULL ;struct ocfs2_extent_rec rec;
fs/ocfs2/namei.c +1 -1
@@ -2234,7 +2234,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,struct buffer_head *new_di_bh =NULL ;struct ocfs2_alloc_context *inode_ac =NULL ;struct ocfs2_dir_lookup_result orphan_insert = {NULL , }; -u64 uninitialized_var (di_blkno ), suballoc_loc; +u64 di_blkno =0 , suballoc_loc;u16 suballoc_bit; status =ocfs2_inode_lock (dir, &parent_di_bh,1 );
fs/ocfs2/refcounttree.c +1 -1
@@ -1066,7 +1066,7 @@ static int ocfs2_get_refcount_rec(struct ocfs2_caching_info *ci, struct buffer_head **ret_bh) {int ret =0 , i, found; -u32 low_cpos,uninitialized_var (cpos_end ); +u32 low_cpos, cpos_end =0 ;struct ocfs2_extent_list *el;struct ocfs2_extent_rec *rec =NULL ;struct ocfs2_extent_block *eb =NULL ;
fs/ocfs2/stack_user.c +1 -1
@@ -802,7 +802,7 @@ static int fs_protocol_compare(struct ocfs2_protocol_version *existing,static int user_cluster_connect (struct ocfs2_cluster_connection *conn) {dlm_lockspace_t *fsdlm; -struct ocfs2_live_connection *uninitialized_var (control ); +struct ocfs2_live_connection *control =NULL ;int rc =0 ;BUG_ON (conn ==NULL );
fs/ocfs2/xattr.c +1 -1
@@ -1195,7 +1195,7 @@ static int ocfs2_xattr_block_get(struct inode *inode,struct ocfs2_xattr_value_root *xv;size_t size;int ret = -ENODATA , name_offset, name_len, i; -int uninitialized_var (block_off ); +int block_off =0 ; xs->bucket =ocfs2_xattr_bucket_new (inode);if (!xs->bucket) {
fs/omfs/file.c +1 -1
@@ -220,7 +220,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,struct buffer_head *bh;sector_t next, offset;int ret; -u64 uninitialized_var (new_block ); +u64 new_block =0 ;u32 max_extents;int extent_count;struct omfs_extent *oe;
fs/ubifs/budget.c +1 -1
@@ -437,7 +437,7 @@ static int calc_dd_growth(const struct ubifs_info *c,*/ int ubifs_budget_space (struct ubifs_info *c,struct ubifs_budget_req *req) { -int uninitialized_var (cmt_retries ),uninitialized_var (wb_retries ); +int cmt_retries =0 , wb_retries =0 ;int err, idx_growth, data_growth, dd_growth, retried =0 ;ubifs_assert (req->new_page <=1 );
fs/ubifs/commit.c +3 -3
@@ -568,11 +568,11 @@ out:*/ int dbg_check_old_index (struct ubifs_info *c,struct ubifs_zbranch *zroot) { -int lnum, offs, len, err =0 ,uninitialized_var (last_level ), child_cnt; +int lnum, offs, len, err =0 , last_level =0 , child_cnt;int first =1 , iip;struct ubifs_debug_info *d = c->dbg; -union ubifs_key uninitialized_var (lower_key ), upper_key, l_key, u_key; -unsigned long long uninitialized_var (last_sqnum ); +union ubifs_key lower_key = { }, upper_key, l_key, u_key; +unsigned long long last_sqnum =0 ;struct ubifs_idx_node *idx;struct list_head list;struct idx_node *i;
fs/ubifs/dir.c +1 -1
@@ -969,7 +969,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,struct ubifs_budget_req ino_req = { .dirtied_ino =1 , .dirtied_ino_d =ALIGN (old_inode_ui->data_len,8 ) };struct timespec time; -unsigned int uninitialized_var (saved_nlink ); +unsigned int saved_nlink =0 ;/* * Budget request settings: deletion direntry, new direntry, removing
fs/ubifs/file.c +2 -2
@@ -225,7 +225,7 @@ static int write_begin_slow(struct address_space *mapping,struct ubifs_info *c = inode->i_sb->s_fs_info;pgoff_t index = pos >>PAGE_CACHE_SHIFT ;struct ubifs_budget_req req = { .new_page =1 }; -int uninitialized_var (err ), appending = !!(pos + len > inode->i_size); +int err =0 , appending = !!(pos + len > inode->i_size);struct page *page; dbg_gen("ino %lu, pos %llu, len %u, i_size %lld",
@@ -428,7 +428,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,struct ubifs_info *c = inode->i_sb->s_fs_info;struct ubifs_inode *ui =ubifs_inode (inode);pgoff_t index = pos >>PAGE_CACHE_SHIFT ; -int uninitialized_var (err ), appending = !!(pos + len > inode->i_size); +int err =0 , appending = !!(pos + len > inode->i_size);int skipped_read =0 ;struct page *page;
fs/ubifs/journal.c +2 -2
@@ -931,7 +931,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,int aligned_dlen1, aligned_dlen2, plen =UBIFS_INO_NODE_SZ ;int last_reference = !!(new_inode && new_inode->i_nlink ==0 );int move = (old_dir != new_dir); -struct ubifs_inode *uninitialized_var (new_ui ); +struct ubifs_inode *new_ui =NULL ; dbg_jnl("dent '%.*s' in dir ino %lu to dent '%.*s' in dir ino %lu", old_dentry->d_name.len, old_dentry->d_name.name,
@@ -1145,7 +1145,7 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,union ubifs_key key, to_key;struct ubifs_ino_node *ino;struct ubifs_trun_node *trun; -struct ubifs_data_node *uninitialized_var (dn ); +struct ubifs_data_node *dn =NULL ;int err, dlen, len, lnum, offs, bit, sz, sync =IS_SYNC (inode);struct ubifs_inode *ui =ubifs_inode (inode);ino_t inum = inode->i_ino;
fs/ubifs/lpt.c +1 -1
@@ -285,7 +285,7 @@ uint32_t ubifs_unpack_bits(uint8_t **addr, int *pos, int nrbits)const int k =32 - nrbits;uint8_t *p = *addr;int b = *pos; -uint32_t uninitialized_var (val ); +uint32_t val =0 ;const int bytes = (nrbits + b +7 ) >>3 ;ubifs_assert (nrbits >0 );
fs/ubifs/tnc.c +3 -3
@@ -898,7 +898,7 @@ static int fallible_resolve_collision(struct ubifs_info *c, const struct qstr *nm, int adding) {struct ubifs_znode *o_znode =NULL , *znode = *zn; -int uninitialized_var (o_n ), err, cmp, unsure =0 , nn = *n; +int o_n =0 , err, cmp, unsure =0 , nn = *n; cmp =fallible_matches_name (c, &znode->zbranch[nn], nm);if (unlikely (cmp <0 ))
@@ -1519,8 +1519,8 @@ out:*/ int ubifs_tnc_get_bu_keys (struct ubifs_info *c,struct bu_info *bu) { -int n, err =0 , lnum =-1 ,uninitialized_var (offs ); -int uninitialized_var (len ); +int n, err =0 , lnum =-1 , offs =0 ; +int len =0 ;unsigned int block =key_block (c, &bu->key);struct ubifs_znode *znode;
fs/ubifs/tnc_misc.c +2 -2
@@ -136,8 +136,8 @@ int ubifs_search_zbranch(const struct ubifs_info *c,const struct ubifs_znode *znode, const union ubifs_key *key, int *n) { - int beg = 0, end = znode->child_cnt, uninitialized_var(mid); -int uninitialized_var (cmp ); + int beg = 0, end = znode->child_cnt, mid = 0; +int cmp =0 ;const struct ubifs_zbranch *zbr = &znode->zbranch[0 ];ubifs_assert (end > beg);
fs/udf/balloc.c +1 -1
@@ -645,7 +645,7 @@ static int udf_table_new_block(struct super_block *sb,uint32_t spread =0xFFFFFFFF , nspread =0xFFFFFFFF ;uint32_t newblock =0 , adsize;uint32_t elen, goal_elen =0 ; -struct kernel_lb_addr eloc,uninitialized_var (goal_eloc ); +struct kernel_lb_addr eloc, goal_eloc = { };struct extent_position epos, goal_epos;int8_t etype;struct udf_inode_info *iinfo =UDF_I (table);
fs/xfs/xfs_bmap.c +1 -1
@@ -2218,7 +2218,7 @@ xfs_bmap_rtalloc(* pick an extent that will space things out in the rt area. */ if (ap->eof && ap->offset ==0 ) { -xfs_rtblock_t uninitialized_var (rtx );/* realtime extent no */ +xfs_rtblock_t rtx =0 ;/* realtime extent no */ error =xfs_rtpick_extent (mp, ap->tp, ralen, &rtx);if (error)
fs/xfs/xfs_file.c +2 -2
@@ -1185,7 +1185,7 @@ xfs_seek_data(struct inode *inode = file->f_mapping->host;struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount; -loff_t uninitialized_var (offset ); +loff_t offset =0 ;xfs_fsize_t isize;xfs_fileoff_t fsbno;xfs_filblks_t end;
@@ -1287,7 +1287,7 @@ xfs_seek_hole(struct inode *inode = file->f_mapping->host;struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount; -loff_t uninitialized_var (offset ); +loff_t offset =0 ;xfs_fsize_t isize;xfs_fileoff_t fsbno;xfs_filblks_t end;
include/linux/compiler-gcc.h +0 -6
@@ -103,10 +103,4 @@#define __noclone/* not needed */ #endif -/* -* A trick to suppress uninitialized variable warning without generating any -* code -*/ -#define uninitialized_var (x) x = x -#define __always_inline inline __attribute__((always_inline))
include/linux/compiler-intel.h +0 -2
@@ -27,5 +27,3 @@#define __must_be_array (a) 0#endif - -#define uninitialized_var (x) x
include/linux/mm.h +1 -1
@@ -337,7 +337,7 @@ static inline void compound_unlock(struct page *page)static inline unsigned long compound_lock_irqsave (struct page *page) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;#ifdef CONFIG_TRANSPARENT_HUGEPAGE local_irq_save (flags);compound_lock (page);
ipc/msg.c +1 -1
@@ -412,7 +412,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, struct msqid_ds __user *buf, int version) {struct kern_ipc_perm *ipcp; -struct msqid64_ds uninitialized_var (msqid64 ); +struct msqid64_ds msqid64 = { };struct msg_queue *msq;int err;
kernel/async.c +2 -2
@@ -119,7 +119,7 @@ static void async_run_entry_fn(struct work_struct *work)struct async_entry *entry = container_of(work, struct async_entry, work);unsigned long flags; -ktime_t uninitialized_var (calltime ), delta, rettime; +ktime_t calltime = { }, delta, rettime;struct async_domain *running = entry->running;/* 1) move self to the running queue */
@@ -302,7 +302,7 @@ EXPORT_SYMBOL_GPL(async_synchronize_full_domain);*/ void async_synchronize_cookie_domain (async_cookie_t cookie,struct async_domain *running) { -ktime_t uninitialized_var (starttime ), delta, endtime; +ktime_t starttime = { }, delta, endtime;if (!running)return ;
kernel/audit.c +1 -1
@@ -1124,7 +1124,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, {struct audit_buffer *ab =NULL ;struct timespec t; -unsigned int uninitialized_var (serial ); +unsigned int serial =0 ;int reserve;unsigned long timeout_start = jiffies;
kernel/debug/kdb/kdb_io.c +1 -1
@@ -562,7 +562,7 @@ int vkdb_printf(const char *fmt, va_list ap)char *moreprompt ="more> " ;struct console *c = console_drivers;static DEFINE_SPINLOCK (kdb_printf_lock); -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;preempt_disable (); saved_trap_printk = kdb_trap_printk;
kernel/events/uprobes.c +1 -1
@@ -1449,7 +1449,7 @@ static void handle_swbp(struct pt_regs *regs)struct uprobe_task *utask;struct uprobe *uprobe;unsigned long bp_vaddr; -int uninitialized_var (is_swbp ); +int is_swbp =0 ; bp_vaddr =uprobe_get_swbp_addr (regs); uprobe =find_active_uprobe (bp_vaddr, &is_swbp);
kernel/exit.c +1 -1
@@ -96,7 +96,7 @@ static void __exit_signal(struct task_struct *tsk)struct signal_struct *sig = tsk->signal;bool group_dead =thread_group_leader (tsk);struct sighand_struct *sighand; -struct tty_struct *uninitialized_var (tty ); +struct tty_struct *tty =NULL ; sighand =rcu_dereference_check (tsk->sighand,lockdep_tasklist_lock_is_held ());
kernel/futex.c +5 -5
@@ -867,7 +867,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) {struct task_struct *new_owner;struct futex_pi_state *pi_state = this->pi_state; -u32 uninitialized_var (curval ), newval; +u32 curval =0 , newval;if (!pi_state)return -EINVAL ;
@@ -929,7 +929,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)static int unlock_futex_pi (u32 __user *uaddr,u32 uval) { -u32 uninitialized_var (oldval ); +u32 oldval =0 ;/* * There is no waiter, so we unlock the futex. The owner died
@@ -1589,7 +1589,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,u32 newtid =task_pid_vnr (newowner) |FUTEX_WAITERS ;struct futex_pi_state *pi_state = q->pi_state;struct task_struct *oldowner = pi_state->owner; -u32 uval,uninitialized_var (curval ), newval; +u32 uval, curval =0 , newval;int ret;/* Owner died? */
@@ -2488,7 +2488,7 @@ err_unlock:*/ int handle_futex_death (u32 __user *uaddr,struct task_struct *curr,int pi) { -u32 uval,uninitialized_var (nval ), mval; +u32 uval, nval =0 , mval; retry:if (get_user (uval, uaddr))
@@ -2562,7 +2562,7 @@ void exit_robust_list(struct task_struct *curr)struct robust_list_head __user *head = curr->robust_list;struct robust_list __user *entry, *next_entry, *pending;unsigned int limit =ROBUST_LIST_LIMIT , pi, pip; -unsigned int uninitialized_var (next_pi ); +unsigned int next_pi =0 ;unsigned long futex_offset;int rc;
kernel/futex_compat.c +1 -1
@@ -51,7 +51,7 @@ void compat_exit_robust_list(struct task_struct *curr)struct compat_robust_list_head __user *head = curr->compat_robust_list;struct robust_list __user *entry, *next_entry, *pending;unsigned int limit =ROBUST_LIST_LIMIT , pi, pip; -unsigned int uninitialized_var (next_pi ); +unsigned int next_pi =0 ;compat_uptr_t uentry, next_uentry, upending;compat_long_t futex_offset;int rc;
kernel/lockdep.c +7 -7
@@ -1231,7 +1231,7 @@ static int noop_count(struct lock_list *entry, void *data)unsigned long __lockdep_count_forward_deps (struct lock_list *this) {unsigned long count =0 ; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;__bfs_forwards (this, (void *)&count, noop_count, &target_entry);
@@ -1257,7 +1257,7 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)unsigned long __lockdep_count_backward_deps (struct lock_list *this) {unsigned long count =0 ; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;__bfs_backwards (this, (void *)&count, noop_count, &target_entry);
@@ -1551,8 +1551,8 @@ check_usage(struct task_struct *curr, struct held_lock *prev, {int ret;struct lock_list this, that; -struct lock_list *uninitialized_var (target_entry ); -struct lock_list *uninitialized_var (target_entry1 ); +struct lock_list *target_entry =NULL ; +struct lock_list *target_entry1 =NULL ; this.parent =NULL ;
@@ -1808,7 +1808,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,struct lock_list *entry;int ret;struct lock_list this; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;/* * Static variable, serialized by the graph_lock(). *
@@ -2344,7 +2344,7 @@ check_usage_forwards(struct task_struct *curr, struct held_lock *this, {int ret;struct lock_list root; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ; root.parent =NULL ; root.class =hlock_class (this);
@@ -2368,7 +2368,7 @@ check_usage_backwards(struct task_struct *curr, struct held_lock *this, {int ret;struct lock_list root; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ; root.parent =NULL ; root.class =hlock_class (this);
lib/dma-debug.c +1 -1
@@ -725,7 +725,7 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **ostatic int dma_debug_device_change (struct notifier_block *nb,unsigned long action,void *data) {struct device *dev = data; -struct dma_debug_entry *uninitialized_var (entry ); +struct dma_debug_entry *entry =NULL ;int count;if (global_disable)
lib/radix-tree.c +2 -2
@@ -563,7 +563,7 @@ void *radix_tree_tag_clear(struct radix_tree_root *root,struct radix_tree_node *node =NULL ;struct radix_tree_node *slot =NULL ;unsigned int height, shift; -int uninitialized_var (offset ); +int offset =0 ; height = root->height;if (index >radix_tree_maxindex (height))
@@ -1313,7 +1313,7 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index)struct radix_tree_node *to_free;unsigned int height, shift;int tag; -int uninitialized_var (offset ); +int offset =0 ; height = root->height;if (index >radix_tree_maxindex (height))
mm/frontswap.c +1 -1
@@ -318,7 +318,7 @@ static int __frontswap_shrink(unsigned long target_pages,void frontswap_shrink (unsigned long target_pages) {unsigned long pages_to_unuse =0 ; -int uninitialized_var (type ), ret; +int type =0 , ret;/* * we don't want to hold swap_lock while doing a very
mm/ksm.c +1 -1
@@ -1431,7 +1431,7 @@ next_mm:static void ksm_do_scan (unsigned int scan_npages) {struct rmap_item *rmap_item; -struct page *uninitialized_var (page ); +struct page *page =NULL ;while (scan_npages-- &&likely (!freezing (current))) {cond_resched ();
mm/memcontrol.c +4 -4
@@ -948,7 +948,7 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, }while (!memcg) { -struct mem_cgroup_reclaim_iter *uninitialized_var (iter ); +struct mem_cgroup_reclaim_iter *iter =NULL ;struct cgroup_subsys_state *css;if (reclaim) {
@@ -1993,7 +1993,7 @@ void mem_cgroup_update_page_stat(struct page *page, {struct mem_cgroup *memcg;struct page_cgroup *pc =lookup_page_cgroup (page); -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;if (mem_cgroup_disabled ())return ;
@@ -2529,7 +2529,7 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, bool lrucare) {struct page_cgroup *pc =lookup_page_cgroup (page); -struct zone *uninitialized_var (zone ); +struct zone *zone =NULL ;struct lruvec *lruvec;bool was_on_lru = false;bool anon;
@@ -2706,7 +2706,7 @@ static int mem_cgroup_move_parent(struct page *page, {struct mem_cgroup *parent;unsigned int nr_pages; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;int ret;/* Is ROOT ? */
mm/memory.c +1 -1
@@ -2354,7 +2354,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,pte_t *pte;int err;pgtable_t token; -spinlock_t *uninitialized_var (ptl ); +spinlock_t *ptl =NULL ; pte = (mm == &init_mm) ? pte_alloc_kernel(pmd, addr) :
mm/mempolicy.c +3 -3
@@ -1089,7 +1089,7 @@ out:static struct page *new_vma_page (struct page *page,unsigned long private,int **x) {struct vm_area_struct *vma = (struct vm_area_struct *)private; -unsigned long uninitialized_var (address ); +unsigned long address =0 ;while (vma) { address =page_address_in_vma (page, vma);
@@ -1427,7 +1427,7 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, unsigned long, addr, unsigned long, flags) { int err; -int uninitialized_var (pval ); +int pval =0 ;nodemask_t nodes;if (nmask !=NULL && maxnode <MAX_NUMNODES )
@@ -2431,7 +2431,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) {struct mempolicy *new =NULL ;unsigned short mode; -unsigned short uninitialized_var (mode_flags ); +unsigned short mode_flags =0 ;nodemask_t nodes;char *nodelist =strchr (str,':' );char *flags =strchr (str,'=' );
mm/oom_kill.c +1 -1
@@ -696,7 +696,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,struct task_struct *p;unsigned long totalpages;unsigned long freed =0 ; -unsigned int uninitialized_var (points ); +unsigned int points =0 ;enum oom_constraint constraint =CONSTRAINT_NONE ;int killed =0 ;
mm/page-writeback.c +2 -2
@@ -244,7 +244,7 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty) {unsigned long background;unsigned long dirty; -unsigned long uninitialized_var (available_memory ); +unsigned long available_memory =0 ;struct task_struct *tsk;if (!vm_dirty_bytes || !dirty_background_bytes)
@@ -1713,7 +1713,7 @@ int write_cache_pages(struct address_space *mapping,int done =0 ;struct pagevec pvec;int nr_pages; -pgoff_t uninitialized_var (writeback_index ); +pgoff_t writeback_index =0 ;pgoff_t index;pgoff_t end;/* Inclusive */ pgoff_t done_index;
mm/page_alloc.c +1 -1
@@ -532,7 +532,7 @@ static inline void __free_one_page(struct page *page, {unsigned long page_idx;unsigned long combined_idx; -unsigned long uninitialized_var (buddy_idx ); +unsigned long buddy_idx =0 ;struct page *buddy;if (unlikely (PageCompound (page)))
mm/percpu.c +1 -1
@@ -1445,7 +1445,7 @@ static struct pcpu_alloc_info * __init pcpu_build_alloc_info(const size_t static_size = __per_cpu_end - __per_cpu_start;int nr_groups =1 , nr_units =0 ;size_t size_sum, min_unit_size, alloc_size; -int upa, max_upa,uninitialized_var (best_upa );/* units_per_alloc */ +int upa, max_upa, best_upa =0 ;/* units_per_alloc */ int last_allocs, group, unit;unsigned int cpu, tcpu;struct pcpu_alloc_info *ai;
mm/slub.c +1 -1
@@ -2463,7 +2463,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,struct page new;unsigned long counters;struct kmem_cache_node *n =NULL ; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;stat (s,FREE_SLOWPATH );
mm/swap.c +2 -2
@@ -673,7 +673,7 @@ void release_pages(struct page **pages, int nr, int cold)LIST_HEAD (pages_to_free);struct zone *zone =NULL ;struct lruvec *lruvec; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;for (i =0 ; i < nr; i++) {struct page *page = pages[i];
@@ -739,7 +739,7 @@ EXPORT_SYMBOL(__pagevec_release);void lru_add_page_tail (struct page *page,struct page *page_tail,struct lruvec *lruvec) { -int uninitialized_var (active ); +int active =0 ;enum lru_list lru;const int file =0 ;
net/dccp/options.c +1 -1
@@ -60,7 +60,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, (dh->dccph_doff *4 );struct dccp_options_received *opt_recv = &dp->dccps_options_received;unsigned char opt, len; -unsigned char *uninitialized_var (value ); +unsigned char *value =NULL ;u32 elapsed_time;__be32 opt_val;int rc;
net/ipv6/ip6_flowlabel.c +1 -1
@@ -476,7 +476,7 @@ static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl,int ipv6_flowlabel_opt (struct sock *sk,char __user *optval,int optlen) { -int uninitialized_var (err ); +int err =0 ;struct net *net =sock_net (sk);struct ipv6_pinfo *np =inet6_sk (sk);struct in6_flowlabel_req freq;
net/netfilter/nf_conntrack_ftp.c +1 -1
@@ -358,7 +358,7 @@ static int help(struct sk_buff *skb,int ret;u32 seq;int dir =CTINFO2DIR (ctinfo); -unsigned int uninitialized_var (matchlen ),uninitialized_var (matchoff ); +unsigned int matchlen =0 , matchoff =0 ;struct nf_ct_ftp_master *ct_ftp_info =nfct_help_data (ct);struct nf_conntrack_expect *exp;union nf_inet_addr *daddr;
net/netfilter/nfnetlink_queue_core.c +2 -2
@@ -235,7 +235,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,struct net_device *indev;struct net_device *outdev;struct nf_conn *ct =NULL ; -enum ip_conntrack_info uninitialized_var (ctinfo ); +enum ip_conntrack_info ctinfo =0 ; size =NLMSG_SPACE (sizeof (struct nfgenmsg )) +nla_total_size (sizeof (struct nfqnl_msg_packet_hdr ))
@@ -751,7 +751,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,struct nfqnl_instance *queue;unsigned int verdict;struct nf_queue_entry *entry; -enum ip_conntrack_info uninitialized_var (ctinfo ); +enum ip_conntrack_info ctinfo =0 ;struct nf_conn *ct =NULL ; queue =instance_lookup (queue_num);
net/netfilter/xt_socket.c +5 -5
@@ -108,9 +108,9 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,const struct iphdr *iph =ip_hdr (skb);struct udphdr _hdr, *hp =NULL ;struct sock *sk; -__be32 uninitialized_var (daddr ),uninitialized_var (saddr ); -__be16 uninitialized_var (dport ),uninitialized_var (sport ); -u8 uninitialized_var (protocol ); +__be32 daddr =0 , saddr =0 ; +__be16 dport =0 , sport =0 ; +u8 protocol =0 ;#ifdef XT_SOCKET_HAVE_CONNTRACK struct nf_conn const *ct;enum ip_conntrack_info ctinfo;
@@ -262,8 +262,8 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)struct udphdr _hdr, *hp =NULL ;struct sock *sk;struct in6_addr *daddr =NULL , *saddr =NULL ; -__be16 uninitialized_var (dport ),uninitialized_var (sport ); -int thoff =0 ,uninitialized_var (tproto ); +__be16 dport =0 , sport =0 ; +int thoff =0 , tproto =0 ;const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo; tproto =ipv6_find_hdr (skb, &thoff,-1 ,NULL ,NULL );
net/sched/cls_flow.c +1 -1
@@ -211,7 +211,7 @@ static u32 flow_get_skgid(const struct sk_buff *skb)static u32 flow_get_vlan_tag (const struct sk_buff *skb) { -u16 uninitialized_var (tag ); +u16 tag =0 ;if (vlan_get_tag (skb, &tag) <0 )return 0 ;
net/sched/sch_cbq.c +1 -1
@@ -373,7 +373,7 @@ static int cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct cbq_sched_data *q = qdisc_priv(sch); -int uninitialized_var (ret ); +int ret =0 ;struct cbq_class *cl =cbq_classify (skb, sch, &ret);#ifdef CONFIG_NET_CLS_ACT
net/sched/sch_fq_codel.c +1 -1
@@ -172,7 +172,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)struct fq_codel_sched_data *q =qdisc_priv (sch);unsigned int idx;struct fq_codel_flow *flow; -int uninitialized_var (ret ); +int ret =0 ; idx =fq_codel_classify (skb, sch, &ret);if (idx ==0 ) {
net/sched/sch_hfsc.c +1 -1
@@ -1587,7 +1587,7 @@ static int hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct hfsc_class *cl; -int uninitialized_var (err ); +int err =0 ; cl =hfsc_classify (skb, sch, &err);if (cl ==NULL ) {
net/sched/sch_htb.c +1 -1
@@ -548,7 +548,7 @@ static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl)static int htb_enqueue (struct sk_buff *skb,struct Qdisc *sch) { -int uninitialized_var (ret ); +int ret =0 ;struct htb_sched *q =qdisc_priv (sch);struct htb_class *cl =htb_classify (skb, sch, &ret);
net/sched/sch_sfq.c +1 -1
@@ -373,7 +373,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)unsigned int hash;sfq_index x, qlen;struct sfq_slot *slot; -int uninitialized_var (ret ); +int ret =0 ;struct sk_buff *head;int delta;
net/sunrpc/xprtrdma/svc_rdma_transport.c +1 -1
@@ -831,7 +831,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)struct rdma_conn_param conn_param;struct ib_qp_init_attr qp_attr;struct ib_device_attr devattr; -int uninitialized_var (dma_mr_acc ); +int dma_mr_acc =0 ;int need_dma_mr;int ret;int i;
sound/core/control_compat.c +1 -1
@@ -223,7 +223,7 @@ static int copy_ctl_value_from_user(struct snd_card *card, int *typep, int *countp) { int i, type, size; -int uninitialized_var (count ); +int count =0 ;unsigned int indirect;if (copy_from_user (&data->id, &data32->id,sizeof (data->id)))
sound/isa/sb/sb16_csp.c +1 -1
@@ -116,7 +116,7 @@ static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffint snd_sb_csp_new (struct snd_sb *chip,int device,struct snd_hwdep ** rhwdep) {struct snd_sb_csp *p; -int uninitialized_var (version ); +int version =0 ;int err;struct snd_hwdep *hw;
sound/usb/endpoint.c +1 -1
@@ -300,7 +300,7 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep)while (test_bit (EP_FLAG_RUNNING , &ep->flags)) {unsigned long flags; -struct snd_usb_packet_info *uninitialized_var (packet ); +struct snd_usb_packet_info *packet =NULL ;struct snd_urb_ctx *ctx =NULL ;struct urb *urb;int err, i;
tools/virtio/linux/virtio.h +0 -2
@@ -105,8 +105,6 @@ static inline void kfree(void *p) const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -#define uninitialized_var (x) x = x -# ifndef likely# define likely (x) (__builtin_expect(!!(x), 1))# endif
Andrew Morton
maintainerRe: [PATCH] Remove uninitialized_var()
Quoted 5 lines · On Sat, 27 Oct 2012 15:12:03 +0200 Ingo Molnar <[email protected]> wrote:
There's 3 types of conversions done:
uninitialized_var(x) => x = 0 /* for scalar types */ uninitialized_var(x) => x = NULL /* for pointers */ uninitialized_var(x) => x = { } /* for structures, unions */
It's regrettable that we lose information. uninitialized_var() says "this isn't needed - it's just there for gcc". The reader can of course work out the reason with careful code inspection, but that's a lot more time consuming.
We could go add "/* keep gcc quiet */" to every site, or add self-documenting macros for the above.
PATCH v2 1/1 Remove uninitialized_var()
Quoted 8 lines · Andrew Morton
Quoted 5 lines · On Sat, 27 Oct 2012 15:12:03 +0200 Ingo Molnar <[email protected]> wrote:
There's 3 types of conversions done:
uninitialized_var(x) => x = 0 /* for scalar types */ uninitialized_var(x) => x = NULL /* for pointers */ uninitialized_var(x) => x = { } /* for structures, unions */
Quoted 7 lines
It's regrettable that we lose information.
uninitialized_var()says "this isn't needed - it's just there for gcc". The reader can of course work out the reason with careful code inspection, but that's a lot more time consuming.We could go add "/* keep gcc quiet */" to every site, or add self-documenting macros for the above.
Ok, agreed - I've added /* GCC */ to every site to make people think about it.
I left it a bit mystic because in some cases this macro was mis-used not to suppress GCC being wrong, but to hide GCC being *right*: for example unused variable warnings in cases like:
int uninitialized_var(var); #ifdef XYZ var = ...; ... #endif
which (ab-)use was no doubt actively dangerous beyond being ugly. One such example is in arch/x86/mm/numa.c. (These cases now turn into clear (and always harmless) compiler warnings, as they should.)
This further strengthens the argument that we should remove this whole thing.
Thanks,
Ingo
---
arch/arm/mach-sa1100/assabet.c | 2 +- arch/ia64/kernel/process.c | 2 +- arch/ia64/mm/discontig.c | 2 +- arch/ia64/mm/tlb.c | 2 +- arch/ia64/sn/kernel/tiocx.c | 2 +- arch/ia64/sn/pci/pcibr/pcibr_provider.c | 2 +- arch/powerpc/kvm/book3s_pr.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch/powerpc/mm/numa.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 4 ++-- arch/s390/kernel/smp.c | 2 +- arch/s390/mm/pgtable.c | 4 ++-- arch/tile/include/asm/futex.h | 2 +- arch/x86/kernel/apic/es7000_32.c | 2 +- arch/x86/kernel/quirks.c | 10 +++++----- arch/x86/kvm/mmu.c | 2 +- arch/x86/kvm/paging_tmpl.h | 2 +- arch/x86/mm/numa.c | 2 +- arch/x86/xen/p2m.c | 8 ++++---- arch/xtensa/variants/s6000/delay.c | 4 ++-- drivers/acpi/acpi_pad.c | 2 +- drivers/acpi/acpica/tbutils.c | 2 +- drivers/ata/libata-scsi.c | 2 +- drivers/atm/zatm.c | 2 +- drivers/block/nvme.c | 2 +- drivers/char/mmtimer.c | 2 +- drivers/firewire/ohci.c | 14 +++++++------- drivers/gpu/drm/drm_edid.c | 2 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +- drivers/hid/uhid.c | 2 +- drivers/i2c/busses/i2c-mxs.c | 2 +- drivers/ide/ide-acpi.c | 2 +- drivers/ide/ide-atapi.c | 2 +- drivers/ide/ide-io-std.c | 4 ++-- drivers/ide/ide-io.c | 8 ++++---- drivers/ide/ide-sysfs.c | 2 +- drivers/ide/ide-taskfile.c | 2 +- drivers/ide/umc8672.c | 2 +- drivers/infiniband/core/uverbs_cmd.c | 6 +++--- drivers/infiniband/core/verbs.c | 4 ++-- drivers/infiniband/hw/cxgb3/iwch_qp.c | 2 +- drivers/infiniband/hw/mlx4/qp.c | 8 ++++---- drivers/infiniband/hw/mthca/mthca_qp.c | 10 +++++----- drivers/input/serio/serio_raw.c | 2 +- drivers/iommu/intel-iommu.c | 2 +- drivers/iommu/omap-iommu-debug.c | 2 +- drivers/iommu/tegra-smmu.c | 4 ++-- drivers/isdn/hardware/eicon/debug.c | 2 +- drivers/lguest/lguest_user.c | 2 +- drivers/md/dm-ioctl.c | 2 +- drivers/md/dm-snap-persistent.c | 2 +- drivers/md/dm-table.c | 8 ++++---- drivers/md/raid5.c | 2 +- drivers/media/dvb-frontends/af9013.c | 2 +- drivers/media/dvb-frontends/af9033.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/platform/omap3isp/ispqueue.c | 2 +- drivers/media/tuners/tda18212.c | 2 +- drivers/media/tuners/tda18218.c | 2 +- drivers/media/usb/dvb-usb-v2/af9015.c | 2 +- drivers/media/usb/dvb-usb/dib0700_core.c | 2 +- drivers/media/usb/gspca/vicam.c | 2 +- drivers/media/usb/uvc/uvc_video.c | 8 ++++---- drivers/memstick/host/jmb38x_ms.c | 2 +- drivers/memstick/host/tifm_ms.c | 2 +- drivers/mmc/host/sdhci.c | 4 ++-- drivers/mtd/nand/nand_ecc.c | 2 +- drivers/mtd/nand/s3c2410.c | 2 +- drivers/mtd/ubi/attach.c | 2 +- drivers/mtd/ubi/eba.c | 2 +- drivers/mtd/ubi/wl.c | 2 +- drivers/net/dsa/mv88e6060.c | 2 +- drivers/net/dsa/mv88e6xxx.c | 2 +- drivers/net/ethernet/broadcom/bnx2.c | 4 ++-- drivers/net/ethernet/neterion/s2io.c | 2 +- drivers/net/ethernet/qlogic/qla3xxx.c | 2 +- drivers/net/ethernet/realtek/r8169.c | 2 +- drivers/net/ethernet/sis/sis900.c | 2 +- drivers/net/ethernet/sun/cassini.c | 2 +- drivers/net/ethernet/sun/niu.c | 6 +++--- drivers/net/wan/z85230.c | 2 +- drivers/net/wireless/ath/ath6kl/init.c | 2 +- drivers/net/wireless/ath/ath9k/init.c | 2 +- drivers/net/wireless/b43/debugfs.c | 2 +- drivers/net/wireless/b43/dma.c | 2 +- drivers/net/wireless/b43/lo.c | 2 +- drivers/net/wireless/b43/main.c | 2 +- drivers/net/wireless/b43/phy_n.c | 2 +- drivers/net/wireless/b43/xmit.c | 12 ++++++------ drivers/net/wireless/b43legacy/debugfs.c | 2 +- drivers/net/wireless/b43legacy/main.c | 2 +- drivers/net/wireless/iwlegacy/3945.c | 2 +- drivers/net/wireless/iwlegacy/4965-mac.c | 2 +- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 6 +++--- drivers/net/xen-netback/netback.c | 2 +- drivers/pci/pcie/aer/aerdrv_core.c | 2 +- drivers/platform/x86/hdaps.c | 4 ++-- drivers/s390/cio/cio.c | 2 +- drivers/scsi/dc395x.c | 2 +- drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/spi/spi-davinci.c | 2 +- drivers/ssb/driver_chipcommon.c | 4 ++-- drivers/staging/zsmalloc/zsmalloc-main.c | 2 +- drivers/tty/cyclades.c | 2 +- drivers/tty/isicom.c | 2 +- drivers/usb/gadget/uvc_queue.c | 2 +- drivers/usb/musb/cppi_dma.c | 2 +- drivers/usb/storage/sddr55.c | 4 ++-- drivers/vhost/net.c | 4 ++-- drivers/vhost/vhost.c | 2 +- drivers/video/matrox/matroxfb_maven.c | 6 +++--- drivers/video/pm3fb.c | 6 +++--- drivers/video/riva/riva_hw.c | 4 ++-- drivers/virtio/virtio_ring.c | 2 +- fs/afs/dir.c | 2 +- fs/afs/security.c | 2 +- fs/binfmt_flat.c | 2 +- fs/dlm/netlink.c | 2 +- fs/fat/dir.c | 2 +- fs/fuse/control.c | 4 ++-- fs/gfs2/recovery.c | 2 +- fs/hfsplus/unicode.c | 2 +- fs/isofs/namei.c | 4 ++-- fs/jffs2/erase.c | 2 +- fs/nfsd/nfsctl.c | 2 +- fs/ocfs2/alloc.c | 4 ++-- fs/ocfs2/dir.c | 14 +++++++------- fs/ocfs2/extent_map.c | 4 ++-- fs/ocfs2/namei.c | 2 +- fs/ocfs2/refcounttree.c | 2 +- fs/ocfs2/stack_user.c | 2 +- fs/ocfs2/xattr.c | 2 +- fs/omfs/file.c | 2 +- fs/ubifs/budget.c | 2 +- fs/ubifs/commit.c | 6 +++--- fs/ubifs/dir.c | 2 +- fs/ubifs/file.c | 4 ++-- fs/ubifs/journal.c | 4 ++-- fs/ubifs/lpt.c | 2 +- fs/ubifs/tnc.c | 6 +++--- fs/ubifs/tnc_misc.c | 4 ++-- fs/udf/balloc.c | 2 +- fs/xfs/xfs_bmap.c | 2 +- fs/xfs/xfs_file.c | 4 ++-- include/linux/compiler-gcc.h | 6 ------ include/linux/compiler-intel.h | 2 -- include/linux/mm.h | 2 +- ipc/msg.c | 2 +- kernel/async.c | 4 ++-- kernel/audit.c | 2 +- kernel/debug/kdb/kdb_io.c | 2 +- kernel/events/uprobes.c | 2 +- kernel/exit.c | 2 +- kernel/futex.c | 10 +++++----- kernel/futex_compat.c | 2 +- kernel/lockdep.c | 14 +++++++------- lib/dma-debug.c | 2 +- lib/radix-tree.c | 4 ++-- mm/frontswap.c | 2 +- mm/ksm.c | 2 +- mm/memcontrol.c | 8 ++++---- mm/memory.c | 2 +- mm/mempolicy.c | 6 +++--- mm/oom_kill.c | 2 +- mm/page-writeback.c | 4 ++-- mm/page_alloc.c | 2 +- mm/percpu.c | 2 +- mm/slub.c | 2 +- mm/swap.c | 4 ++-- net/dccp/options.c | 2 +- net/ipv6/ip6_flowlabel.c | 2 +- net/netfilter/nf_conntrack_ftp.c | 2 +- net/netfilter/nfnetlink_queue_core.c | 4 ++-- net/netfilter/xt_socket.c | 10 +++++----- net/sched/cls_flow.c | 2 +- net/sched/sch_cbq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_htb.c | 2 +- net/sched/sch_sfq.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 +- sound/core/control_compat.c | 2 +- sound/isa/sb/sb16_csp.c | 2 +- sound/usb/endpoint.c | 2 +- tools/virtio/linux/virtio.h | 2 -- 185 files changed, 281 insertions(+), 291 deletions(-)
arch/arm/mach-sa1100/assabet.c +1 -1
@@ -388,7 +388,7 @@ static void __init map_sa1100_gpio_regs( void )*/ static void __init get_assabet_scr (void ) { -unsigned long uninitialized_var (scr ), i; +unsigned long scr =0 /* GCC */ , i;GPDR |=0x3fc ;/* Configure GPIO 9:2 as outputs */ GPSR =0x3fc ;/* Write 0xFF to GPIO 9:2 */
arch/ia64/kernel/process.c +1 -1
@@ -493,7 +493,7 @@ static void do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg) { unsigned long mask, sp, nat_bits = 0, ar_rnat, urbs_end, cfm; -unsigned long uninitialized_var (ip );/* GCC be quiet */ +unsigned long ip =0 /* GCC */ ;/* GCC be quiet */ elf_greg_t *dst = arg;struct pt_regs *pt;char nat;
arch/ia64/mm/discontig.c +1 -1
@@ -185,7 +185,7 @@ static void *per_cpu_node_setup(void *cpu_data, int node)void __init setup_per_cpu_areas (void ) {struct pcpu_alloc_info *ai; -struct pcpu_group_info *uninitialized_var (gi ); +struct pcpu_group_info *gi =NULL /* GCC */ ;unsigned int *cpu_map;void *base;unsigned long base_offset;
arch/ia64/mm/tlb.c +1 -1
@@ -340,7 +340,7 @@ EXPORT_SYMBOL(flush_tlb_range);void __devinit ia64_tlb_init (void ) { -ia64_ptce_info_t uninitialized_var (ptce_info );/* GCC be quiet */ +ia64_ptce_info_t ptce_info =0 /* GCC */ ;/* GCC be quiet */ u64 tr_pgbits;long status;pal_vm_info_1_u_t vm_info_1;
arch/ia64/sn/kernel/tiocx.c +1 -1
@@ -371,7 +371,7 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)static int is_fpga_tio (int nasid,int *bt) { -u16 uninitialized_var (ioboard_type );/* GCC be quiet */ +u16 ioboard_type =0 /* GCC */ ;/* GCC be quiet */ long rc; rc =ia64_sn_sysctl_ioboard_get (nasid, &ioboard_type);
arch/ia64/sn/pci/pcibr/pcibr_provider.c +1 -1
@@ -82,7 +82,7 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)u16 sn_ioboard_to_pci_bus (struct pci_bus *pci_bus) {long rc; -u16 uninitialized_var (ioboard );/* GCC be quiet */ +u16 ioboard =0 /* GCC */ ;/* GCC be quiet */ nasid_t nasid =NASID_GET (SN_PCIBUS_BUSSOFT (pci_bus)->bs_base); rc =ia64_sn_sysctl_ioboard_get (nasid, &ioboard);
arch/powerpc/kvm/book3s_pr.c +1 -1
@@ -1012,7 +1012,7 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)#ifdef CONFIG_ALTIVEC vector128 vr[32 ];vector128 vscr; -unsigned long uninitialized_var (vrsave ); +unsigned long vrsave =0 /* GCC */ ;int used_vr;#endif #ifdef CONFIG_VSX
arch/powerpc/kvm/powerpc.c +1 -1
@@ -447,7 +447,7 @@ static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,static void kvmppc_complete_mmio_load (struct kvm_vcpu *vcpu,struct kvm_run *run) { -u64 uninitialized_var (gpr ); +u64 gpr =0 /* GCC */ ;if (run->mmio.len >sizeof (gpr)) {printk (KERN_ERR "bad MMIO length: %d\n" , run->mmio.len);
arch/powerpc/mm/numa.c +1 -1
@@ -637,7 +637,7 @@ static inline int __init read_usm_ranges(const u32 **usm)*/ static void __init parse_drconf_memory (struct device_node *memory) { -const u32 *uninitialized_var (dm ), *usm; +const u32 *dm =NULL /* GCC */ , *usm;unsigned int n, rc, ranges, is_kexec_kdump =0 ;unsigned long lmb_size, base, size, sz;int nid;
arch/powerpc/platforms/pseries/iommu.c +2 -2
@@ -930,8 +930,8 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)int page_shift;u64 dma_addr, max_addr;struct device_node *dn; -const u32 *uninitialized_var (ddw_avail ); -const u32 *uninitialized_var (ddw_extensions ); +const u32 *ddw_avail =NULL /* GCC */ ; +const u32 *ddw_extensions =NULL /* GCC */ ;u32 ddw_restore_token =0 ;struct direct_window *window;struct property *win64;
arch/s390/kernel/smp.c +1 -1
@@ -126,7 +126,7 @@ static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm)static inline int pcpu_stopped (struct pcpu *pcpu) { -u32 uninitialized_var (status ); +u32 status =0 /* GCC */ ;if (__pcpu_sigp (pcpu->address,SIGP_SENSE ,0 , &status) !=SIGP_CC_STATUS_STORED )
arch/s390/mm/pgtable.c +2 -2
@@ -609,8 +609,8 @@ static inline unsigned int atomic_xor_bits(atomic_t *v, unsigned int bits)*/ unsigned long *page_table_alloc (struct mm_struct *mm,unsigned long vmaddr) { -unsigned long *uninitialized_var (table ); -struct page *uninitialized_var (page ); +unsigned long *table =NULL /* GCC */ ; +struct page *page =NULL /* GCC */ ;unsigned int mask, bit;if (mm_has_pgste (mm))
arch/tile/include/asm/futex.h +1 -1
@@ -111,7 +111,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int uninitialized_var (val ), ret; +int val =0 /* GCC */ , ret;__futex_prolog ();
arch/x86/kernel/apic/es7000_32.c +1 -1
@@ -529,7 +529,7 @@ static inline int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask, unsigned int *dest_id) { unsigned int round = 0; -unsigned int cpu,uninitialized_var (apicid ); +unsigned int cpu, apicid =0 /* GCC */ ;/* * The cpus in the mask must all be on the apic cluster.
arch/x86/kernel/quirks.c +5 -5
@@ -94,7 +94,7 @@ static void ich_force_hpet_resume(void)static void ich_force_enable_hpet (struct pci_dev *dev) {u32 val; -u32 uninitialized_var (rcba ); +u32 rcba =0 /* GCC */ ;int err =0 ;if (hpet_address || force_hpet_address)
@@ -184,7 +184,7 @@ static void hpet_print_force_info(void)static void old_ich_force_hpet_resume (void ) {u32 val; -u32 uninitialized_var (gen_cntl ); +u32 gen_cntl =0 /* GCC */ ;if (!force_hpet_address || !cached_dev)return ;
@@ -206,7 +206,7 @@ static void old_ich_force_hpet_resume(void)static void old_ich_force_enable_hpet (struct pci_dev *dev) {u32 val; -u32 uninitialized_var (gen_cntl ); +u32 gen_cntl =0 /* GCC */ ;if (hpet_address || force_hpet_address)return ;
@@ -297,7 +297,7 @@ static void vt8237_force_hpet_resume(void)static void vt8237_force_enable_hpet (struct pci_dev *dev) { -u32 uninitialized_var (val ); +u32 val =0 /* GCC */ ;if (hpet_address || force_hpet_address)return ;
@@ -424,7 +424,7 @@ static void nvidia_force_hpet_resume(void)static void nvidia_force_enable_hpet (struct pci_dev *dev) { -u32 uninitialized_var (val ); +u32 val =0 /* GCC */ ;if (hpet_address || force_hpet_address)return ;
arch/x86/kvm/mmu.c +1 -1
@@ -1347,7 +1347,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, struct kvm_memory_slot *slot, unsigned long data) {u64 *sptep; -struct rmap_iterator uninitialized_var (iter ); +struct rmap_iterator iter = { }/* GCC */ ;int young =0 ;/*
arch/x86/kvm/paging_tmpl.h +1 -1
@@ -149,7 +149,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, {int ret;pt_element_t pte; -pt_element_t __user *uninitialized_var (ptep_user ); +pt_element_t __user *ptep_user =NULL /* GCC */ ;gfn_t table_gfn;unsigned index, pt_access, pte_access, accessed_dirty, shift;gpa_t pte_gpa;
arch/x86/mm/numa.c +1 -1
@@ -490,7 +490,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)static int __init numa_register_memblks (struct numa_meminfo *mi) { -unsigned long uninitialized_var (pfn_align ); +unsigned long pfn_align =0 /* GCC */ ;int i, nid;/* Account for nodes with cpus and no memory */
arch/x86/xen/p2m.c +4 -4
@@ -875,7 +875,7 @@ int m2p_add_override(unsigned long mfn, struct page *page, {unsigned long flags;unsigned long pfn; -unsigned long uninitialized_var (address ); +unsigned long address =0 /* GCC */ ;unsigned level;pte_t *ptep =NULL ;int ret =0 ;
@@ -938,7 +938,7 @@ int m2p_remove_override(struct page *page,unsigned long flags;unsigned long mfn;unsigned long pfn; -unsigned long uninitialized_var (address ); +unsigned long address =0 /* GCC */ ;unsigned level;pte_t *ptep =NULL ;int ret =0 ;
@@ -1079,8 +1079,8 @@ static int p2m_dump_show(struct seq_file *m, void *v) [TYPE_PFN] = "pfn", [TYPE_UNKNOWN] = "abnormal"};unsigned long pfn, prev_pfn_type =0 , prev_pfn_level =0 ; -unsigned int uninitialized_var (prev_level ); -unsigned int uninitialized_var (prev_type ); +unsigned int prev_level =0 /* GCC */ ; +unsigned int prev_type =0 /* GCC */ ;if (!p2m_top)return 0 ;
arch/xtensa/variants/s6000/delay.c +2 -2
@@ -6,8 +6,8 @@#define LOOPS 10void platform_calibrate_ccount (void ) { -u32 uninitialized_var (a ); -u32 uninitialized_var (u ); +u32 a =0 /* GCC */ ; +u32 u =0 /* GCC */ ;u32 b;u32 tstamp =S6_REG_GREG1 +S6_GREG1_GLOBAL_TIMER ;int i =LOOPS +1 ;
drivers/acpi/acpi_pad.c +1 -1
@@ -103,7 +103,7 @@ static void round_robin_cpu(unsigned int tsk_index)cpumask_var_t tmp;int cpu;unsigned long min_weight =-1 ; -unsigned long uninitialized_var (preferred_cpu ); +unsigned long preferred_cpu =0 /* GCC */ ;if (!alloc_cpumask_var (&tmp,GFP_KERNEL ))return ;
drivers/acpi/acpica/tbutils.c +1 -1
@@ -628,7 +628,7 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)u32 table_count;struct acpi_table_header *table;acpi_physical_address address; -acpi_physical_address uninitialized_var (rsdt_address ); +acpi_physical_address rsdt_address =0 /* GCC */ ;u32 length;u8 *table_entry;acpi_status status;
drivers/ata/libata-scsi.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t ata_scsi_park_show(struct device *device,struct ata_link *link;struct ata_device *dev;unsigned long flags, now; -unsigned int uninitialized_var (msecs ); +unsigned int msecs =0 /* GCC */ ;int rc =0 ; ap =ata_shost_to_port (sdev->host);
drivers/atm/zatm.c +1 -1
@@ -937,7 +937,7 @@ static int open_tx_first(struct atm_vcc *vcc) vcc->qos.txtp.max_pcr >= ATM_OC3_PCR);if (unlimited && zatm_dev->ubr !=-1 ) zatm_vcc->shaper = zatm_dev->ubr; else { - int uninitialized_var(pcr); + int pcr = 0 /* GCC */; if (unlimited) vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU; if ((zatm_vcc->shaper = alloc_shaper(vcc->dev,&pcr,
drivers/block/nvme.c +1 -1
@@ -1197,7 +1197,7 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,struct nvme_admin_cmd cmd;struct nvme_command c;int status, length; -struct nvme_iod *uninitialized_var (iod ); +struct nvme_iod *iod =NULL /* GCC */ ;if (!capable (CAP_SYS_ADMIN ))return -EACCES ;
drivers/char/mmtimer.c +1 -1
@@ -616,7 +616,7 @@ static int sgi_timer_del(struct k_itimer *timr)if (timr->it.mmtimer.clock !=TIMER_OFF ) {unsigned long expires = timr->it.mmtimer.expires;struct rb_node *n = timers[nodeid].timer_head.rb_node; -struct mmtimer *uninitialized_var (t ); +struct mmtimer *t =NULL /* GCC */ ;int r =0 ; timr->it.mmtimer.clock =TIMER_OFF ;
drivers/firewire/ohci.c +7 -7
@@ -1103,7 +1103,7 @@ static void context_tasklet(unsigned long data)static int context_add_buffer (struct context *ctx) {struct descriptor_buffer *desc; -dma_addr_t uninitialized_var (bus_addr ); +dma_addr_t bus_addr =0 /* GCC */ ;int offset;/*
@@ -1265,7 +1265,7 @@ static int at_context_queue_packet(struct context *ctx, struct fw_packet *packet) {struct fw_ohci *ohci = ctx->ohci; -dma_addr_t d_bus,uninitialized_var (payload_bus ); +dma_addr_t d_bus, payload_bus =0 /* GCC */ ;struct driver_data *driver_data;struct descriptor *d, *last;__le32 *header;
@@ -2438,7 +2438,7 @@ static int ohci_set_config_rom(struct fw_card *card, {struct fw_ohci *ohci;__be32 *next_config_rom; -dma_addr_t uninitialized_var (next_config_rom_bus ); +dma_addr_t next_config_rom_bus =0 /* GCC */ ; ohci =fw_ohci (card);
@@ -2922,10 +2922,10 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card, int type, int channel, size_t header_size) { struct fw_ohci *ohci = fw_ohci(card); -struct iso_context *uninitialized_var (ctx ); -descriptor_callback_t uninitialized_var (callback ); -u64 *uninitialized_var (channels ); -u32 *uninitialized_var (mask ),uninitialized_var (regs ); +struct iso_context *ctx =NULL /* GCC */ ; +descriptor_callback_t callback =0 /* GCC */ ; +u64 *channels =NULL /* GCC */ ; +u32 *mask =NULL /* GCC */ , regs =0 /* GCC */ ;int index, ret = -EBUSY ;spin_lock_irq (&ohci->lock);
drivers/gpu/drm/drm_edid.c +1 -1
@@ -1369,7 +1369,7 @@ static int drm_cvt_modes(struct drm_connector *connector,const u8 empty[3 ] = {0 ,0 ,0 };for (i =0 ; i <4 ; i++) { -int uninitialized_var (width ), height; +int width =0 /* GCC */ , height; cvt = &(timing->data.other_data.data.cvt[i]);if (!memcmp (cvt->code, empty,3 ))
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
@@ -103,7 +103,7 @@ static void i915_warn_stolen(struct drm_device *dev)static void i915_setup_compression (struct drm_device *dev,int size) {struct drm_i915_private *dev_priv = dev->dev_private; -struct drm_mm_node *compressed_fb, *uninitialized_var (compressed_llb ); +struct drm_mm_node *compressed_fb, *compressed_llb =NULL /* GCC */ ;unsigned long cfb_base;unsigned long ll_base =0 ;
drivers/hid/uhid.c +1 -1
@@ -154,7 +154,7 @@ static int uhid_hid_get_raw(struct hid_device *hid, unsigned char rnum,struct uhid_event *ev;unsigned long flags;int ret; -size_t uninitialized_var (len ); +size_t len =0 /* GCC */ ;struct uhid_feature_answer_req *req;if (!uhid->running)
drivers/i2c/busses/i2c-mxs.c +1 -1
@@ -251,7 +251,7 @@ static int mxs_i2c_wait_for_data(struct mxs_i2c_dev *i2c)static int mxs_i2c_finish_read (struct mxs_i2c_dev *i2c,u8 *buf,int len) { -u32 uninitialized_var (data ); +u32 data =0 /* GCC */ ;int i;for (i =0 ; i < len; i++) {
drivers/ide/ide-acpi.c +1 -1
@@ -170,7 +170,7 @@ err:static acpi_handle ide_acpi_hwif_get_handle (ide_hwif_t *hwif) {struct device *dev = hwif->gendev.parent; -acpi_handle uninitialized_var (dev_handle ); +acpi_handle dev_handle =0 /* GCC */ ;u64 pcidevfn;acpi_handle chan_handle;int err;
drivers/ide/ide-atapi.c +1 -1
@@ -581,7 +581,7 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)static ide_startstop_t ide_transfer_pc (ide_drive_t *drive) { -struct ide_atapi_pc *uninitialized_var (pc ); +struct ide_atapi_pc *pc =NULL /* GCC */ ;ide_hwif_t *hwif = drive->hwif;struct request *rq = hwif->rq;ide_expiry_t *expiry;
drivers/ide/ide-io-std.c +2 -2
@@ -172,7 +172,7 @@ void ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,u8 mmio = (hwif->host_flags &IDE_HFLAG_MMIO ) ?1 :0 ;if (io_32bit) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;if ((io_32bit &2 ) && !mmio) {local_irq_save (flags);
@@ -216,7 +216,7 @@ void ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,u8 mmio = (hwif->host_flags &IDE_HFLAG_MMIO ) ?1 :0 ;if (io_32bit) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;if ((io_32bit &2 ) && !mmio) {local_irq_save (flags);
drivers/ide/ide-io.c +4 -4
@@ -613,12 +613,12 @@ static int drive_is_ready(ide_drive_t *drive)void ide_timer_expiry (unsigned long data) {ide_hwif_t *hwif = (ide_hwif_t *)data; -ide_drive_t *uninitialized_var (drive ); +ide_drive_t *drive =NULL /* GCC */ ;ide_handler_t *handler;unsigned long flags;int wait =-1 ;int plug_device =0 ; -struct request *uninitialized_var (rq_in_flight ); +struct request *rq_in_flight =NULL /* GCC */ ;spin_lock_irqsave (&hwif->lock, flags);
@@ -771,13 +771,13 @@ irqreturn_t ide_intr (int irq, void *dev_id) {ide_hwif_t *hwif = (ide_hwif_t *)dev_id;struct ide_host *host = hwif->host; -ide_drive_t *uninitialized_var (drive ); +ide_drive_t *drive =NULL /* GCC */ ;ide_handler_t *handler;unsigned long flags;ide_startstop_t startstop;irqreturn_t irq_ret =IRQ_NONE ;int plug_device =0 ; -struct request *uninitialized_var (rq_in_flight ); +struct request *rq_in_flight =NULL /* GCC */ ;if (host->host_flags &IDE_HFLAG_SERIALIZE ) {if (hwif != host->cur_port)
drivers/ide/ide-sysfs.c +1 -1
@@ -113,7 +113,7 @@ static struct device_attribute *ide_port_attrs[] = {int ide_sysfs_register_port (ide_hwif_t *hwif) { -int i,uninitialized_var (rc ); +int i, rc =0 /* GCC */ ;for (i =0 ; ide_port_attrs[i]; i++) { rc =device_create_file (hwif->portdev, ide_port_attrs[i]);
drivers/ide/ide-taskfile.c +1 -1
@@ -226,7 +226,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,ide_hwif_t *hwif = drive->hwif;struct scatterlist *sg = hwif->sg_table;struct scatterlist *cursg = cmd->cursg; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;struct page *page;unsigned int offset;u8 *buf;
drivers/ide/umc8672.c +1 -1
@@ -107,7 +107,7 @@ static void umc_set_speeds(u8 speeds[])static void umc_set_pio_mode (ide_hwif_t *hwif,ide_drive_t *drive) {ide_hwif_t *mate = hwif->mate; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;const u8 pio = drive->pio_mode -XFER_PIO_0 ; printk("%s: setting umc8672 to PIO mode%d (speed %d)\n",
drivers/infiniband/core/uverbs_cmd.c +3 -3
@@ -1386,7 +1386,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,struct ib_device *device;struct ib_pd *pd =NULL ;struct ib_xrcd *xrcd =NULL ; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL /* GCC */ ;struct ib_cq *scq =NULL , *rcq =NULL ;struct ib_srq *srq =NULL ;struct ib_qp *qp;
@@ -1573,7 +1573,7 @@ ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,struct ib_udata udata;struct ib_uqp_object *obj;struct ib_xrcd *xrcd; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL /* GCC */ ;struct ib_qp *qp;struct ib_qp_open_attr attr;int ret;
@@ -2475,7 +2475,7 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,struct ib_usrq_object *obj;struct ib_pd *pd;struct ib_srq *srq; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL /* GCC */ ;struct ib_srq_init_attr attr;int ret;
drivers/infiniband/core/verbs.c +2 -2
@@ -314,8 +314,8 @@ int ib_destroy_srq(struct ib_srq *srq) {struct ib_pd *pd;enum ib_srq_type srq_type; -struct ib_xrcd *uninitialized_var (xrcd ); -struct ib_cq *uninitialized_var (cq ); +struct ib_xrcd *xrcd =NULL /* GCC */ ; +struct ib_cq *cq =NULL /* GCC */ ;int ret;if (atomic_read (&srq->usecnt))
drivers/infiniband/hw/cxgb3/iwch_qp.c +1 -1
@@ -351,7 +351,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, struct ib_send_wr **bad_wr) {int err =0 ; -u8 uninitialized_var (t3_wr_flit_cnt ); +u8 t3_wr_flit_cnt =0 /* GCC */ ;enum t3_wr_opcode t3_wr_opcode =0 ;enum t3_wr_flags t3_wr_flags;struct iwch_qp *qhp;
drivers/infiniband/hw/mlx4/qp.c +4 -4
@@ -2187,12 +2187,12 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,int nreq;int err =0 ;unsigned ind; -int uninitialized_var (stamp ); -int uninitialized_var (size ); -unsigned uninitialized_var (seglen ); +int stamp =0 /* GCC */ ; +int size =0 /* GCC */ ; +unsigned seglen =0 /* GCC */ ;__be32 dummy;__be32 *lso_wqe; -__be32 uninitialized_var (lso_hdr_sz ); +__be32 lso_hdr_sz =0 /* GCC */ ;__be32 blh;int i;
drivers/infiniband/hw/mthca/mthca_qp.c +5 -5
@@ -1617,8 +1617,8 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,* without initializing f0 and size0, and they are in fact * never used uninitialized. */ -int uninitialized_var (size0 ); -u32 uninitialized_var (f0 ); +int size0 =0 /* GCC */ ; +u32 f0 =0 /* GCC */ ;int ind;u8 op0 =0 ;
@@ -1818,7 +1818,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,* without initializing size0, and it is in fact never used * uninitialized. */ -int uninitialized_var (size0 ); +int size0 =0 /* GCC */ ;int ind;void *wqe;void *prev_wqe;
@@ -1932,8 +1932,8 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,* without initializing f0 and size0, and they are in fact * never used uninitialized. */ -int uninitialized_var (size0 ); -u32 uninitialized_var (f0 ); +int size0 =0 /* GCC */ ; +u32 f0 =0 /* GCC */ ;int ind;u8 op0 =0 ;
drivers/input/serio/serio_raw.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, {struct serio_raw_client *client = file->private_data;struct serio_raw *serio_raw = client->serio_raw; -char uninitialized_var (c ); +char c =0 /* GCC */ ;ssize_t read =0 ;int error;
drivers/iommu/intel-iommu.c +1 -1
@@ -1789,7 +1789,7 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, unsigned long nr_pages, int prot) {struct dma_pte *first_pte =NULL , *pte =NULL ; -phys_addr_t uninitialized_var (pteval ); +phys_addr_t pteval =0 /* GCC */ ;int addr_width =agaw_to_width (domain->agaw) -VTD_PAGE_SHIFT ;unsigned long sg_res;unsigned int largepage_lvl =0 ;
drivers/iommu/omap-iommu-debug.c +1 -1
@@ -220,7 +220,7 @@ static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,struct omap_iommu *obj =dev_to_omap_iommu (dev);char *p, *buf;struct iovm_struct *tmp; -int uninitialized_var (i ); +int i =0 /* GCC */ ;ssize_t bytes; buf = (char *)__get_free_page (GFP_KERNEL );
drivers/iommu/tegra-smmu.c +2 -2
@@ -1155,8 +1155,8 @@ static int tegra_smmu_probe(struct platform_device *pdev)struct smmu_device *smmu;struct device *dev = &pdev->dev;int i, asids, err =0 ; -dma_addr_t uninitialized_var (base ); -size_t bytes,uninitialized_var (size ); +dma_addr_t base =0 /* GCC */ ; +size_t bytes, size =0 /* GCC */ ;if (smmu_handle)return -EIO ;
drivers/isdn/hardware/eicon/debug.c +1 -1
@@ -1187,7 +1187,7 @@ int SuperTraceASSIGN(void *AdapterHandle, byte *data) {if ((features[0 ] &DIVA_XDI_EXTENDED_FEATURES_VALID ) && (features[0 ] &DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA )) { -dword uninitialized_var (rx_dma_magic ); +dword rx_dma_magic =0 /* GCC */ ;if ((pC->dma_handle =diva_get_dma_descriptor (pC->request, &rx_dma_magic)) >=0 ) { pC->xbuffer[0 ] =LLI ; pC->xbuffer[1 ] =8 ;
drivers/lguest/lguest_user.c +1 -1
@@ -408,7 +408,7 @@ static ssize_t write(struct file *file, const char __user *in,struct lguest *lg = file->private_data;const unsigned long __user *input = (const unsigned long __user *)in;unsigned long req; -struct lg_cpu *uninitialized_var (cpu ); +struct lg_cpu *cpu =NULL /* GCC */ ;unsigned int cpu_id = *off;/* The first value tells us what this request is. */
drivers/md/dm-ioctl.c +1 -1
@@ -1615,7 +1615,7 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)int r =0 ;int wipe_buffer;unsigned int cmd; -struct dm_ioctl *uninitialized_var (param ); +struct dm_ioctl *param =NULL /* GCC */ ;ioctl_fn fn =NULL ;size_t input_param_size;
drivers/md/dm-snap-persistent.c +1 -1
@@ -552,7 +552,7 @@ static int persistent_read_metadata(struct dm_exception_store *store, chunk_t old, chunk_t new), void *callback_context) { - int r, uninitialized_var(new_snapshot); + int r, new_snapshot = 0 /* GCC */;struct pstore *ps =get_info (store);/*
drivers/md/dm-table.c +4 -4
@@ -459,7 +459,7 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, struct dm_dev **result) {int r; -dev_t uninitialized_var (dev ); +dev_t dev =0 /* GCC */ ;struct dm_dev_internal *dd;unsigned int major, minor;struct dm_table *t = ti->table;
@@ -689,7 +689,7 @@ static int validate_hardware_logical_block_alignment(struct dm_table *table,*/ unsigned short remaining =0 ; -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL /* GCC */ ;struct queue_limits ti_limits;unsigned i =0 ;
@@ -1230,7 +1230,7 @@ static int count_device(struct dm_target *ti, struct dm_dev *dev,*/ bool dm_table_has_no_data_devices (struct dm_table *table) { -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL /* GCC */ ;unsigned i =0 , num_devices =0 ;while (i <dm_table_get_num_targets (table)) {
@@ -1253,7 +1253,7 @@ bool dm_table_has_no_data_devices(struct dm_table *table)int dm_calculate_queue_limits (struct dm_table *table,struct queue_limits *limits) { -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL /* GCC */ ;struct queue_limits ti_limits;unsigned i =0 ;
drivers/md/raid5.c +1 -1
@@ -1865,7 +1865,7 @@ static void raid5_end_write_request(struct bio *bi, int error)struct stripe_head *sh = bi->bi_private;struct r5conf *conf = sh->raid_conf;int disks = sh->disks, i; -struct md_rdev *uninitialized_var (rdev ); +struct md_rdev *rdev =NULL /* GCC */ ;int uptodate =test_bit (BIO_UPTODATE , &bi->bi_flags);sector_t first_bad;int bad_sectors;
drivers/media/dvb-frontends/af9013.c +1 -1
@@ -419,7 +419,7 @@ static int af9013_statistics_snr_result(struct dvb_frontend *fe)int ret, i, len;u8 buf[3 ], tmp;u32 snr_val; -const struct af9013_snr *uninitialized_var (snr_lut ); +const struct af9013_snr *snr_lut =NULL /* GCC */ ;dev_dbg (&state->i2c->dev,"%s:\n" , __func__);
drivers/media/dvb-frontends/af9033.c +1 -1
@@ -714,7 +714,7 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr)int ret, i, len;u8 buf[3 ], tmp;u32 snr_val; -const struct val_snr *uninitialized_var (snr_lut ); +const struct val_snr *snr_lut =NULL /* GCC */ ;/* read value */ ret =af9033_rd_regs (state,0x80002c , buf,3 );
drivers/media/dvb-frontends/cxd2820r_core.c +1 -1
@@ -567,7 +567,7 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)static void cxd2820r_release (struct dvb_frontend *fe) {struct cxd2820r_priv *priv = fe->demodulator_priv; -int uninitialized_var (ret );/* silence compiler warning */ +int ret =0 /* GCC */ ;/* silence compiler warning */ dev_dbg (&priv->i2c->dev,"%s\n" , __func__);
drivers/media/platform/omap3isp/ispqueue.c +1 -1
@@ -1082,7 +1082,7 @@ static const struct vm_operations_struct isp_video_queue_vm_ops = {int omap3isp_video_queue_mmap (struct isp_video_queue *queue,struct vm_area_struct *vma) { -struct isp_video_buffer *uninitialized_var (buf ); +struct isp_video_buffer *buf =NULL /* GCC */ ;unsigned long size;unsigned int i;int ret =0 ;
drivers/media/tuners/tda18212.c +1 -1
@@ -277,7 +277,7 @@ struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, {struct tda18212_priv *priv =NULL ;int ret; -u8 uninitialized_var (val ); +u8 val =0 /* GCC */ ; priv =kzalloc (sizeof (struct tda18212_priv ),GFP_KERNEL );if (priv ==NULL )
drivers/media/tuners/tda18218.c +1 -1
@@ -277,7 +277,7 @@ struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct tda18218_config *cfg) { struct tda18218_priv *priv = NULL; -u8 uninitialized_var (val ); +u8 val =0 /* GCC */ ;int ret;/* chip default registers values */ static u8 def_regs[] = {
drivers/media/usb/dvb-usb-v2/af9015.c +1 -1
@@ -208,7 +208,7 @@ static int af9015_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],struct af9015_state *state =d_to_priv (d);int ret =0 , i =0 ;u16 addr; -u8 uninitialized_var (mbox ), addr_len; +u8 mbox =0 /* GCC */ , addr_len;struct req_t req;/*
drivers/media/usb/dvb-usb/dib0700_core.c +1 -1
@@ -675,7 +675,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) {struct dvb_usb_device *d = purb->context;struct dib0700_rc_response *poll_reply; -u32 uninitialized_var (keycode ); +u32 keycode =0 /* GCC */ ;u8 toggle;deb_info ("%s()\n" , __func__);
drivers/media/usb/gspca/vicam.c +1 -1
@@ -239,7 +239,7 @@ static int sd_init(struct gspca_dev *gspca_dev) {int ret;const struct ihex_binrec *rec; -const struct firmware *uninitialized_var (fw ); +const struct firmware *fw =NULL /* GCC */ ;u8 *firmware_buf; ret = request_ihex_firmware(&fw, VICAM_FIRMWARE,
drivers/media/usb/uvc/uvc_video.c +4 -4
@@ -702,9 +702,9 @@ static void uvc_video_stats_decode(struct uvc_streaming *stream,unsigned int header_size;bool has_pts = false;bool has_scr = false; -u16 uninitialized_var (scr_sof ); -u32 uninitialized_var (scr_stc ); -u32 uninitialized_var (pts ); +u16 scr_sof =0 /* GCC */ ; +u32 scr_stc =0 /* GCC */ ; +u32 pts =0 /* GCC */ ;if (stream->stats.stream.nb_frames ==0 && stream->stats.frame.nb_packets ==0 )
@@ -1588,7 +1588,7 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)struct usb_host_endpoint *best_ep =NULL ;unsigned int best_psize =UINT_MAX ;unsigned int bandwidth; -unsigned int uninitialized_var (altsetting ); +unsigned int altsetting =0 /* GCC */ ;int intfnum = stream->intfnum;/* Isochronous endpoint, select the alternate setting. */
drivers/memstick/host/jmb38x_ms.c +1 -1
@@ -315,7 +315,7 @@ static int jmb38x_ms_transfer_data(struct jmb38x_ms_host *host) }while (length) { -unsigned int uninitialized_var (p_off ); +unsigned int p_off =0 /* GCC */ ;if (host->req->long_data) { pg = nth_page(sg_page(&host->req->sg),
drivers/memstick/host/tifm_ms.c +1 -1
@@ -200,7 +200,7 @@ static unsigned int tifm_ms_transfer_data(struct tifm_ms *host) host->block_pos);while (length) { -unsigned int uninitialized_var (p_off ); +unsigned int p_off =0 /* GCC */ ;if (host->req->long_data) { pg = nth_page(sg_page(&host->req->sg),
drivers/mmc/host/sdhci.c +2 -2
@@ -175,7 +175,7 @@ static void sdhci_disable_card_detection(struct sdhci_host *host)static void sdhci_reset (struct sdhci_host *host,u8 mask) {unsigned long timeout; -u32 uninitialized_var (ier ); +u32 ier =0 /* GCC */ ;if (host->quirks &SDHCI_QUIRK_NO_CARD_NO_RESET ) { if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
@@ -311,7 +311,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) {unsigned long flags;size_t blksize, len, chunk; -u32 uninitialized_var (scratch ); +u32 scratch =0 /* GCC */ ;u8 *buf;DBG ("PIO reading\n" );
drivers/mtd/nand/nand_ecc.c +1 -1
@@ -167,7 +167,7 @@ void __nand_calculate_ecc(const unsigned char *buf, unsigned int eccsize,/* rp0..rp15..rp17 are the various accumulated parities (per byte) */ uint32_t rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;uint32_t rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15, rp16; -uint32_t uninitialized_var (rp17 );/* to make compiler happy */ +uint32_t rp17 =0 /* GCC */ ;/* to make compiler happy */ uint32_t par;/* the cumulative parity for all data */ uint32_t tmppar;/* the cumulative parity for this iteration; for rp12, rp14 and rp16 at the end of the
drivers/mtd/nand/s3c2410.c +1 -1
@@ -234,7 +234,7 @@ static int s3c2410_nand_setrate(struct s3c2410_nand_info *info)int tacls_max = (info->cpu_type ==TYPE_S3C2412 ) ?8 :4 ;int tacls, twrph0, twrph1;unsigned long clkrate =clk_get_rate (info->clk); -unsigned long uninitialized_var (set ), cfg,uninitialized_var (mask ); +unsigned long set =0 /* GCC */ , cfg, mask =0 /* GCC */ ;unsigned long flags;/* calculate the timing information for the controller */
drivers/mtd/ubi/attach.c +1 -1
@@ -821,7 +821,7 @@ out_unlock:static int scan_peb (struct ubi_device *ubi,struct ubi_attach_info *ai,int pnum,int *vid,unsigned long long *sqnum) { -long long uninitialized_var (ec ); +long long ec =0 /* GCC */ ;int err, bitflips =0 , vol_id =-1 , ec_err =0 ;dbg_bld ("scan PEB %d" , pnum);
drivers/mtd/ubi/eba.c +1 -1
@@ -374,7 +374,7 @@ int ubi_eba_read_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum, {int err, pnum, scrub =0 , vol_id = vol->vol_id;struct ubi_vid_hdr *vid_hdr; -uint32_t uninitialized_var (crc ); +uint32_t crc =0 /* GCC */ ; err =leb_read_lock (ubi, vol_id, lnum);if (err)
drivers/mtd/ubi/wl.c +1 -1
@@ -994,7 +994,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk, int cancel) {int err, scrubbing =0 , torture =0 , protect =0 , erroneous =0 ; -int vol_id =-1 ,uninitialized_var (lnum ); +int vol_id =-1 , lnum =0 /* GCC */ ;#ifdef CONFIG_MTD_UBI_FASTMAP int anchor = wrk->anchor;#endif
drivers/net/dsa/mv88e6060.c +1 -1
@@ -224,7 +224,7 @@ static void mv88e6060_poll_link(struct dsa_switch *ds)for (i =0 ; i <DSA_MAX_PORTS ; i++) {struct net_device *dev; -int uninitialized_var (port_status ); +int port_status =0 /* GCC */ ;int link;int speed;int duplex;
drivers/net/dsa/mv88e6xxx.c +1 -1
@@ -359,7 +359,7 @@ void mv88e6xxx_poll_link(struct dsa_switch *ds)for (i =0 ; i <DSA_MAX_PORTS ; i++) {struct net_device *dev; -int uninitialized_var (port_status ); +int port_status =0 /* GCC */ ;int link;int speed;int duplex;
drivers/net/ethernet/broadcom/bnx2.c +2 -2
@@ -1432,7 +1432,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp)static void bnx2_enable_forced_2g5 (struct bnx2 *bp) { -u32 uninitialized_var (bmcr ); +u32 bmcr =0 /* GCC */ ;int err;if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ))
@@ -1476,7 +1476,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp)static void bnx2_disable_forced_2g5 (struct bnx2 *bp) { -u32 uninitialized_var (bmcr ); +u32 bmcr =0 /* GCC */ ;int err;if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ))
drivers/net/ethernet/neterion/s2io.c +1 -1
@@ -7331,7 +7331,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)int ring_no = ring_data->ring_no;u16 l3_csum, l4_csum;unsigned long long err = rxdp->Control_1 &RXD_T_CODE ; -struct lro *uninitialized_var (lro ); +struct lro *lro =NULL /* GCC */ ;u8 err_mask;struct swStat *swstats = &sp->mac_control.stats_info->sw_stat;
drivers/net/ethernet/qlogic/qla3xxx.c +1 -1
@@ -3778,7 +3778,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,struct net_device *ndev =NULL ;struct ql3_adapter *qdev =NULL ;static int cards_found; -int uninitialized_var (pci_using_dac ), err; +int pci_using_dac =0 /* GCC */ , err; err =pci_enable_device (pdev);if (err) {
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -5669,7 +5669,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, {struct skb_shared_info *info =skb_shinfo (skb);unsigned int cur_frag, entry; -struct TxDesc *uninitialized_var (txd ); +struct TxDesc * txd =NULL /* GCC */ ;struct device *d = &tp->pci_dev->dev; entry = tp->cur_tx;
drivers/net/ethernet/sis/sis900.c +1 -1
@@ -1319,7 +1319,7 @@ static void sis900_timer(unsigned long data)u16 status;if (!sis_priv->autong_complete){ -int uninitialized_var (speed ), duplex =0 ; +int speed =0 /* GCC */ , duplex =0 ;sis900_read_mode (net_dev, &speed, &duplex);if (duplex){
drivers/net/ethernet/sun/cassini.c +1 -1
@@ -2305,7 +2305,7 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget) drops =0 ;while (1 ) {struct cas_rx_comp *rxc = rxcs + entry; -struct sk_buff *uninitialized_var (skb ); +struct sk_buff *skb =NULL /* GCC */ ;int type, len;u64 words[4 ];int i, dring;
drivers/net/ethernet/sun/niu.c +3 -3
@@ -428,7 +428,7 @@ static int serdes_init_niu_1g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;u16 pll_cfg, pll_sts;int max_retry =100 ; -u64 uninitialized_var (sig ), mask, val; +u64 sig =0 /* GCC */ , mask, val;u32 tx_cfg, rx_cfg;unsigned long i;int err;
@@ -525,7 +525,7 @@ static int serdes_init_niu_10g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;u32 tx_cfg, rx_cfg, pll_cfg, pll_sts;int max_retry =100 ; -u64 uninitialized_var (sig ), mask, val; +u64 sig =0 /* GCC */ , mask, val;unsigned long i;int err;
@@ -713,7 +713,7 @@ static int esr_write_glue0(struct niu *np, unsigned long chan, u32 val)static int esr_reset (struct niu *np) { -u32 uninitialized_var (reset ); +u32 reset =0 /* GCC */ ;int err; err = mdio_write(np, np->port, NIU_ESR_DEV_ADDR,
drivers/net/wan/z85230.c +1 -1
@@ -707,7 +707,7 @@ EXPORT_SYMBOL(z8530_nop);irqreturn_t z8530_interrupt (int irq,void *dev_id) {struct z8530_dev *dev=dev_id; -u8 uninitialized_var (intr ); +u8 intr =0 /* GCC */ ;static volatile int locker=0 ;int work=0 ;struct z8530_irqhandler *irqs;
drivers/net/wireless/ath/ath6kl/init.c +1 -1
@@ -1475,7 +1475,7 @@ static int ath6kl_init_upload(struct ath6kl *ar)int ath6kl_init_hw_params (struct ath6kl *ar) { -const struct ath6kl_hw *uninitialized_var (hw ); +const struct ath6kl_hw *hw =NULL /* GCC */ ;int i;for (i =0 ; i <ARRAY_SIZE (hw_list); i++) {
drivers/net/wireless/ath/ath9k/init.c +1 -1
@@ -222,7 +222,7 @@ static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clstruct ath_hw *ah = (struct ath_hw *) hw_priv;struct ath_common *common =ath9k_hw_common (ah);struct ath_softc *sc = (struct ath_softc *) common->priv; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;u32 val;if (NR_CPUS >1 && ah->config.serialize_regmode ==SER_REG_MODE_ON ) {
drivers/net/wireless/b43/debugfs.c +1 -1
@@ -506,7 +506,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,struct b43_wldev *dev;struct b43_debugfs_fops *dfops;struct b43_dfs_file *dfile; -ssize_t uninitialized_var (ret ); +ssize_t ret =0 /* GCC */ ;char *buf;const size_t bufsize =1024 *16 ;/* 16 kiB buffer */ const size_t buforder =get_order (bufsize);
drivers/net/wireless/b43/dma.c +1 -1
@@ -50,7 +50,7 @@static u32 b43_dma_address (struct b43_dma *dma,dma_addr_t dmaaddr,enum b43_addrtype addrtype) { -u32 uninitialized_var (addr ); +u32 addr =0 /* GCC */ ;switch (addrtype) {case B43_DMA_ADDR_LOW :
drivers/net/wireless/b43/lo.c +1 -1
@@ -742,7 +742,7 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev, };int max_rx_gain;struct b43_lo_calib *cal; -struct lo_g_saved_values uninitialized_var (saved_regs ); +struct lo_g_saved_values saved_regs = { }/* GCC */ ;/* Values from the "TXCTL Register and Value Table" */ u16 txctl_reg;u16 txctl_value;
drivers/net/wireless/b43/main.c +1 -1
@@ -3705,7 +3705,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)struct b43_wldev *down_dev;struct b43_wldev *d;int err; -bool uninitialized_var (gmode ); +bool gmode =0 /* GCC */ ;int prev_status;/* Find a device and PHY which supports the band. */
drivers/net/wireless/b43/phy_n.c +1 -1
@@ -4569,7 +4569,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,u8 rfctl[2 ];u8 afectl_core;u16 tmp[6 ]; -u16 uninitialized_var (cur_hpf1 ),uninitialized_var (cur_hpf2 ), cur_lna; +u16 cur_hpf1 =0 /* GCC */ , cur_hpf2 =0 /* GCC */ , cur_lna;u32 real, imag;enum ieee80211_band band;
drivers/net/wireless/b43/xmit.c +6 -6
@@ -427,10 +427,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,if ((rates[0 ].flags &IEEE80211_TX_RC_USE_RTS_CTS ) || (rates[0 ].flags &IEEE80211_TX_RC_USE_CTS_PROTECT )) {unsigned int len; -struct ieee80211_hdr *uninitialized_var (hdr ); +struct ieee80211_hdr *hdr =NULL /* GCC */ ;int rts_rate, rts_rate_fb;int rts_rate_ofdm, rts_rate_fb_ofdm; -struct b43_plcp_hdr6 *uninitialized_var (plcp ); +struct b43_plcp_hdr6 *plcp =NULL /* GCC */ ;struct ieee80211_rate *rts_cts_rate; rts_cts_rate =ieee80211_get_rts_cts_rate (dev->wl->hw, info);
@@ -441,7 +441,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, rts_rate_fb_ofdm =b43_is_ofdm_rate (rts_rate_fb);if (rates[0 ].flags &IEEE80211_TX_RC_USE_CTS_PROTECT ) { -struct ieee80211_cts *uninitialized_var (cts ); +struct ieee80211_cts *cts =NULL /* GCC */ ;switch (dev->fw.hdr_format) {case B43_FW_HDR_598 :
@@ -463,7 +463,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, mac_ctl |=B43_TXH_MAC_SENDCTS ; len =sizeof (struct ieee80211_cts ); }else { -struct ieee80211_rts *uninitialized_var (rts ); +struct ieee80211_rts *rts =NULL /* GCC */ ;switch (dev->fw.hdr_format) {case B43_FW_HDR_598 :
@@ -659,8 +659,8 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)const struct b43_rxhdr_fw4 *rxhdr = _rxhdr;__le16 fctl;u16 phystat0, phystat3; -u16 uninitialized_var (chanstat ),uninitialized_var (mactime ); -u32 uninitialized_var (macstat ); +u16 chanstat =0 /* GCC */ , mactime =0 /* GCC */ ; +u32 macstat =0 /* GCC */ ;u16 chanid;u16 phytype;int padding, rate_idx;
drivers/net/wireless/b43legacy/debugfs.c +1 -1
@@ -203,7 +203,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,struct b43legacy_wldev *dev;struct b43legacy_debugfs_fops *dfops;struct b43legacy_dfs_file *dfile; -ssize_t uninitialized_var (ret ); +ssize_t ret =0 /* GCC */ ;char *buf;const size_t bufsize =1024 *16 ;/* 16 KiB buffer */ const size_t buforder =get_order (bufsize);
drivers/net/wireless/b43legacy/main.c +1 -1
@@ -2588,7 +2588,7 @@ static void b43legacy_put_phy_into_reset(struct b43legacy_wldev *dev)static int b43legacy_switch_phymode (struct b43legacy_wl *wl,unsigned int new_mode) { -struct b43legacy_wldev *uninitialized_var (up_dev ); +struct b43legacy_wldev *up_dev =NULL /* GCC */ ;struct b43legacy_wldev *down_dev;int err;bool gmode = false;
drivers/net/wireless/iwlegacy/3945.c +1 -1
@@ -2092,7 +2092,7 @@ il3945_txpower_set_from_eeprom(struct il_priv *il)/* set tx power value for all OFDM rates */ for (rate_idx =0 ; rate_idx <IL_OFDM_RATES ; rate_idx++) { -s32 uninitialized_var (power_idx ); +s32 power_idx =0 /* GCC */ ;int rc;/* use channel group's clip-power table,
drivers/net/wireless/iwlegacy/4965-mac.c +1 -1
@@ -2754,7 +2754,7 @@ il4965_hdl_tx(struct il_priv *il, struct il_rx_buf *rxb)struct ieee80211_tx_info *info;struct il4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0 ];u32 status =le32_to_cpu (tx_resp->u.status); -int uninitialized_var (tid ); +int tid =0 /* GCC */ ;int sta_id;int freed;u8 *qc =NULL ;
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +3 -3
@@ -643,7 +643,7 @@ static void _rtl92cu_init_chipN_one_out_ep_priority(struct ieee80211_hw *hw, bool wmm_enable, u8 queue_sel) { -u16 uninitialized_var (value ); +u16 value =0 /* GCC */ ;switch (queue_sel) {case TX_SELE_HQ :
@@ -669,8 +669,8 @@ static void _rtl92cu_init_chipN_two_out_ep_priority(struct ieee80211_hw *hw, u8 queue_sel) {u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ; -u16 uninitialized_var (valueHi ); -u16 uninitialized_var (valueLow ); +u16 valueHi =0 /* GCC */ ; +u16 valueLow =0 /* GCC */ ;switch (queue_sel) {case (TX_SELE_HQ |TX_SELE_LQ ):
drivers/net/xen-netback/netback.c +1 -1
@@ -412,7 +412,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,* These variables are used iff get_page_ext returns true, * in which case they are guaranteed to be initialized. */ -unsigned int uninitialized_var (group ),uninitialized_var (idx ); +unsigned int group =0 /* GCC */ , idx =0 /* GCC */ ;int foreign =get_page_ext (page, &group, &idx);unsigned long bytes;
drivers/pci/pcie/aer/aerdrv_core.c +1 -1
@@ -783,7 +783,7 @@ void aer_isr(struct work_struct *work) { struct aer_rpc *rpc = container_of(work, struct aer_rpc, dpc_handler);struct pcie_device *p_device = rpc->rpd; -struct aer_err_source uninitialized_var (e_src ); +struct aer_err_source e_src = { }/* GCC */ ;mutex_lock (&rpc->rpc_mutex);while (get_e_source (rpc, &e_src))
drivers/platform/x86/hdaps.c +2 -2
@@ -379,7 +379,7 @@ static ssize_t hdaps_variance_show(struct device *dev,static ssize_t hdaps_temp1_show (struct device *dev,struct device_attribute *attr,char *buf) { -u8 uninitialized_var (temp ); +u8 temp =0 /* GCC */ ;int ret; ret =hdaps_readb_one (HDAPS_PORT_TEMP1 , &temp);
@@ -392,7 +392,7 @@ static ssize_t hdaps_temp1_show(struct device *dev,static ssize_t hdaps_temp2_show (struct device *dev,struct device_attribute *attr,char *buf) { -u8 uninitialized_var (temp ); +u8 temp =0 /* GCC */ ;int ret; ret =hdaps_readb_one (HDAPS_PORT_TEMP2 , &temp);
drivers/s390/cio/cio.c +1 -1
@@ -1029,7 +1029,7 @@ extern void do_reipl_asm(__u32 schid);/* Make sure all subchannels are quiet before we re-ipl an lpar. */ void reipl_ccw_dev (struct ccw_dev_id *devid) { -struct subchannel_id uninitialized_var (schid ); +struct subchannel_id schid = { }/* GCC */ ;s390_reset_system (NULL ,NULL );if (reipl_find_schid (devid, &schid) !=0 )
drivers/scsi/dc395x.c +1 -1
@@ -4268,7 +4268,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)const unsigned srbs_per_page =PAGE_SIZE /SEGMENTX_LEN ;int srb_idx =0 ;unsigned i =0 ; -struct SGentry *uninitialized_var (ptr ); +struct SGentry *ptr =NULL /* GCC */ ;for (i =0 ; i < DC395x_MAX_SRB_CNT; i++) acb->srb_array[i].segment_x =NULL ;
drivers/scsi/pm8001/pm8001_hwi.c +1 -1
@@ -3874,7 +3874,7 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha) {struct outbound_queue_table *circularQ;void *pMsg1 =NULL ; -u8 uninitialized_var (bc ); +u8 bc =0 /* GCC */ ;u32 ret =MPI_IO_STATUS_FAIL ;unsigned long flags;
drivers/spi/spi-davinci.c +1 -1
@@ -529,7 +529,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)u32 errors =0 ;struct davinci_spi_config *spicfg;struct davinci_spi_platform_data *pdata; -unsigned uninitialized_var (rx_buf_count ); +unsigned rx_buf_count =0 /* GCC */ ;void *dummy_buf =NULL ;struct scatterlist sg_rx, sg_tx;
drivers/ssb/driver_chipcommon.c +2 -2
@@ -117,7 +117,7 @@ void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,static enum ssb_clksrc chipco_pctl_get_slowclksrc (struct ssb_chipcommon *cc) {struct ssb_bus *bus = cc->dev->bus; -u32 uninitialized_var (tmp ); +u32 tmp =0 /* GCC */ ;if (cc->dev->id.revision <6 ) { if (bus->bustype == SSB_BUSTYPE_SSB ||
@@ -147,7 +147,7 @@ static enum ssb_clksrc chipco_pctl_get_slowclksrc(struct ssb_chipcommon *cc)/* Get maximum or minimum (depending on get_max flag) slowclock frequency. */ static int chipco_pctl_clockfreqlimit (struct ssb_chipcommon *cc,int get_max) { -int uninitialized_var (limit ); +int limit =0 /* GCC */ ;enum ssb_clksrc clocksrc;int divisor =1 ;u32 tmp;
drivers/staging/zsmalloc/zsmalloc-main.c +1 -1
@@ -555,7 +555,7 @@ static void init_zspage(struct page *first_page, struct size_class *class)static struct page *alloc_zspage (struct size_class *class,gfp_t flags) {int i, error; -struct page *first_page =NULL , *uninitialized_var (prev_page ); +struct page *first_page =NULL , *prev_page =NULL /* GCC */ ;/* * Allocate individual pages and link them together as:
drivers/tty/cyclades.c +1 -1
@@ -3698,7 +3698,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,struct cyclades_card *card;void __iomem *addr0 =NULL , *addr2 =NULL ;char *card_name =NULL ; -u32 uninitialized_var (mailbox ); +u32 mailbox =0 /* GCC */ ;unsigned int device_id, nchan =0 , card_no, i, j;unsigned char plx_ver;int retval, irq;
drivers/tty/isicom.c +1 -1
@@ -1551,7 +1551,7 @@ static unsigned int card_count;static int __devinit isicom_probe (struct pci_dev *pdev,const struct pci_device_id *ent) { -unsigned int uninitialized_var (signature ), index; +unsigned int signature =0 /* GCC */ , index;int retval = -EPERM ;struct isi_board *board =NULL ;
drivers/usb/gadget/uvc_queue.c +1 -1
@@ -413,7 +413,7 @@ static struct vm_operations_struct uvc_vm_ops = {static int uvc_queue_mmap (struct uvc_video_queue *queue,struct vm_area_struct *vma) { -struct uvc_buffer *uninitialized_var (buffer ); +struct uvc_buffer *buffer =NULL /* GCC */ ;struct page *page;unsigned long addr, start, size;unsigned int i;
drivers/usb/musb/cppi_dma.c +1 -1
@@ -1167,7 +1167,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)struct musb_hw_ep *hw_ep =NULL ;u32 rx, tx;int i, index; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ; cppi = container_of(musb->dma_controller, struct cppi, controller);if (cppi->irq)
drivers/usb/storage/sddr55.c +2 -2
@@ -563,8 +563,8 @@ static int sddr55_reset(struct us_data *us)static unsigned long sddr55_get_capacity (struct us_data *us) { -unsigned char uninitialized_var (manufacturerID ); -unsigned char uninitialized_var (deviceID ); +unsigned char manufacturerID =0 /* GCC */ ; +unsigned char deviceID =0 /* GCC */ ;int result;struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra;
drivers/vhost/net.c +2 -2
@@ -145,7 +145,7 @@ static void handle_tx(struct vhost_net *net)int err, wmem;size_t hdr_size;struct socket *sock; -struct vhost_ubuf_ref *uninitialized_var (ubufs ); +struct vhost_ubuf_ref *ubufs =NULL /* GCC */ ;bool zcopy;/* TODO: check that we are running from vhost_worker? */
@@ -364,7 +364,7 @@ err:static void handle_rx (struct vhost_net *net) {struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_RX ]; -unsigned uninitialized_var (in ), log; +unsigned in =0 /* GCC */ , log;struct vhost_log *vq_log;struct msghdr msg = { .msg_name =NULL ,
drivers/vhost/vhost.c +1 -1
@@ -189,7 +189,7 @@ static int vhost_worker(void *data) {struct vhost_dev *dev = data;struct vhost_work *work =NULL ; -unsigned uninitialized_var (seq ); +unsigned seq =0 /* GCC */ ;mm_segment_t oldfs =get_fs ();set_fs (USER_DS );
drivers/video/matrox/matroxfb_maven.c +3 -3
@@ -285,7 +285,7 @@ static int matroxfb_mavenclock(const struct matrox_pll_ctl *ctl, unsigned int* in, unsigned int* feed, unsigned int* post, unsigned int* htotal2) { unsigned int fvco; -unsigned int uninitialized_var (p ); +unsigned int p =0 /* GCC */ ; fvco =matroxfb_PLL_mavenclock (&maven1000_pll, ctl, htotal, vtotal, in, feed, &p, htotal2);if (!fvco)
@@ -717,8 +717,8 @@ static int maven_find_exact_clocks(unsigned int ht, unsigned int vt,for (x =0 ; x <8 ; x++) {unsigned int c; -unsigned int uninitialized_var (a ),uninitialized_var (b ), -uninitialized_var (h2 ); +unsigned int a =0 /* GCC */ , b =0 /* GCC */ , + h2 =0 /* GCC */ ;unsigned int h = ht +2 + x;if (!matroxfb_mavenclock ((m->mode ==MATROXFB_OUTPUT_MODE_PAL ) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) {
drivers/video/pm3fb.c +3 -3
@@ -828,9 +828,9 @@ static void pm3fb_write_mode(struct fb_info *info)wmb (); { -unsigned char uninitialized_var (m );/* ClkPreScale */ -unsigned char uninitialized_var (n );/* ClkFeedBackScale */ -unsigned char uninitialized_var (p );/* ClkPostScale */ +unsigned char m =0 /* GCC */ ;/* ClkPreScale */ +unsigned char n =0 /* GCC */ ;/* ClkFeedBackScale */ +unsigned char p =0 /* GCC */ ;/* ClkPostScale */ unsigned long pixclock =PICOS2KHZ (info->var.pixclock); (void )pm3fb_calculate_clock (pixclock, &m, &n, &p);
drivers/video/riva/riva_hw.c +2 -2
@@ -1243,8 +1243,8 @@ int CalcStateExt ) {int pixelDepth; -int uninitialized_var (VClk ),uninitialized_var (m ), -uninitialized_var (n ),uninitialized_var (p ); +int VClk =0 /* GCC */ ,m =0 /* GCC */ , + n =0 /* GCC */ , p =0 /* GCC */ ;/* * Save mode parameters.
drivers/virtio/virtio_ring.c +1 -1
@@ -206,7 +206,7 @@ int virtqueue_add_buf(struct virtqueue *_vq, gfp_t gfp) {struct vring_virtqueue *vq =to_vvq (_vq); -unsigned int i, avail,uninitialized_var (prev ); +unsigned int i, avail, prev =0 /* GCC */ ;int head;START_USE (vq);
fs/afs/dir.c +1 -1
@@ -601,7 +601,7 @@ success:static int afs_d_revalidate (struct dentry *dentry,unsigned int flags) {struct afs_vnode *vnode, *dir; -struct afs_fid uninitialized_var (fid ); +struct afs_fid fid = { }/* GCC */ ;struct dentry *parent;struct key *key;void *dir_version;
fs/afs/security.c +1 -1
@@ -288,7 +288,7 @@ static int afs_check_permit(struct afs_vnode *vnode, struct key *key,int afs_permission (struct inode *inode,int mask) {struct afs_vnode *vnode =AFS_FS_I (inode); -afs_access_t uninitialized_var (access ); +afs_access_t access =0 /* GCC */ ;struct key *key;int ret;
fs/binfmt_flat.c +1 -1
@@ -127,7 +127,7 @@ static unsigned long create_flat_tables(char * p = (char *)pp;int argc = bprm->argc;int envc = bprm->envc; -char uninitialized_var (dummy ); +char dummy =0 /* GCC */ ; sp = (unsigned long *)p; sp -= (envc + argc +2 ) +1 + (flat_argvp_envp_on_stack () ?2 :0 );
fs/dlm/netlink.c +1 -1
@@ -114,7 +114,7 @@ static void fill_data(struct dlm_lock_data *data, struct dlm_lkb *lkb)void dlm_timeout_warn (struct dlm_lkb *lkb) { -struct sk_buff *uninitialized_var (send_skb ); +struct sk_buff *send_skb =NULL /* GCC */ ;struct dlm_lock_data *data;size_t size;int rv;
fs/fat/dir.c +1 -1
@@ -1249,7 +1249,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,struct super_block *sb = dir->i_sb;struct msdos_sb_info *sbi =MSDOS_SB (sb);struct buffer_head *bh, *prev, *bhs[3 ];/* 32*slots (672bytes) */ -struct msdos_dir_entry *uninitialized_var (de ); +struct msdos_dir_entry *de =NULL /* GCC */ ;int err, free_slots, i, nr_bhs;loff_t pos, i_pos;
fs/fuse/control.c +2 -2
@@ -117,7 +117,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned uninitialized_var(val); + unsigned val = 0 /* GCC */;ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
@@ -154,7 +154,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned uninitialized_var(val); + unsigned val = 0 /* GCC */;ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
fs/gfs2/recovery.c +1 -1
@@ -151,7 +151,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk, struct gfs2_log_header_host *head) {struct buffer_head *bh; -struct gfs2_log_header_host uninitialized_var (lh ); +struct gfs2_log_header_host lh = { }/* GCC */ ;const u32 nothing =0 ;u32 hash;int error;
fs/hfsplus/unicode.c +1 -1
@@ -350,7 +350,7 @@ int hfsplus_hash_dentry(const struct dentry *dentry, const struct inode *inode, astr = str->name; len = str->len;while (len >0 ) { -int uninitialized_var (dsize ); +int dsize =0 /* GCC */ ; size =asc2unichar (sb, astr, len, &c); astr += size; len -= size;
fs/isofs/namei.c +2 -2
@@ -166,8 +166,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,struct dentry *isofs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) {int found; -unsigned long uninitialized_var (block ); -unsigned long uninitialized_var (offset ); +unsigned long block =0 /* GCC */ ; +unsigned long offset =0 /* GCC */ ;struct inode *inode;struct page *page;
fs/jffs2/erase.c +1 -1
@@ -428,7 +428,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb {size_t retlen;int ret; -uint32_t uninitialized_var (bad_offset ); +uint32_t bad_offset =0 /* GCC */ ;switch (jffs2_block_check_erase (c, jeb, &bad_offset)) {case -EAGAIN : goto refile;
fs/nfsd/nfsctl.c +1 -1
@@ -315,7 +315,7 @@ static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)static ssize_t write_filehandle (struct file *file,char *buf,size_t size) {char *dname, *path; -int uninitialized_var (maxsize ); +int maxsize =0 /* GCC */ ;char *mesg = buf;int len;struct auth_domain *dom;
fs/ocfs2/alloc.c +2 -2
@@ -4671,7 +4671,7 @@ int ocfs2_insert_extent(handle_t *handle, struct ocfs2_alloc_context *meta_ac) {int status; -int uninitialized_var (free_records ); +int free_records =0 /* GCC */ ;struct buffer_head *last_eb_bh =NULL ;struct ocfs2_insert_type insert = {0 , };struct ocfs2_extent_rec rec;
@@ -6807,7 +6807,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, {int ret, i, has_data, num_pages =0 ;handle_t *handle; -u64 uninitialized_var (block ); +u64 block =0 /* GCC */ ;struct ocfs2_inode_info *oi =OCFS2_I (inode);struct ocfs2_super *osb =OCFS2_SB (inode->i_sb);struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
fs/ocfs2/dir.c +7 -7
@@ -876,9 +876,9 @@ static int ocfs2_dx_dir_lookup(struct inode *inode, u64 *ret_phys_blkno) {int ret =0 ; -unsigned int cend,uninitialized_var (clen ); -u32 uninitialized_var (cpos ); -u64 uninitialized_var (blkno ); +unsigned int cend, clen =0 /* GCC */ ; +u32 cpos =0 /* GCC */ ; +u64 blkno =0 /* GCC */ ;u32 name_hash = hinfo->major_hash; ret = ocfs2_dx_dir_lookup_rec(inode, el, name_hash, &cpos, &blkno,
@@ -922,7 +922,7 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, struct ocfs2_dir_lookup_result *res) {int ret, i, found; -u64 uninitialized_var (phys ); +u64 phys =0 /* GCC */ ;struct buffer_head *dx_leaf_bh =NULL ;struct ocfs2_dx_leaf *dx_leaf;struct ocfs2_dx_entry *dx_entry =NULL ;
@@ -4486,9 +4486,9 @@ out:int ocfs2_dx_dir_truncate (struct inode *dir,struct buffer_head *di_bh) {int ret; -unsigned int uninitialized_var (clen ); -u32 major_hash =UINT_MAX , p_cpos,uninitialized_var (cpos ); -u64 uninitialized_var (blkno ); +unsigned int clen =0 /* GCC */ ; +u32 major_hash =UINT_MAX , p_cpos, cpos =0 /* GCC */ ; +u64 blkno =0 /* GCC */ ;struct ocfs2_super *osb =OCFS2_SB (dir->i_sb);struct buffer_head *dx_root_bh =NULL ;struct ocfs2_dx_root_block *dx_root;
fs/ocfs2/extent_map.c +2 -2
@@ -416,7 +416,7 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, {int i, ret, tree_height, len;struct ocfs2_dinode *di; -struct ocfs2_extent_block *uninitialized_var (eb ); +struct ocfs2_extent_block *eb =NULL /* GCC */ ;struct ocfs2_extent_list *el;struct ocfs2_extent_rec *rec;struct buffer_head *eb_bh =NULL ;
@@ -611,7 +611,7 @@ int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, unsigned int *extent_flags) {int ret; -unsigned int uninitialized_var (hole_len ), flags =0 ; +unsigned int hole_len =0 /* GCC */ , flags =0 ;struct buffer_head *di_bh =NULL ;struct ocfs2_extent_rec rec;
fs/ocfs2/namei.c +1 -1
@@ -2234,7 +2234,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,struct buffer_head *new_di_bh =NULL ;struct ocfs2_alloc_context *inode_ac =NULL ;struct ocfs2_dir_lookup_result orphan_insert = {NULL , }; -u64 uninitialized_var (di_blkno ), suballoc_loc; +u64 di_blkno =0 /* GCC */ , suballoc_loc;u16 suballoc_bit; status =ocfs2_inode_lock (dir, &parent_di_bh,1 );
fs/ocfs2/refcounttree.c +1 -1
@@ -1066,7 +1066,7 @@ static int ocfs2_get_refcount_rec(struct ocfs2_caching_info *ci, struct buffer_head **ret_bh) {int ret =0 , i, found; -u32 low_cpos,uninitialized_var (cpos_end ); +u32 low_cpos, cpos_end =0 /* GCC */ ;struct ocfs2_extent_list *el;struct ocfs2_extent_rec *rec =NULL ;struct ocfs2_extent_block *eb =NULL ;
fs/ocfs2/stack_user.c +1 -1
@@ -802,7 +802,7 @@ static int fs_protocol_compare(struct ocfs2_protocol_version *existing,static int user_cluster_connect (struct ocfs2_cluster_connection *conn) {dlm_lockspace_t *fsdlm; -struct ocfs2_live_connection *uninitialized_var (control ); +struct ocfs2_live_connection *control =NULL /* GCC */ ;int rc =0 ;BUG_ON (conn ==NULL );
fs/ocfs2/xattr.c +1 -1
@@ -1195,7 +1195,7 @@ static int ocfs2_xattr_block_get(struct inode *inode,struct ocfs2_xattr_value_root *xv;size_t size;int ret = -ENODATA , name_offset, name_len, i; -int uninitialized_var (block_off ); +int block_off =0 /* GCC */ ; xs->bucket =ocfs2_xattr_bucket_new (inode);if (!xs->bucket) {
fs/omfs/file.c +1 -1
@@ -220,7 +220,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,struct buffer_head *bh;sector_t next, offset;int ret; -u64 uninitialized_var (new_block ); +u64 new_block =0 /* GCC */ ;u32 max_extents;int extent_count;struct omfs_extent *oe;
fs/ubifs/budget.c +1 -1
@@ -437,7 +437,7 @@ static int calc_dd_growth(const struct ubifs_info *c,*/ int ubifs_budget_space (struct ubifs_info *c,struct ubifs_budget_req *req) { -int uninitialized_var (cmt_retries ),uninitialized_var (wb_retries ); +int cmt_retries =0 /* GCC */ , wb_retries =0 /* GCC */ ;int err, idx_growth, data_growth, dd_growth, retried =0 ;ubifs_assert (req->new_page <=1 );
fs/ubifs/commit.c +3 -3
@@ -568,11 +568,11 @@ out:*/ int dbg_check_old_index (struct ubifs_info *c,struct ubifs_zbranch *zroot) { -int lnum, offs, len, err =0 ,uninitialized_var (last_level ), child_cnt; +int lnum, offs, len, err =0 , last_level =0 /* GCC */ , child_cnt;int first =1 , iip;struct ubifs_debug_info *d = c->dbg; -union ubifs_key uninitialized_var (lower_key ), upper_key, l_key, u_key; -unsigned long long uninitialized_var (last_sqnum ); +union ubifs_key lower_key = { }/* GCC */ , upper_key, l_key, u_key; +unsigned long long last_sqnum =0 /* GCC */ ;struct ubifs_idx_node *idx;struct list_head list;struct idx_node *i;
fs/ubifs/dir.c +1 -1
@@ -969,7 +969,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,struct ubifs_budget_req ino_req = { .dirtied_ino =1 , .dirtied_ino_d =ALIGN (old_inode_ui->data_len,8 ) };struct timespec time; -unsigned int uninitialized_var (saved_nlink ); +unsigned int saved_nlink =0 /* GCC */ ;/* * Budget request settings: deletion direntry, new direntry, removing
fs/ubifs/file.c +2 -2
@@ -225,7 +225,7 @@ static int write_begin_slow(struct address_space *mapping,struct ubifs_info *c = inode->i_sb->s_fs_info;pgoff_t index = pos >>PAGE_CACHE_SHIFT ;struct ubifs_budget_req req = { .new_page =1 }; -int uninitialized_var (err ), appending = !!(pos + len > inode->i_size); +int err =0 /* GCC */ , appending = !!(pos + len > inode->i_size);struct page *page; dbg_gen("ino %lu, pos %llu, len %u, i_size %lld",
@@ -428,7 +428,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,struct ubifs_info *c = inode->i_sb->s_fs_info;struct ubifs_inode *ui =ubifs_inode (inode);pgoff_t index = pos >>PAGE_CACHE_SHIFT ; -int uninitialized_var (err ), appending = !!(pos + len > inode->i_size); +int err =0 /* GCC */ , appending = !!(pos + len > inode->i_size);int skipped_read =0 ;struct page *page;
fs/ubifs/journal.c +2 -2
@@ -931,7 +931,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,int aligned_dlen1, aligned_dlen2, plen =UBIFS_INO_NODE_SZ ;int last_reference = !!(new_inode && new_inode->i_nlink ==0 );int move = (old_dir != new_dir); -struct ubifs_inode *uninitialized_var (new_ui ); +struct ubifs_inode *new_ui =NULL /* GCC */ ; dbg_jnl("dent '%.*s' in dir ino %lu to dent '%.*s' in dir ino %lu", old_dentry->d_name.len, old_dentry->d_name.name,
@@ -1145,7 +1145,7 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,union ubifs_key key, to_key;struct ubifs_ino_node *ino;struct ubifs_trun_node *trun; -struct ubifs_data_node *uninitialized_var (dn ); +struct ubifs_data_node *dn =NULL /* GCC */ ;int err, dlen, len, lnum, offs, bit, sz, sync =IS_SYNC (inode);struct ubifs_inode *ui =ubifs_inode (inode);ino_t inum = inode->i_ino;
fs/ubifs/lpt.c +1 -1
@@ -285,7 +285,7 @@ uint32_t ubifs_unpack_bits(uint8_t **addr, int *pos, int nrbits)const int k =32 - nrbits;uint8_t *p = *addr;int b = *pos; -uint32_t uninitialized_var (val ); +uint32_t val =0 /* GCC */ ;const int bytes = (nrbits + b +7 ) >>3 ;ubifs_assert (nrbits >0 );
fs/ubifs/tnc.c +3 -3
@@ -898,7 +898,7 @@ static int fallible_resolve_collision(struct ubifs_info *c, const struct qstr *nm, int adding) {struct ubifs_znode *o_znode =NULL , *znode = *zn; -int uninitialized_var (o_n ), err, cmp, unsure =0 , nn = *n; +int o_n =0 /* GCC */ , err, cmp, unsure =0 , nn = *n; cmp =fallible_matches_name (c, &znode->zbranch[nn], nm);if (unlikely (cmp <0 ))
@@ -1519,8 +1519,8 @@ out:*/ int ubifs_tnc_get_bu_keys (struct ubifs_info *c,struct bu_info *bu) { -int n, err =0 , lnum =-1 ,uninitialized_var (offs ); -int uninitialized_var (len ); +int n, err =0 , lnum =-1 , offs =0 /* GCC */ ; +int len =0 /* GCC */ ;unsigned int block =key_block (c, &bu->key);struct ubifs_znode *znode;
fs/ubifs/tnc_misc.c +2 -2
@@ -136,8 +136,8 @@ int ubifs_search_zbranch(const struct ubifs_info *c,const struct ubifs_znode *znode, const union ubifs_key *key, int *n) { - int beg = 0, end = znode->child_cnt, uninitialized_var(mid); -int uninitialized_var (cmp ); + int beg = 0, end = znode->child_cnt, mid = 0 /* GCC */; +int cmp =0 /* GCC */ ;const struct ubifs_zbranch *zbr = &znode->zbranch[0 ];ubifs_assert (end > beg);
fs/udf/balloc.c +1 -1
@@ -645,7 +645,7 @@ static int udf_table_new_block(struct super_block *sb,uint32_t spread =0xFFFFFFFF , nspread =0xFFFFFFFF ;uint32_t newblock =0 , adsize;uint32_t elen, goal_elen =0 ; -struct kernel_lb_addr eloc,uninitialized_var (goal_eloc ); +struct kernel_lb_addr eloc, goal_eloc = { }/* GCC */ ;struct extent_position epos, goal_epos;int8_t etype;struct udf_inode_info *iinfo =UDF_I (table);
fs/xfs/xfs_bmap.c +1 -1
@@ -2218,7 +2218,7 @@ xfs_bmap_rtalloc(* pick an extent that will space things out in the rt area. */ if (ap->eof && ap->offset ==0 ) { -xfs_rtblock_t uninitialized_var (rtx );/* realtime extent no */ +xfs_rtblock_t rtx =0 /* GCC */ ;/* realtime extent no */ error =xfs_rtpick_extent (mp, ap->tp, ralen, &rtx);if (error)
fs/xfs/xfs_file.c +2 -2
@@ -1185,7 +1185,7 @@ xfs_seek_data(struct inode *inode = file->f_mapping->host;struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount; -loff_t uninitialized_var (offset ); +loff_t offset =0 /* GCC */ ;xfs_fsize_t isize;xfs_fileoff_t fsbno;xfs_filblks_t end;
@@ -1287,7 +1287,7 @@ xfs_seek_hole(struct inode *inode = file->f_mapping->host;struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount; -loff_t uninitialized_var (offset ); +loff_t offset =0 /* GCC */ ;xfs_fsize_t isize;xfs_fileoff_t fsbno;xfs_filblks_t end;
include/linux/compiler-gcc.h +0 -6
@@ -103,10 +103,4 @@#define __noclone/* not needed */ #endif -/* -* A trick to suppress uninitialized variable warning without generating any -* code -*/ -#define uninitialized_var (x) x = x -#define __always_inline inline __attribute__((always_inline))
include/linux/compiler-intel.h +0 -2
@@ -27,5 +27,3 @@#define __must_be_array (a) 0#endif - -#define uninitialized_var (x) x
include/linux/mm.h +1 -1
@@ -337,7 +337,7 @@ static inline void compound_unlock(struct page *page)static inline unsigned long compound_lock_irqsave (struct page *page) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;#ifdef CONFIG_TRANSPARENT_HUGEPAGE local_irq_save (flags);compound_lock (page);
ipc/msg.c +1 -1
@@ -412,7 +412,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, struct msqid_ds __user *buf, int version) {struct kern_ipc_perm *ipcp; -struct msqid64_ds uninitialized_var (msqid64 ); +struct msqid64_ds msqid64 = { }/* GCC */ ;struct msg_queue *msq;int err;
kernel/async.c +2 -2
@@ -119,7 +119,7 @@ static void async_run_entry_fn(struct work_struct *work)struct async_entry *entry = container_of(work, struct async_entry, work);unsigned long flags; -ktime_t uninitialized_var (calltime ), delta, rettime; +ktime_t calltime = { }/* GCC */ , delta, rettime;struct async_domain *running = entry->running;/* 1) move self to the running queue */
@@ -302,7 +302,7 @@ EXPORT_SYMBOL_GPL(async_synchronize_full_domain);*/ void async_synchronize_cookie_domain (async_cookie_t cookie,struct async_domain *running) { -ktime_t uninitialized_var (starttime ), delta, endtime; +ktime_t starttime = { }/* GCC */ , delta, endtime;if (!running)return ;
kernel/audit.c +1 -1
@@ -1124,7 +1124,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, {struct audit_buffer *ab =NULL ;struct timespec t; -unsigned int uninitialized_var (serial ); +unsigned int serial =0 /* GCC */ ;int reserve;unsigned long timeout_start = jiffies;
kernel/debug/kdb/kdb_io.c +1 -1
@@ -562,7 +562,7 @@ int vkdb_printf(const char *fmt, va_list ap)char *moreprompt ="more> " ;struct console *c = console_drivers;static DEFINE_SPINLOCK (kdb_printf_lock); -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;preempt_disable (); saved_trap_printk = kdb_trap_printk;
kernel/events/uprobes.c +1 -1
@@ -1449,7 +1449,7 @@ static void handle_swbp(struct pt_regs *regs)struct uprobe_task *utask;struct uprobe *uprobe;unsigned long bp_vaddr; -int uninitialized_var (is_swbp ); +int is_swbp =0 /* GCC */ ; bp_vaddr =uprobe_get_swbp_addr (regs); uprobe =find_active_uprobe (bp_vaddr, &is_swbp);
kernel/exit.c +1 -1
@@ -96,7 +96,7 @@ static void __exit_signal(struct task_struct *tsk)struct signal_struct *sig = tsk->signal;bool group_dead =thread_group_leader (tsk);struct sighand_struct *sighand; -struct tty_struct *uninitialized_var (tty ); +struct tty_struct *tty =NULL /* GCC */ ; sighand =rcu_dereference_check (tsk->sighand,lockdep_tasklist_lock_is_held ());
kernel/futex.c +5 -5
@@ -867,7 +867,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) {struct task_struct *new_owner;struct futex_pi_state *pi_state = this->pi_state; -u32 uninitialized_var (curval ), newval; +u32 curval =0 /* GCC */ , newval;if (!pi_state)return -EINVAL ;
@@ -929,7 +929,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)static int unlock_futex_pi (u32 __user *uaddr,u32 uval) { -u32 uninitialized_var (oldval ); +u32 oldval =0 /* GCC */ ;/* * There is no waiter, so we unlock the futex. The owner died
@@ -1589,7 +1589,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,u32 newtid =task_pid_vnr (newowner) |FUTEX_WAITERS ;struct futex_pi_state *pi_state = q->pi_state;struct task_struct *oldowner = pi_state->owner; -u32 uval,uninitialized_var (curval ), newval; +u32 uval, curval =0 /* GCC */ , newval;int ret;/* Owner died? */
@@ -2488,7 +2488,7 @@ err_unlock:*/ int handle_futex_death (u32 __user *uaddr,struct task_struct *curr,int pi) { -u32 uval,uninitialized_var (nval ), mval; +u32 uval, nval =0 /* GCC */ , mval; retry:if (get_user (uval, uaddr))
@@ -2562,7 +2562,7 @@ void exit_robust_list(struct task_struct *curr)struct robust_list_head __user *head = curr->robust_list;struct robust_list __user *entry, *next_entry, *pending;unsigned int limit =ROBUST_LIST_LIMIT , pi, pip; -unsigned int uninitialized_var (next_pi ); +unsigned int next_pi =0 /* GCC */ ;unsigned long futex_offset;int rc;
kernel/futex_compat.c +1 -1
@@ -51,7 +51,7 @@ void compat_exit_robust_list(struct task_struct *curr)struct compat_robust_list_head __user *head = curr->compat_robust_list;struct robust_list __user *entry, *next_entry, *pending;unsigned int limit =ROBUST_LIST_LIMIT , pi, pip; -unsigned int uninitialized_var (next_pi ); +unsigned int next_pi =0 /* GCC */ ;compat_uptr_t uentry, next_uentry, upending;compat_long_t futex_offset;int rc;
kernel/lockdep.c +7 -7
@@ -1231,7 +1231,7 @@ static int noop_count(struct lock_list *entry, void *data)unsigned long __lockdep_count_forward_deps (struct lock_list *this) {unsigned long count =0 ; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL /* GCC */ ;__bfs_forwards (this, (void *)&count, noop_count, &target_entry);
@@ -1257,7 +1257,7 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)unsigned long __lockdep_count_backward_deps (struct lock_list *this) {unsigned long count =0 ; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL /* GCC */ ;__bfs_backwards (this, (void *)&count, noop_count, &target_entry);
@@ -1551,8 +1551,8 @@ check_usage(struct task_struct *curr, struct held_lock *prev, {int ret;struct lock_list this, that; -struct lock_list *uninitialized_var (target_entry ); -struct lock_list *uninitialized_var (target_entry1 ); +struct lock_list *target_entry =NULL /* GCC */ ; +struct lock_list *target_entry1 =NULL /* GCC */ ; this.parent =NULL ;
@@ -1808,7 +1808,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,struct lock_list *entry;int ret;struct lock_list this; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL /* GCC */ ;/* * Static variable, serialized by the graph_lock(). *
@@ -2344,7 +2344,7 @@ check_usage_forwards(struct task_struct *curr, struct held_lock *this, {int ret;struct lock_list root; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL /* GCC */ ; root.parent =NULL ; root.class =hlock_class (this);
@@ -2368,7 +2368,7 @@ check_usage_backwards(struct task_struct *curr, struct held_lock *this, {int ret;struct lock_list root; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL /* GCC */ ; root.parent =NULL ; root.class =hlock_class (this);
lib/dma-debug.c +1 -1
@@ -725,7 +725,7 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **ostatic int dma_debug_device_change (struct notifier_block *nb,unsigned long action,void *data) {struct device *dev = data; -struct dma_debug_entry *uninitialized_var (entry ); +struct dma_debug_entry *entry =NULL /* GCC */ ;int count;if (global_disable)
lib/radix-tree.c +2 -2
@@ -563,7 +563,7 @@ void *radix_tree_tag_clear(struct radix_tree_root *root,struct radix_tree_node *node =NULL ;struct radix_tree_node *slot =NULL ;unsigned int height, shift; -int uninitialized_var (offset ); +int offset =0 /* GCC */ ; height = root->height;if (index >radix_tree_maxindex (height))
@@ -1313,7 +1313,7 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index)struct radix_tree_node *to_free;unsigned int height, shift;int tag; -int uninitialized_var (offset ); +int offset =0 /* GCC */ ; height = root->height;if (index >radix_tree_maxindex (height))
mm/frontswap.c +1 -1
@@ -318,7 +318,7 @@ static int __frontswap_shrink(unsigned long target_pages,void frontswap_shrink (unsigned long target_pages) {unsigned long pages_to_unuse =0 ; -int uninitialized_var (type ), ret; +int type =0 /* GCC */ , ret;/* * we don't want to hold swap_lock while doing a very
mm/ksm.c +1 -1
@@ -1431,7 +1431,7 @@ next_mm:static void ksm_do_scan (unsigned int scan_npages) {struct rmap_item *rmap_item; -struct page *uninitialized_var (page ); +struct page *page =NULL /* GCC */ ;while (scan_npages-- &&likely (!freezing (current))) {cond_resched ();
mm/memcontrol.c +4 -4
@@ -948,7 +948,7 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, }while (!memcg) { -struct mem_cgroup_reclaim_iter *uninitialized_var (iter ); +struct mem_cgroup_reclaim_iter *iter =NULL /* GCC */ ;struct cgroup_subsys_state *css;if (reclaim) {
@@ -1993,7 +1993,7 @@ void mem_cgroup_update_page_stat(struct page *page, {struct mem_cgroup *memcg;struct page_cgroup *pc =lookup_page_cgroup (page); -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;if (mem_cgroup_disabled ())return ;
@@ -2529,7 +2529,7 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, bool lrucare) {struct page_cgroup *pc =lookup_page_cgroup (page); -struct zone *uninitialized_var (zone ); +struct zone *zone =NULL /* GCC */ ;struct lruvec *lruvec;bool was_on_lru = false;bool anon;
@@ -2706,7 +2706,7 @@ static int mem_cgroup_move_parent(struct page *page, {struct mem_cgroup *parent;unsigned int nr_pages; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;int ret;/* Is ROOT ? */
mm/memory.c +1 -1
@@ -2354,7 +2354,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,pte_t *pte;int err;pgtable_t token; -spinlock_t *uninitialized_var (ptl ); +spinlock_t *ptl =NULL /* GCC */ ; pte = (mm == &init_mm) ? pte_alloc_kernel(pmd, addr) :
mm/mempolicy.c +3 -3
@@ -1089,7 +1089,7 @@ out:static struct page *new_vma_page (struct page *page,unsigned long private,int **x) {struct vm_area_struct *vma = (struct vm_area_struct *)private; -unsigned long uninitialized_var (address ); +unsigned long address =0 /* GCC */ ;while (vma) { address =page_address_in_vma (page, vma);
@@ -1427,7 +1427,7 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, unsigned long, addr, unsigned long, flags) { int err; -int uninitialized_var (pval ); +int pval =0 /* GCC */ ;nodemask_t nodes;if (nmask !=NULL && maxnode <MAX_NUMNODES )
@@ -2431,7 +2431,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) {struct mempolicy *new =NULL ;unsigned short mode; -unsigned short uninitialized_var (mode_flags ); +unsigned short mode_flags =0 /* GCC */ ;nodemask_t nodes;char *nodelist =strchr (str,':' );char *flags =strchr (str,'=' );
mm/oom_kill.c +1 -1
@@ -696,7 +696,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,struct task_struct *p;unsigned long totalpages;unsigned long freed =0 ; -unsigned int uninitialized_var (points ); +unsigned int points =0 /* GCC */ ;enum oom_constraint constraint =CONSTRAINT_NONE ;int killed =0 ;
mm/page-writeback.c +2 -2
@@ -244,7 +244,7 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty) {unsigned long background;unsigned long dirty; -unsigned long uninitialized_var (available_memory ); +unsigned long available_memory =0 /* GCC */ ;struct task_struct *tsk;if (!vm_dirty_bytes || !dirty_background_bytes)
@@ -1713,7 +1713,7 @@ int write_cache_pages(struct address_space *mapping,int done =0 ;struct pagevec pvec;int nr_pages; -pgoff_t uninitialized_var (writeback_index ); +pgoff_t writeback_index =0 /* GCC */ ;pgoff_t index;pgoff_t end;/* Inclusive */ pgoff_t done_index;
mm/page_alloc.c +1 -1
@@ -532,7 +532,7 @@ static inline void __free_one_page(struct page *page, {unsigned long page_idx;unsigned long combined_idx; -unsigned long uninitialized_var (buddy_idx ); +unsigned long buddy_idx =0 /* GCC */ ;struct page *buddy;if (unlikely (PageCompound (page)))
mm/percpu.c +1 -1
@@ -1445,7 +1445,7 @@ static struct pcpu_alloc_info * __init pcpu_build_alloc_info(const size_t static_size = __per_cpu_end - __per_cpu_start;int nr_groups =1 , nr_units =0 ;size_t size_sum, min_unit_size, alloc_size; -int upa, max_upa,uninitialized_var (best_upa );/* units_per_alloc */ +int upa, max_upa, best_upa =0 /* GCC */ ;/* units_per_alloc */ int last_allocs, group, unit;unsigned int cpu, tcpu;struct pcpu_alloc_info *ai;
mm/slub.c +1 -1
@@ -2463,7 +2463,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,struct page new;unsigned long counters;struct kmem_cache_node *n =NULL ; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;stat (s,FREE_SLOWPATH );
mm/swap.c +2 -2
@@ -673,7 +673,7 @@ void release_pages(struct page **pages, int nr, int cold)LIST_HEAD (pages_to_free);struct zone *zone =NULL ;struct lruvec *lruvec; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 /* GCC */ ;for (i =0 ; i < nr; i++) {struct page *page = pages[i];
@@ -739,7 +739,7 @@ EXPORT_SYMBOL(__pagevec_release);void lru_add_page_tail (struct page *page,struct page *page_tail,struct lruvec *lruvec) { -int uninitialized_var (active ); +int active =0 /* GCC */ ;enum lru_list lru;const int file =0 ;
net/dccp/options.c +1 -1
@@ -60,7 +60,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, (dh->dccph_doff *4 );struct dccp_options_received *opt_recv = &dp->dccps_options_received;unsigned char opt, len; -unsigned char *uninitialized_var (value ); +unsigned char *value =NULL /* GCC */ ;u32 elapsed_time;__be32 opt_val;int rc;
net/ipv6/ip6_flowlabel.c +1 -1
@@ -476,7 +476,7 @@ static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl,int ipv6_flowlabel_opt (struct sock *sk,char __user *optval,int optlen) { -int uninitialized_var (err ); +int err =0 /* GCC */ ;struct net *net =sock_net (sk);struct ipv6_pinfo *np =inet6_sk (sk);struct in6_flowlabel_req freq;
net/netfilter/nf_conntrack_ftp.c +1 -1
@@ -358,7 +358,7 @@ static int help(struct sk_buff *skb,int ret;u32 seq;int dir =CTINFO2DIR (ctinfo); -unsigned int uninitialized_var (matchlen ),uninitialized_var (matchoff ); +unsigned int matchlen =0 /* GCC */ , matchoff =0 /* GCC */ ;struct nf_ct_ftp_master *ct_ftp_info =nfct_help_data (ct);struct nf_conntrack_expect *exp;union nf_inet_addr *daddr;
net/netfilter/nfnetlink_queue_core.c +2 -2
@@ -235,7 +235,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,struct net_device *indev;struct net_device *outdev;struct nf_conn *ct =NULL ; -enum ip_conntrack_info uninitialized_var (ctinfo ); +enum ip_conntrack_info ctinfo =0 /* GCC */ ; size =NLMSG_SPACE (sizeof (struct nfgenmsg )) +nla_total_size (sizeof (struct nfqnl_msg_packet_hdr ))
@@ -751,7 +751,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,struct nfqnl_instance *queue;unsigned int verdict;struct nf_queue_entry *entry; -enum ip_conntrack_info uninitialized_var (ctinfo ); +enum ip_conntrack_info ctinfo =0 /* GCC */ ;struct nf_conn *ct =NULL ; queue =instance_lookup (queue_num);
net/netfilter/xt_socket.c +5 -5
@@ -108,9 +108,9 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,const struct iphdr *iph =ip_hdr (skb);struct udphdr _hdr, *hp =NULL ;struct sock *sk; -__be32 uninitialized_var (daddr ),uninitialized_var (saddr ); -__be16 uninitialized_var (dport ),uninitialized_var (sport ); -u8 uninitialized_var (protocol ); +__be32 daddr =0 /* GCC */ , saddr =0 /* GCC */ ; +__be16 dport =0 /* GCC */ , sport =0 /* GCC */ ; +u8 protocol =0 /* GCC */ ;#ifdef XT_SOCKET_HAVE_CONNTRACK struct nf_conn const *ct;enum ip_conntrack_info ctinfo;
@@ -262,8 +262,8 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)struct udphdr _hdr, *hp =NULL ;struct sock *sk;struct in6_addr *daddr =NULL , *saddr =NULL ; -__be16 uninitialized_var (dport ),uninitialized_var (sport ); -int thoff =0 ,uninitialized_var (tproto ); +__be16 dport =0 /* GCC */ , sport =0 /* GCC */ ; +int thoff =0 , tproto =0 /* GCC */ ;const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo; tproto =ipv6_find_hdr (skb, &thoff,-1 ,NULL ,NULL );
net/sched/cls_flow.c +1 -1
@@ -211,7 +211,7 @@ static u32 flow_get_skgid(const struct sk_buff *skb)static u32 flow_get_vlan_tag (const struct sk_buff *skb) { -u16 uninitialized_var (tag ); +u16 tag =0 /* GCC */ ;if (vlan_get_tag (skb, &tag) <0 )return 0 ;
net/sched/sch_cbq.c +1 -1
@@ -373,7 +373,7 @@ static int cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct cbq_sched_data *q = qdisc_priv(sch); -int uninitialized_var (ret ); +int ret =0 /* GCC */ ;struct cbq_class *cl =cbq_classify (skb, sch, &ret);#ifdef CONFIG_NET_CLS_ACT
net/sched/sch_fq_codel.c +1 -1
@@ -172,7 +172,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)struct fq_codel_sched_data *q =qdisc_priv (sch);unsigned int idx;struct fq_codel_flow *flow; -int uninitialized_var (ret ); +int ret =0 /* GCC */ ; idx =fq_codel_classify (skb, sch, &ret);if (idx ==0 ) {
net/sched/sch_hfsc.c +1 -1
@@ -1587,7 +1587,7 @@ static int hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct hfsc_class *cl; -int uninitialized_var (err ); +int err =0 /* GCC */ ; cl =hfsc_classify (skb, sch, &err);if (cl ==NULL ) {
net/sched/sch_htb.c +1 -1
@@ -548,7 +548,7 @@ static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl)static int htb_enqueue (struct sk_buff *skb,struct Qdisc *sch) { -int uninitialized_var (ret ); +int ret =0 /* GCC */ ;struct htb_sched *q =qdisc_priv (sch);struct htb_class *cl =htb_classify (skb, sch, &ret);
net/sched/sch_sfq.c +1 -1
@@ -373,7 +373,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)unsigned int hash;sfq_index x, qlen;struct sfq_slot *slot; -int uninitialized_var (ret ); +int ret =0 /* GCC */ ;struct sk_buff *head;int delta;
net/sunrpc/xprtrdma/svc_rdma_transport.c +1 -1
@@ -831,7 +831,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)struct rdma_conn_param conn_param;struct ib_qp_init_attr qp_attr;struct ib_device_attr devattr; -int uninitialized_var (dma_mr_acc ); +int dma_mr_acc =0 /* GCC */ ;int need_dma_mr;int ret;int i;
sound/core/control_compat.c +1 -1
@@ -223,7 +223,7 @@ static int copy_ctl_value_from_user(struct snd_card *card, int *typep, int *countp) { int i, type, size; -int uninitialized_var (count ); +int count =0 /* GCC */ ;unsigned int indirect;if (copy_from_user (&data->id, &data32->id,sizeof (data->id)))
sound/isa/sb/sb16_csp.c +1 -1
@@ -116,7 +116,7 @@ static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffint snd_sb_csp_new (struct snd_sb *chip,int device,struct snd_hwdep ** rhwdep) {struct snd_sb_csp *p; -int uninitialized_var (version ); +int version =0 /* GCC */ ;int err;struct snd_hwdep *hw;
sound/usb/endpoint.c +1 -1
@@ -300,7 +300,7 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep)while (test_bit (EP_FLAG_RUNNING , &ep->flags)) {unsigned long flags; -struct snd_usb_packet_info *uninitialized_var (packet ); +struct snd_usb_packet_info *packet =NULL /* GCC */ ;struct snd_urb_ctx *ctx =NULL ;struct urb *urb;int err, i;
tools/virtio/linux/virtio.h +0 -2
@@ -105,8 +105,6 @@ static inline void kfree(void *p) const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -#define uninitialized_var (x) x = x -# ifndef likely# define likely (x) (__builtin_expect(!!(x), 1))# endif
Re: [PATCH v2] Remove uninitialized_var()
Quoted 33 lines · Ingo Molnar
Quoted 8 lines · Andrew Morton
Quoted 5 lines · On Sat, 27 Oct 2012 15:12:03 +0200 Ingo Molnar <[email protected]> wrote:
There's 3 types of conversions done:
uninitialized_var(x) => x = 0 /* for scalar types */ uninitialized_var(x) => x = NULL /* for pointers */ uninitialized_var(x) => x = { } /* for structures, unions */Quoted 7 lines
It's regrettable that we lose information.
uninitialized_var()says "this isn't needed - it's just there for gcc". The reader can of course work out the reason with careful code inspection, but that's a lot more time consuming.We could go add "/* keep gcc quiet */" to every site, or add self-documenting macros for the above.
Ok, agreed - I've added /* GCC */ to every site to make people think about it.
I left it a bit mystic because in some cases this macro was mis-used not to suppress GCC being wrong, but to hide GCC being *right*: for example unused variable warnings in cases like:
int uninitialized_var(var); #ifdef XYZ var = ...; ... #endif
Quoted 4 lines
which (ab-)use was no doubt actively dangerous beyond being ugly. One such example is in
arch/x86/mm/numa.c. (These cases now turn into clear (and always harmless) compiler warnings, as they should.)
Shouldn't those cases be using:
int var __maybe_unused;
To clarify that the variable is not used in some configurations. Or moving the variable declaration inside the #ifdef block if possible. The alternative:
#ifdef XYZ int var; #endif ... #ifdef XYZ var = ...; #endif
Does get pretty clunky.
Quoted 10 lines
This further strengthens the argument that we should remove this whole thing.
Thanks,
Ingo
---
Signed-off-by Ingo Molnar <[email protected]>
<snip>
Quoted 1 line
185 files changed, 281 insertions(+), 291 deletions(-)
It might be interesting to know how many instances of uninitialized_var are no longer required because of code change around them. Possibly redefining uninitialized_var as an empty macro and then checking how many don't cause errors would identify if any can just be removed outright rather than converting them to an assignment.
Quoted 18 lines
arch/arm/mach-sa1100/assabet.c +1
-1@@ -388,7 +388,7 @@ static void __init map_sa1100_gpio_regs( void )*/ static void __init get_assabet_scr (void ) { -unsigned long uninitialized_var (scr ), i; +unsigned long scr =0 /* GCC */ , i;GPDR |=0x3fc ;/* Configure GPIO 9:2 as outputs */ GPSR =0x3fc ;/* Write 0xFF to GPIO 9:2 */ arch/ia64/kernel/process.c +0
-0
arch/ia64/kernel/process.c static void · line 496
Quoted 5 lines
arch/ia64/kernel/process.c +1
-1@@ -493,7 +493,7 @@ static void do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg) { unsigned long mask, sp, nat_bits = 0, ar_rnat, urbs_end, cfm; -unsigned long uninitialized_var (ip );/* GCC be quiet */ +unsigned long ip =0 /* GCC */ ;/* GCC be quiet */
Doubled up comment. Same in a few other places.
arch/ia64/mm/discontig.c static void *per_cpu_node_setup(void *cpu_data, int node) · line 188
Quoted 13 lines
arch/ia64/kernel/process.c +0
-0elf_greg_t *dst = arg;struct pt_regs *pt;char nat;arch/ia64/mm/discontig.c +1
-1@@ -185,7 +185,7 @@ static void *per_cpu_node_setup(void *cpu_data, int node)void __init setup_per_cpu_areas (void ) {struct pcpu_alloc_info *ai; -struct pcpu_group_info *uninitialized_var (gi ); +struct pcpu_group_info *gi =NULL /* GCC */ ;
The placement of the comment here is a bit ugly, can you change it so it appears after the semicolon when it is the last initialiser?
~Ryan
PATCH v3 1/1 Remove uninitialized_var()
Quoted 3 lines · Ryan Mallon
Review
Quoted 1 line
(quoted diff) +1
-0+ unsigned long ip = 0 /* GCC */; /* GCC be quiet */Doubled up comment. Same in a few other places.
Yes, fixed.
Quoted 7 lines
Review
Quoted 3 lines
(quoted diff) +1
-1struct pcpu_alloc_info *ai; - struct pcpu_group_info *uninitialized_var(gi); + struct pcpu_group_info *gi = NULL /* GCC */;The placement of the comment here is a bit ugly, can you change it so it appears after the semicolon when it is the last initialiser?
Agreed, I fixed all such places.
Quoted 35 lines
Quoted 12 lines
I left it a bit mystic because in some cases this macro was mis-used not to suppress GCC being wrong, but to hide GCC being *right*: for example unused variable warnings in cases like:
int uninitialized_var(var); #ifdef XYZ var = ...; ... #endifQuoted 4 lines
which (ab-)use was no doubt actively dangerous beyond being ugly. One such example is in
arch/x86/mm/numa.c. (These cases now turn into clear (and always harmless) compiler warnings, as they should.)Shouldn't those cases be using:
int var __maybe_unused;To clarify that the variable is not used in some configurations. Or moving the variable declaration inside the #ifdef block if possible. The alternative:
#ifdef XYZ int var; #endif ... #ifdef XYZ var = ...; #endif
Quoted 1 line
Does get pretty clunky.
No. Putting #ifdef blocks inside functions is an ugly pattern to avoid - adding __maybe_unused or another #ifdef adds insult to injury.
The right solution in those cases is to factor out the #ifdef portion into a separate function. That makes the code more readable (chances are that the reader is not interested in the #ifdef-ed block to begin with), and it also eliminates the GCC warning in a natural way.
Quoted 8 lines
Quoted 1 line
185 files changed, 281 insertions(+), 291 deletions(-)It might be interesting to know how many instances of
uninitialized_varare no longer required because of code change around them. Possibly redefininguninitialized_varas an empty macro and then checking how many don't cause errors would identify if any can just be removed outright rather than converting them to an assignment.
It's better to leave that to the affected maintainers, the changes appearing in their code will be enough of a trigger to have another look. (Or not: as there's another 15 million lines of kernel code to worry about.)
The main goal of this patch is to remove a central source of fragility and to make sure the affected code is better off than it was before. That goal has been more than met.
Thanks,
Ingo
---
arch/arm/mach-sa1100/assabet.c | 2 +- arch/ia64/kernel/process.c | 2 +- arch/ia64/mm/discontig.c | 2 +- arch/ia64/mm/tlb.c | 2 +- arch/ia64/sn/kernel/tiocx.c | 2 +- arch/ia64/sn/pci/pcibr/pcibr_provider.c | 2 +- arch/powerpc/kvm/book3s_pr.c | 2 +- arch/powerpc/kvm/powerpc.c | 2 +- arch/powerpc/mm/numa.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 4 ++-- arch/s390/kernel/smp.c | 2 +- arch/s390/mm/pgtable.c | 4 ++-- arch/tile/include/asm/futex.h | 2 +- arch/x86/kernel/apic/es7000_32.c | 2 +- arch/x86/kernel/quirks.c | 10 +++++----- arch/x86/kvm/mmu.c | 2 +- arch/x86/kvm/paging_tmpl.h | 2 +- arch/x86/mm/numa.c | 2 +- arch/x86/xen/p2m.c | 8 ++++---- arch/xtensa/variants/s6000/delay.c | 4 ++-- drivers/acpi/acpi_pad.c | 2 +- drivers/acpi/acpica/tbutils.c | 2 +- drivers/ata/libata-scsi.c | 2 +- drivers/atm/zatm.c | 2 +- drivers/block/nvme.c | 2 +- drivers/char/mmtimer.c | 2 +- drivers/firewire/ohci.c | 14 +++++++------- drivers/gpu/drm/drm_edid.c | 2 +- drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +- drivers/hid/uhid.c | 2 +- drivers/i2c/busses/i2c-mxs.c | 2 +- drivers/ide/ide-acpi.c | 2 +- drivers/ide/ide-atapi.c | 2 +- drivers/ide/ide-io-std.c | 4 ++-- drivers/ide/ide-io.c | 8 ++++---- drivers/ide/ide-sysfs.c | 2 +- drivers/ide/ide-taskfile.c | 2 +- drivers/ide/umc8672.c | 2 +- drivers/infiniband/core/uverbs_cmd.c | 6 +++--- drivers/infiniband/core/verbs.c | 4 ++-- drivers/infiniband/hw/cxgb3/iwch_qp.c | 2 +- drivers/infiniband/hw/mlx4/qp.c | 8 ++++---- drivers/infiniband/hw/mthca/mthca_qp.c | 10 +++++----- drivers/input/serio/serio_raw.c | 2 +- drivers/iommu/intel-iommu.c | 2 +- drivers/iommu/omap-iommu-debug.c | 2 +- drivers/iommu/tegra-smmu.c | 4 ++-- drivers/isdn/hardware/eicon/debug.c | 2 +- drivers/lguest/lguest_user.c | 2 +- drivers/md/dm-ioctl.c | 2 +- drivers/md/dm-snap-persistent.c | 2 +- drivers/md/dm-table.c | 8 ++++---- drivers/md/raid5.c | 2 +- drivers/media/dvb-frontends/af9013.c | 2 +- drivers/media/dvb-frontends/af9033.c | 2 +- drivers/media/dvb-frontends/cxd2820r_core.c | 2 +- drivers/media/platform/omap3isp/ispqueue.c | 2 +- drivers/media/tuners/tda18212.c | 2 +- drivers/media/tuners/tda18218.c | 2 +- drivers/media/usb/dvb-usb-v2/af9015.c | 2 +- drivers/media/usb/dvb-usb/dib0700_core.c | 2 +- drivers/media/usb/gspca/vicam.c | 2 +- drivers/media/usb/uvc/uvc_video.c | 8 ++++---- drivers/memstick/host/jmb38x_ms.c | 2 +- drivers/memstick/host/tifm_ms.c | 2 +- drivers/mmc/host/sdhci.c | 4 ++-- drivers/mtd/nand/nand_ecc.c | 2 +- drivers/mtd/nand/s3c2410.c | 2 +- drivers/mtd/ubi/attach.c | 2 +- drivers/mtd/ubi/eba.c | 2 +- drivers/mtd/ubi/wl.c | 2 +- drivers/net/dsa/mv88e6060.c | 2 +- drivers/net/dsa/mv88e6xxx.c | 2 +- drivers/net/ethernet/broadcom/bnx2.c | 4 ++-- drivers/net/ethernet/neterion/s2io.c | 2 +- drivers/net/ethernet/qlogic/qla3xxx.c | 2 +- drivers/net/ethernet/realtek/r8169.c | 2 +- drivers/net/ethernet/sis/sis900.c | 2 +- drivers/net/ethernet/sun/cassini.c | 2 +- drivers/net/ethernet/sun/niu.c | 6 +++--- drivers/net/wan/z85230.c | 2 +- drivers/net/wireless/ath/ath6kl/init.c | 2 +- drivers/net/wireless/ath/ath9k/init.c | 2 +- drivers/net/wireless/b43/debugfs.c | 2 +- drivers/net/wireless/b43/dma.c | 2 +- drivers/net/wireless/b43/lo.c | 2 +- drivers/net/wireless/b43/main.c | 2 +- drivers/net/wireless/b43/phy_n.c | 2 +- drivers/net/wireless/b43/xmit.c | 12 ++++++------ drivers/net/wireless/b43legacy/debugfs.c | 2 +- drivers/net/wireless/b43legacy/main.c | 2 +- drivers/net/wireless/iwlegacy/3945.c | 2 +- drivers/net/wireless/iwlegacy/4965-mac.c | 2 +- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 6 +++--- drivers/net/xen-netback/netback.c | 2 +- drivers/pci/pcie/aer/aerdrv_core.c | 2 +- drivers/platform/x86/hdaps.c | 4 ++-- drivers/s390/cio/cio.c | 2 +- drivers/scsi/dc395x.c | 2 +- drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/spi/spi-davinci.c | 2 +- drivers/ssb/driver_chipcommon.c | 4 ++-- drivers/staging/zsmalloc/zsmalloc-main.c | 2 +- drivers/tty/cyclades.c | 2 +- drivers/tty/isicom.c | 2 +- drivers/usb/gadget/uvc_queue.c | 2 +- drivers/usb/musb/cppi_dma.c | 2 +- drivers/usb/storage/sddr55.c | 4 ++-- drivers/vhost/net.c | 4 ++-- drivers/vhost/vhost.c | 2 +- drivers/video/matrox/matroxfb_maven.c | 6 +++--- drivers/video/pm3fb.c | 6 +++--- drivers/video/riva/riva_hw.c | 4 ++-- drivers/virtio/virtio_ring.c | 2 +- fs/afs/dir.c | 2 +- fs/afs/security.c | 2 +- fs/binfmt_flat.c | 2 +- fs/dlm/netlink.c | 2 +- fs/fat/dir.c | 2 +- fs/fuse/control.c | 4 ++-- fs/gfs2/recovery.c | 2 +- fs/hfsplus/unicode.c | 2 +- fs/isofs/namei.c | 4 ++-- fs/jffs2/erase.c | 2 +- fs/nfsd/nfsctl.c | 2 +- fs/ocfs2/alloc.c | 4 ++-- fs/ocfs2/dir.c | 14 +++++++------- fs/ocfs2/extent_map.c | 4 ++-- fs/ocfs2/namei.c | 2 +- fs/ocfs2/refcounttree.c | 2 +- fs/ocfs2/stack_user.c | 2 +- fs/ocfs2/xattr.c | 2 +- fs/omfs/file.c | 2 +- fs/ubifs/budget.c | 2 +- fs/ubifs/commit.c | 6 +++--- fs/ubifs/dir.c | 2 +- fs/ubifs/file.c | 4 ++-- fs/ubifs/journal.c | 4 ++-- fs/ubifs/lpt.c | 2 +- fs/ubifs/tnc.c | 6 +++--- fs/ubifs/tnc_misc.c | 4 ++-- fs/udf/balloc.c | 2 +- fs/xfs/xfs_bmap.c | 2 +- fs/xfs/xfs_file.c | 4 ++-- include/linux/compiler-gcc.h | 6 ------ include/linux/compiler-intel.h | 2 -- include/linux/mm.h | 2 +- ipc/msg.c | 2 +- kernel/async.c | 4 ++-- kernel/audit.c | 2 +- kernel/debug/kdb/kdb_io.c | 2 +- kernel/events/uprobes.c | 2 +- kernel/exit.c | 2 +- kernel/futex.c | 10 +++++----- kernel/futex_compat.c | 2 +- kernel/lockdep.c | 14 +++++++------- lib/dma-debug.c | 2 +- lib/radix-tree.c | 4 ++-- mm/frontswap.c | 2 +- mm/ksm.c | 2 +- mm/memcontrol.c | 8 ++++---- mm/memory.c | 2 +- mm/mempolicy.c | 6 +++--- mm/oom_kill.c | 2 +- mm/page-writeback.c | 4 ++-- mm/page_alloc.c | 2 +- mm/percpu.c | 2 +- mm/slub.c | 2 +- mm/swap.c | 4 ++-- net/dccp/options.c | 2 +- net/ipv6/ip6_flowlabel.c | 2 +- net/netfilter/nf_conntrack_ftp.c | 2 +- net/netfilter/nfnetlink_queue_core.c | 4 ++-- net/netfilter/xt_socket.c | 10 +++++----- net/sched/cls_flow.c | 2 +- net/sched/sch_cbq.c | 2 +- net/sched/sch_fq_codel.c | 2 +- net/sched/sch_hfsc.c | 2 +- net/sched/sch_htb.c | 2 +- net/sched/sch_sfq.c | 2 +- net/sunrpc/xprtrdma/svc_rdma_transport.c | 2 +- sound/core/control_compat.c | 2 +- sound/isa/sb/sb16_csp.c | 2 +- sound/usb/endpoint.c | 2 +- tools/virtio/linux/virtio.h | 2 -- 185 files changed, 281 insertions(+), 291 deletions(-)
arch/arm/mach-sa1100/assabet.c +1 -1
@@ -388,7 +388,7 @@ static void __init map_sa1100_gpio_regs( void )*/ static void __init get_assabet_scr (void ) { -unsigned long uninitialized_var (scr ), i; +unsigned long scr =0 /* Avoid GCC warning */ , i;GPDR |=0x3fc ;/* Configure GPIO 9:2 as outputs */ GPSR =0x3fc ;/* Write 0xFF to GPIO 9:2 */
arch/ia64/kernel/process.c +1 -1
@@ -493,7 +493,7 @@ static void do_copy_task_regs (struct task_struct *task, struct unw_frame_info *info, void *arg) { unsigned long mask, sp, nat_bits = 0, ar_rnat, urbs_end, cfm; -unsigned long uninitialized_var (ip );/* GCC be quiet */ +unsigned long ip =0 ;/* GCC be quiet */ elf_greg_t *dst = arg;struct pt_regs *pt;char nat;
arch/ia64/mm/discontig.c +1 -1
@@ -185,7 +185,7 @@ static void *per_cpu_node_setup(void *cpu_data, int node)void __init setup_per_cpu_areas (void ) {struct pcpu_alloc_info *ai; -struct pcpu_group_info *uninitialized_var (gi ); +struct pcpu_group_info *gi =NULL ;/* Avoid GCC warning */ unsigned int *cpu_map;void *base;unsigned long base_offset;
arch/ia64/mm/tlb.c +1 -1
@@ -340,7 +340,7 @@ EXPORT_SYMBOL(flush_tlb_range);void __devinit ia64_tlb_init (void ) { -ia64_ptce_info_t uninitialized_var (ptce_info );/* GCC be quiet */ +ia64_ptce_info_t ptce_info =0 ;/* GCC be quiet */ u64 tr_pgbits;long status;pal_vm_info_1_u_t vm_info_1;
arch/ia64/sn/kernel/tiocx.c +1 -1
@@ -371,7 +371,7 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)static int is_fpga_tio (int nasid,int *bt) { -u16 uninitialized_var (ioboard_type );/* GCC be quiet */ +u16 ioboard_type =0 ;/* GCC be quiet */ long rc; rc =ia64_sn_sysctl_ioboard_get (nasid, &ioboard_type);
arch/ia64/sn/pci/pcibr/pcibr_provider.c +1 -1
@@ -82,7 +82,7 @@ static int sal_pcibr_error_interrupt(struct pcibus_info *soft)u16 sn_ioboard_to_pci_bus (struct pci_bus *pci_bus) {long rc; -u16 uninitialized_var (ioboard );/* GCC be quiet */ +u16 ioboard =0 ;/* GCC be quiet */ nasid_t nasid =NASID_GET (SN_PCIBUS_BUSSOFT (pci_bus)->bs_base); rc =ia64_sn_sysctl_ioboard_get (nasid, &ioboard);
arch/powerpc/kvm/book3s_pr.c +1 -1
@@ -1012,7 +1012,7 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)#ifdef CONFIG_ALTIVEC vector128 vr[32 ];vector128 vscr; -unsigned long uninitialized_var (vrsave ); +unsigned long vrsave =0 ;/* Avoid GCC warning */ int used_vr;#endif #ifdef CONFIG_VSX
arch/powerpc/kvm/powerpc.c +1 -1
@@ -447,7 +447,7 @@ static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,static void kvmppc_complete_mmio_load (struct kvm_vcpu *vcpu,struct kvm_run *run) { -u64 uninitialized_var (gpr ); +u64 gpr =0 ;/* Avoid GCC warning */ if (run->mmio.len >sizeof (gpr)) {printk (KERN_ERR "bad MMIO length: %d\n" , run->mmio.len);
arch/powerpc/mm/numa.c +1 -1
@@ -637,7 +637,7 @@ static inline int __init read_usm_ranges(const u32 **usm)*/ static void __init parse_drconf_memory (struct device_node *memory) { -const u32 *uninitialized_var (dm ), *usm; +const u32 *dm =NULL /* Avoid GCC warning */ , *usm;unsigned int n, rc, ranges, is_kexec_kdump =0 ;unsigned long lmb_size, base, size, sz;int nid;
arch/powerpc/platforms/pseries/iommu.c +2 -2
@@ -930,8 +930,8 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)int page_shift;u64 dma_addr, max_addr;struct device_node *dn; -const u32 *uninitialized_var (ddw_avail ); -const u32 *uninitialized_var (ddw_extensions ); +const u32 *ddw_avail =NULL ;/* Avoid GCC warning */ +const u32 *ddw_extensions =NULL ;/* Avoid GCC warning */ u32 ddw_restore_token =0 ;struct direct_window *window;struct property *win64;
arch/s390/kernel/smp.c +1 -1
@@ -126,7 +126,7 @@ static int pcpu_sigp_retry(struct pcpu *pcpu, u8 order, u32 parm)static inline int pcpu_stopped (struct pcpu *pcpu) { -u32 uninitialized_var (status ); +u32 status =0 ;/* Avoid GCC warning */ if (__pcpu_sigp (pcpu->address,SIGP_SENSE ,0 , &status) !=SIGP_CC_STATUS_STORED )
arch/s390/mm/pgtable.c +2 -2
@@ -609,8 +609,8 @@ static inline unsigned int atomic_xor_bits(atomic_t *v, unsigned int bits)*/ unsigned long *page_table_alloc (struct mm_struct *mm,unsigned long vmaddr) { -unsigned long *uninitialized_var (table ); -struct page *uninitialized_var (page ); +unsigned long *table =NULL ;/* Avoid GCC warning */ +struct page *page =NULL ;/* Avoid GCC warning */ unsigned int mask, bit;if (mm_has_pgste (mm))
arch/tile/include/asm/futex.h +1 -1
@@ -111,7 +111,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)int cmp = (encoded_op >>24 ) &15 ;int oparg = (encoded_op <<8 ) >>20 ;int cmparg = (encoded_op <<20 ) >>20 ; -int uninitialized_var (val ), ret; +int val =0 /* Avoid GCC warning */ , ret;__futex_prolog ();
arch/x86/kernel/apic/es7000_32.c +1 -1
@@ -529,7 +529,7 @@ static inline int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask, unsigned int *dest_id) { unsigned int round = 0; -unsigned int cpu,uninitialized_var (apicid ); +unsigned int cpu, apicid =0 ;/* Avoid GCC warning */ /* * The cpus in the mask must all be on the apic cluster.
arch/x86/kernel/quirks.c +5 -5
@@ -94,7 +94,7 @@ static void ich_force_hpet_resume(void)static void ich_force_enable_hpet (struct pci_dev *dev) {u32 val; -u32 uninitialized_var (rcba ); +u32 rcba =0 ;/* Avoid GCC warning */ int err =0 ;if (hpet_address || force_hpet_address)
@@ -184,7 +184,7 @@ static void hpet_print_force_info(void)static void old_ich_force_hpet_resume (void ) {u32 val; -u32 uninitialized_var (gen_cntl ); +u32 gen_cntl =0 ;/* Avoid GCC warning */ if (!force_hpet_address || !cached_dev)return ;
@@ -206,7 +206,7 @@ static void old_ich_force_hpet_resume(void)static void old_ich_force_enable_hpet (struct pci_dev *dev) {u32 val; -u32 uninitialized_var (gen_cntl ); +u32 gen_cntl =0 ;/* Avoid GCC warning */ if (hpet_address || force_hpet_address)return ;
@@ -297,7 +297,7 @@ static void vt8237_force_hpet_resume(void)static void vt8237_force_enable_hpet (struct pci_dev *dev) { -u32 uninitialized_var (val ); +u32 val =0 ;/* Avoid GCC warning */ if (hpet_address || force_hpet_address)return ;
@@ -424,7 +424,7 @@ static void nvidia_force_hpet_resume(void)static void nvidia_force_enable_hpet (struct pci_dev *dev) { -u32 uninitialized_var (val ); +u32 val =0 ;/* Avoid GCC warning */ if (hpet_address || force_hpet_address)return ;
arch/x86/kvm/mmu.c +1 -1
@@ -1347,7 +1347,7 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, struct kvm_memory_slot *slot, unsigned long data) {u64 *sptep; -struct rmap_iterator uninitialized_var (iter ); +struct rmap_iterator iter = { };/* Avoid GCC warning */ int young =0 ;/*
arch/x86/kvm/paging_tmpl.h +1 -1
@@ -149,7 +149,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker, {int ret;pt_element_t pte; -pt_element_t __user *uninitialized_var (ptep_user ); +pt_element_t __user *ptep_user =NULL ;/* Avoid GCC warning */ gfn_t table_gfn;unsigned index, pt_access, pte_access, accessed_dirty, shift;gpa_t pte_gpa;
arch/x86/mm/numa.c +1 -1
@@ -490,7 +490,7 @@ static bool __init numa_meminfo_cover_memory(const struct numa_meminfo *mi)static int __init numa_register_memblks (struct numa_meminfo *mi) { -unsigned long uninitialized_var (pfn_align ); +unsigned long pfn_align =0 ;/* Avoid GCC warning */ int i, nid;/* Account for nodes with cpus and no memory */
arch/x86/xen/p2m.c +4 -4
@@ -875,7 +875,7 @@ int m2p_add_override(unsigned long mfn, struct page *page, {unsigned long flags;unsigned long pfn; -unsigned long uninitialized_var (address ); +unsigned long address =0 ;/* Avoid GCC warning */ unsigned level;pte_t *ptep =NULL ;int ret =0 ;
@@ -938,7 +938,7 @@ int m2p_remove_override(struct page *page,unsigned long flags;unsigned long mfn;unsigned long pfn; -unsigned long uninitialized_var (address ); +unsigned long address =0 ;/* Avoid GCC warning */ unsigned level;pte_t *ptep =NULL ;int ret =0 ;
@@ -1079,8 +1079,8 @@ static int p2m_dump_show(struct seq_file *m, void *v) [TYPE_PFN] = "pfn", [TYPE_UNKNOWN] = "abnormal"};unsigned long pfn, prev_pfn_type =0 , prev_pfn_level =0 ; -unsigned int uninitialized_var (prev_level ); -unsigned int uninitialized_var (prev_type ); +unsigned int prev_level =0 ;/* Avoid GCC warning */ +unsigned int prev_type =0 ;/* Avoid GCC warning */ if (!p2m_top)return 0 ;
arch/xtensa/variants/s6000/delay.c +2 -2
@@ -6,8 +6,8 @@#define LOOPS 10void platform_calibrate_ccount (void ) { -u32 uninitialized_var (a ); -u32 uninitialized_var (u ); +u32 a =0 ;/* Avoid GCC warning */ +u32 u =0 ;/* Avoid GCC warning */ u32 b;u32 tstamp =S6_REG_GREG1 +S6_GREG1_GLOBAL_TIMER ;int i =LOOPS +1 ;
drivers/acpi/acpi_pad.c +1 -1
@@ -103,7 +103,7 @@ static void round_robin_cpu(unsigned int tsk_index)cpumask_var_t tmp;int cpu;unsigned long min_weight =-1 ; -unsigned long uninitialized_var (preferred_cpu ); +unsigned long preferred_cpu =0 ;/* Avoid GCC warning */ if (!alloc_cpumask_var (&tmp,GFP_KERNEL ))return ;
drivers/acpi/acpica/tbutils.c +1 -1
@@ -628,7 +628,7 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address)u32 table_count;struct acpi_table_header *table;acpi_physical_address address; -acpi_physical_address uninitialized_var (rsdt_address ); +acpi_physical_address rsdt_address =0 ;/* Avoid GCC warning */ u32 length;u8 *table_entry;acpi_status status;
drivers/ata/libata-scsi.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t ata_scsi_park_show(struct device *device,struct ata_link *link;struct ata_device *dev;unsigned long flags, now; -unsigned int uninitialized_var (msecs ); +unsigned int msecs =0 ;/* Avoid GCC warning */ int rc =0 ; ap =ata_shost_to_port (sdev->host);
drivers/atm/zatm.c +1 -1
@@ -937,7 +937,7 @@ static int open_tx_first(struct atm_vcc *vcc) vcc->qos.txtp.max_pcr >= ATM_OC3_PCR);if (unlimited && zatm_dev->ubr !=-1 ) zatm_vcc->shaper = zatm_dev->ubr; else { - int uninitialized_var(pcr); + int pcr = 0; /* Avoid GCC warning */ if (unlimited) vcc->qos.txtp.max_sdu = ATM_MAX_AAL5_PDU; if ((zatm_vcc->shaper = alloc_shaper(vcc->dev,&pcr,
drivers/block/nvme.c +1 -1
@@ -1197,7 +1197,7 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,struct nvme_admin_cmd cmd;struct nvme_command c;int status, length; -struct nvme_iod *uninitialized_var (iod ); +struct nvme_iod *iod =NULL ;/* Avoid GCC warning */ if (!capable (CAP_SYS_ADMIN ))return -EACCES ;
drivers/char/mmtimer.c +1 -1
@@ -616,7 +616,7 @@ static int sgi_timer_del(struct k_itimer *timr)if (timr->it.mmtimer.clock !=TIMER_OFF ) {unsigned long expires = timr->it.mmtimer.expires;struct rb_node *n = timers[nodeid].timer_head.rb_node; -struct mmtimer *uninitialized_var (t ); +struct mmtimer *t =NULL ;/* Avoid GCC warning */ int r =0 ; timr->it.mmtimer.clock =TIMER_OFF ;
drivers/firewire/ohci.c +7 -7
@@ -1103,7 +1103,7 @@ static void context_tasklet(unsigned long data)static int context_add_buffer (struct context *ctx) {struct descriptor_buffer *desc; -dma_addr_t uninitialized_var (bus_addr ); +dma_addr_t bus_addr =0 ;/* Avoid GCC warning */ int offset;/*
@@ -1265,7 +1265,7 @@ static int at_context_queue_packet(struct context *ctx, struct fw_packet *packet) {struct fw_ohci *ohci = ctx->ohci; -dma_addr_t d_bus,uninitialized_var (payload_bus ); +dma_addr_t d_bus, payload_bus =0 ;/* Avoid GCC warning */ struct driver_data *driver_data;struct descriptor *d, *last;__le32 *header;
@@ -2438,7 +2438,7 @@ static int ohci_set_config_rom(struct fw_card *card, {struct fw_ohci *ohci;__be32 *next_config_rom; -dma_addr_t uninitialized_var (next_config_rom_bus ); +dma_addr_t next_config_rom_bus =0 ;/* Avoid GCC warning */ ohci =fw_ohci (card);
@@ -2922,10 +2922,10 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card, int type, int channel, size_t header_size) { struct fw_ohci *ohci = fw_ohci(card); -struct iso_context *uninitialized_var (ctx ); -descriptor_callback_t uninitialized_var (callback ); -u64 *uninitialized_var (channels ); -u32 *uninitialized_var (mask ),uninitialized_var (regs ); +struct iso_context *ctx =NULL ;/* Avoid GCC warning */ +descriptor_callback_t callback =0 ;/* Avoid GCC warning */ +u64 *channels =NULL ;/* Avoid GCC warning */ +u32 *mask =NULL /* Avoid GCC warning */ , regs =0 ;/* Avoid GCC warning */ int index, ret = -EBUSY ;spin_lock_irq (&ohci->lock);
drivers/gpu/drm/drm_edid.c +1 -1
@@ -1369,7 +1369,7 @@ static int drm_cvt_modes(struct drm_connector *connector,const u8 empty[3 ] = {0 ,0 ,0 };for (i =0 ; i <4 ; i++) { -int uninitialized_var (width ), height; +int width =0 /* Avoid GCC warning */ , height; cvt = &(timing->data.other_data.data.cvt[i]);if (!memcmp (cvt->code, empty,3 ))
drivers/gpu/drm/i915/i915_gem_stolen.c +1 -1
@@ -103,7 +103,7 @@ static void i915_warn_stolen(struct drm_device *dev)static void i915_setup_compression (struct drm_device *dev,int size) {struct drm_i915_private *dev_priv = dev->dev_private; -struct drm_mm_node *compressed_fb, *uninitialized_var (compressed_llb ); +struct drm_mm_node *compressed_fb, *compressed_llb =NULL ;/* Avoid GCC warning */ unsigned long cfb_base;unsigned long ll_base =0 ;
drivers/hid/uhid.c +1 -1
@@ -154,7 +154,7 @@ static int uhid_hid_get_raw(struct hid_device *hid, unsigned char rnum,struct uhid_event *ev;unsigned long flags;int ret; -size_t uninitialized_var (len ); +size_t len =0 ;/* Avoid GCC warning */ struct uhid_feature_answer_req *req;if (!uhid->running)
drivers/i2c/busses/i2c-mxs.c +1 -1
@@ -251,7 +251,7 @@ static int mxs_i2c_wait_for_data(struct mxs_i2c_dev *i2c)static int mxs_i2c_finish_read (struct mxs_i2c_dev *i2c,u8 *buf,int len) { -u32 uninitialized_var (data ); +u32 data =0 ;/* Avoid GCC warning */ int i;for (i =0 ; i < len; i++) {
drivers/ide/ide-acpi.c +1 -1
@@ -170,7 +170,7 @@ err:static acpi_handle ide_acpi_hwif_get_handle (ide_hwif_t *hwif) {struct device *dev = hwif->gendev.parent; -acpi_handle uninitialized_var (dev_handle ); +acpi_handle dev_handle =0 ;/* Avoid GCC warning */ u64 pcidevfn;acpi_handle chan_handle;int err;
drivers/ide/ide-atapi.c +1 -1
@@ -581,7 +581,7 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)static ide_startstop_t ide_transfer_pc (ide_drive_t *drive) { -struct ide_atapi_pc *uninitialized_var (pc ); +struct ide_atapi_pc *pc =NULL ;/* Avoid GCC warning */ ide_hwif_t *hwif = drive->hwif;struct request *rq = hwif->rq;ide_expiry_t *expiry;
drivers/ide/ide-io-std.c +2 -2
@@ -172,7 +172,7 @@ void ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,u8 mmio = (hwif->host_flags &IDE_HFLAG_MMIO ) ?1 :0 ;if (io_32bit) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ if ((io_32bit &2 ) && !mmio) {local_irq_save (flags);
@@ -216,7 +216,7 @@ void ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd, void *buf,u8 mmio = (hwif->host_flags &IDE_HFLAG_MMIO ) ?1 :0 ;if (io_32bit) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ if ((io_32bit &2 ) && !mmio) {local_irq_save (flags);
drivers/ide/ide-io.c +4 -4
@@ -613,12 +613,12 @@ static int drive_is_ready(ide_drive_t *drive)void ide_timer_expiry (unsigned long data) {ide_hwif_t *hwif = (ide_hwif_t *)data; -ide_drive_t *uninitialized_var (drive ); +ide_drive_t *drive =NULL ;/* Avoid GCC warning */ ide_handler_t *handler;unsigned long flags;int wait =-1 ;int plug_device =0 ; -struct request *uninitialized_var (rq_in_flight ); +struct request *rq_in_flight =NULL ;/* Avoid GCC warning */ spin_lock_irqsave (&hwif->lock, flags);
@@ -771,13 +771,13 @@ irqreturn_t ide_intr (int irq, void *dev_id) {ide_hwif_t *hwif = (ide_hwif_t *)dev_id;struct ide_host *host = hwif->host; -ide_drive_t *uninitialized_var (drive ); +ide_drive_t *drive =NULL ;/* Avoid GCC warning */ ide_handler_t *handler;unsigned long flags;ide_startstop_t startstop;irqreturn_t irq_ret =IRQ_NONE ;int plug_device =0 ; -struct request *uninitialized_var (rq_in_flight ); +struct request *rq_in_flight =NULL ;/* Avoid GCC warning */ if (host->host_flags &IDE_HFLAG_SERIALIZE ) {if (hwif != host->cur_port)
drivers/ide/ide-sysfs.c +1 -1
@@ -113,7 +113,7 @@ static struct device_attribute *ide_port_attrs[] = {int ide_sysfs_register_port (ide_hwif_t *hwif) { -int i,uninitialized_var (rc ); +int i, rc =0 ;/* Avoid GCC warning */ for (i =0 ; ide_port_attrs[i]; i++) { rc =device_create_file (hwif->portdev, ide_port_attrs[i]);
drivers/ide/ide-taskfile.c +1 -1
@@ -226,7 +226,7 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,ide_hwif_t *hwif = drive->hwif;struct scatterlist *sg = hwif->sg_table;struct scatterlist *cursg = cmd->cursg; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ struct page *page;unsigned int offset;u8 *buf;
drivers/ide/umc8672.c +1 -1
@@ -107,7 +107,7 @@ static void umc_set_speeds(u8 speeds[])static void umc_set_pio_mode (ide_hwif_t *hwif,ide_drive_t *drive) {ide_hwif_t *mate = hwif->mate; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ const u8 pio = drive->pio_mode -XFER_PIO_0 ; printk("%s: setting umc8672 to PIO mode%d (speed %d)\n",
drivers/infiniband/core/uverbs_cmd.c +3 -3
@@ -1386,7 +1386,7 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,struct ib_device *device;struct ib_pd *pd =NULL ;struct ib_xrcd *xrcd =NULL ; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL ;/* Avoid GCC warning */ struct ib_cq *scq =NULL , *rcq =NULL ;struct ib_srq *srq =NULL ;struct ib_qp *qp;
@@ -1573,7 +1573,7 @@ ssize_t ib_uverbs_open_qp(struct ib_uverbs_file *file,struct ib_udata udata;struct ib_uqp_object *obj;struct ib_xrcd *xrcd; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL ;/* Avoid GCC warning */ struct ib_qp *qp;struct ib_qp_open_attr attr;int ret;
@@ -2475,7 +2475,7 @@ static int __uverbs_create_xsrq(struct ib_uverbs_file *file,struct ib_usrq_object *obj;struct ib_pd *pd;struct ib_srq *srq; -struct ib_uobject *uninitialized_var (xrcd_uobj ); +struct ib_uobject *xrcd_uobj =NULL ;/* Avoid GCC warning */ struct ib_srq_init_attr attr;int ret;
drivers/infiniband/core/verbs.c +2 -2
@@ -314,8 +314,8 @@ int ib_destroy_srq(struct ib_srq *srq) {struct ib_pd *pd;enum ib_srq_type srq_type; -struct ib_xrcd *uninitialized_var (xrcd ); -struct ib_cq *uninitialized_var (cq ); +struct ib_xrcd *xrcd =NULL ;/* Avoid GCC warning */ +struct ib_cq *cq =NULL ;/* Avoid GCC warning */ int ret;if (atomic_read (&srq->usecnt))
drivers/infiniband/hw/cxgb3/iwch_qp.c +1 -1
@@ -351,7 +351,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, struct ib_send_wr **bad_wr) {int err =0 ; -u8 uninitialized_var (t3_wr_flit_cnt ); +u8 t3_wr_flit_cnt =0 ;/* Avoid GCC warning */ enum t3_wr_opcode t3_wr_opcode =0 ;enum t3_wr_flags t3_wr_flags;struct iwch_qp *qhp;
drivers/infiniband/hw/mlx4/qp.c +4 -4
@@ -2187,12 +2187,12 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,int nreq;int err =0 ;unsigned ind; -int uninitialized_var (stamp ); -int uninitialized_var (size ); -unsigned uninitialized_var (seglen ); +int stamp =0 ;/* Avoid GCC warning */ +int size =0 ;/* Avoid GCC warning */ +unsigned seglen =0 ;/* Avoid GCC warning */ __be32 dummy;__be32 *lso_wqe; -__be32 uninitialized_var (lso_hdr_sz ); +__be32 lso_hdr_sz =0 ;/* Avoid GCC warning */ __be32 blh;int i;
drivers/infiniband/hw/mthca/mthca_qp.c +5 -5
@@ -1617,8 +1617,8 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,* without initializing f0 and size0, and they are in fact * never used uninitialized. */ -int uninitialized_var (size0 ); -u32 uninitialized_var (f0 ); +int size0 =0 ;/* Avoid GCC warning */ +u32 f0 =0 ;/* Avoid GCC warning */ int ind;u8 op0 =0 ;
@@ -1818,7 +1818,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,* without initializing size0, and it is in fact never used * uninitialized. */ -int uninitialized_var (size0 ); +int size0 =0 ;/* Avoid GCC warning */ int ind;void *wqe;void *prev_wqe;
@@ -1932,8 +1932,8 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,* without initializing f0 and size0, and they are in fact * never used uninitialized. */ -int uninitialized_var (size0 ); -u32 uninitialized_var (f0 ); +int size0 =0 ;/* Avoid GCC warning */ +u32 f0 =0 ;/* Avoid GCC warning */ int ind;u8 op0 =0 ;
drivers/input/serio/serio_raw.c +1 -1
@@ -163,7 +163,7 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, {struct serio_raw_client *client = file->private_data;struct serio_raw *serio_raw = client->serio_raw; -char uninitialized_var (c ); +char c =0 ;/* Avoid GCC warning */ ssize_t read =0 ;int error;
drivers/iommu/intel-iommu.c +1 -1
@@ -1789,7 +1789,7 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn, unsigned long nr_pages, int prot) {struct dma_pte *first_pte =NULL , *pte =NULL ; -phys_addr_t uninitialized_var (pteval ); +phys_addr_t pteval =0 ;/* Avoid GCC warning */ int addr_width =agaw_to_width (domain->agaw) -VTD_PAGE_SHIFT ;unsigned long sg_res;unsigned int largepage_lvl =0 ;
drivers/iommu/omap-iommu-debug.c +1 -1
@@ -220,7 +220,7 @@ static ssize_t debug_read_mmap(struct file *file, char __user *userbuf,struct omap_iommu *obj =dev_to_omap_iommu (dev);char *p, *buf;struct iovm_struct *tmp; -int uninitialized_var (i ); +int i =0 ;/* Avoid GCC warning */ ssize_t bytes; buf = (char *)__get_free_page (GFP_KERNEL );
drivers/iommu/tegra-smmu.c +2 -2
@@ -1155,8 +1155,8 @@ static int tegra_smmu_probe(struct platform_device *pdev)struct smmu_device *smmu;struct device *dev = &pdev->dev;int i, asids, err =0 ; -dma_addr_t uninitialized_var (base ); -size_t bytes,uninitialized_var (size ); +dma_addr_t base =0 ;/* Avoid GCC warning */ +size_t bytes, size =0 ;/* Avoid GCC warning */ if (smmu_handle)return -EIO ;
drivers/isdn/hardware/eicon/debug.c +1 -1
@@ -1187,7 +1187,7 @@ int SuperTraceASSIGN(void *AdapterHandle, byte *data) {if ((features[0 ] &DIVA_XDI_EXTENDED_FEATURES_VALID ) && (features[0 ] &DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA )) { -dword uninitialized_var (rx_dma_magic ); +dword rx_dma_magic =0 ;/* Avoid GCC warning */ if ((pC->dma_handle =diva_get_dma_descriptor (pC->request, &rx_dma_magic)) >=0 ) { pC->xbuffer[0 ] =LLI ; pC->xbuffer[1 ] =8 ;
drivers/lguest/lguest_user.c +1 -1
@@ -408,7 +408,7 @@ static ssize_t write(struct file *file, const char __user *in,struct lguest *lg = file->private_data;const unsigned long __user *input = (const unsigned long __user *)in;unsigned long req; -struct lg_cpu *uninitialized_var (cpu ); +struct lg_cpu *cpu =NULL ;/* Avoid GCC warning */ unsigned int cpu_id = *off;/* The first value tells us what this request is. */
drivers/md/dm-ioctl.c +1 -1
@@ -1615,7 +1615,7 @@ static int ctl_ioctl(uint command, struct dm_ioctl __user *user)int r =0 ;int wipe_buffer;unsigned int cmd; -struct dm_ioctl *uninitialized_var (param ); +struct dm_ioctl *param =NULL ;/* Avoid GCC warning */ ioctl_fn fn =NULL ;size_t input_param_size;
drivers/md/dm-snap-persistent.c +1 -1
@@ -552,7 +552,7 @@ static int persistent_read_metadata(struct dm_exception_store *store, chunk_t old, chunk_t new), void *callback_context) { - int r, uninitialized_var(new_snapshot); + int r, new_snapshot = 0; /* Avoid GCC warning */struct pstore *ps =get_info (store);/*
drivers/md/dm-table.c +4 -4
@@ -459,7 +459,7 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, struct dm_dev **result) {int r; -dev_t uninitialized_var (dev ); +dev_t dev =0 ;/* Avoid GCC warning */ struct dm_dev_internal *dd;unsigned int major, minor;struct dm_table *t = ti->table;
@@ -689,7 +689,7 @@ static int validate_hardware_logical_block_alignment(struct dm_table *table,*/ unsigned short remaining =0 ; -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL ;/* Avoid GCC warning */ struct queue_limits ti_limits;unsigned i =0 ;
@@ -1230,7 +1230,7 @@ static int count_device(struct dm_target *ti, struct dm_dev *dev,*/ bool dm_table_has_no_data_devices (struct dm_table *table) { -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL ;/* Avoid GCC warning */ unsigned i =0 , num_devices =0 ;while (i <dm_table_get_num_targets (table)) {
@@ -1253,7 +1253,7 @@ bool dm_table_has_no_data_devices(struct dm_table *table)int dm_calculate_queue_limits (struct dm_table *table,struct queue_limits *limits) { -struct dm_target *uninitialized_var (ti ); +struct dm_target *ti =NULL ;/* Avoid GCC warning */ struct queue_limits ti_limits;unsigned i =0 ;
drivers/md/raid5.c +1 -1
@@ -1865,7 +1865,7 @@ static void raid5_end_write_request(struct bio *bi, int error)struct stripe_head *sh = bi->bi_private;struct r5conf *conf = sh->raid_conf;int disks = sh->disks, i; -struct md_rdev *uninitialized_var (rdev ); +struct md_rdev *rdev =NULL ;/* Avoid GCC warning */ int uptodate =test_bit (BIO_UPTODATE , &bi->bi_flags);sector_t first_bad;int bad_sectors;
drivers/media/dvb-frontends/af9013.c +1 -1
@@ -419,7 +419,7 @@ static int af9013_statistics_snr_result(struct dvb_frontend *fe)int ret, i, len;u8 buf[3 ], tmp;u32 snr_val; -const struct af9013_snr *uninitialized_var (snr_lut ); +const struct af9013_snr *snr_lut =NULL ;/* Avoid GCC warning */ dev_dbg (&state->i2c->dev,"%s:\n" , __func__);
drivers/media/dvb-frontends/af9033.c +1 -1
@@ -714,7 +714,7 @@ static int af9033_read_snr(struct dvb_frontend *fe, u16 *snr)int ret, i, len;u8 buf[3 ], tmp;u32 snr_val; -const struct val_snr *uninitialized_var (snr_lut ); +const struct val_snr *snr_lut =NULL ;/* Avoid GCC warning */ /* read value */ ret =af9033_rd_regs (state,0x80002c , buf,3 );
drivers/media/dvb-frontends/cxd2820r_core.c +1 -1
@@ -567,7 +567,7 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)static void cxd2820r_release (struct dvb_frontend *fe) {struct cxd2820r_priv *priv = fe->demodulator_priv; -int uninitialized_var (ret );/* silence compiler warning */ +int ret =0 ;/* Avoid GCC warning */ /* silence compiler warning */ dev_dbg (&priv->i2c->dev,"%s\n" , __func__);
drivers/media/platform/omap3isp/ispqueue.c +1 -1
@@ -1082,7 +1082,7 @@ static const struct vm_operations_struct isp_video_queue_vm_ops = {int omap3isp_video_queue_mmap (struct isp_video_queue *queue,struct vm_area_struct *vma) { -struct isp_video_buffer *uninitialized_var (buf ); +struct isp_video_buffer *buf =NULL ;/* Avoid GCC warning */ unsigned long size;unsigned int i;int ret =0 ;
drivers/media/tuners/tda18212.c +1 -1
@@ -277,7 +277,7 @@ struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, {struct tda18212_priv *priv =NULL ;int ret; -u8 uninitialized_var (val ); +u8 val =0 ;/* Avoid GCC warning */ priv =kzalloc (sizeof (struct tda18212_priv ),GFP_KERNEL );if (priv ==NULL )
drivers/media/tuners/tda18218.c +1 -1
@@ -277,7 +277,7 @@ struct dvb_frontend *tda18218_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct tda18218_config *cfg) { struct tda18218_priv *priv = NULL; -u8 uninitialized_var (val ); +u8 val =0 ;/* Avoid GCC warning */ int ret;/* chip default registers values */ static u8 def_regs[] = {
drivers/media/usb/dvb-usb-v2/af9015.c +1 -1
@@ -208,7 +208,7 @@ static int af9015_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],struct af9015_state *state =d_to_priv (d);int ret =0 , i =0 ;u16 addr; -u8 uninitialized_var (mbox ), addr_len; +u8 mbox =0 /* Avoid GCC warning */ , addr_len;struct req_t req;/*
drivers/media/usb/dvb-usb/dib0700_core.c +1 -1
@@ -675,7 +675,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) {struct dvb_usb_device *d = purb->context;struct dib0700_rc_response *poll_reply; -u32 uninitialized_var (keycode ); +u32 keycode =0 ;/* Avoid GCC warning */ u8 toggle;deb_info ("%s()\n" , __func__);
drivers/media/usb/gspca/vicam.c +1 -1
@@ -239,7 +239,7 @@ static int sd_init(struct gspca_dev *gspca_dev) {int ret;const struct ihex_binrec *rec; -const struct firmware *uninitialized_var (fw ); +const struct firmware *fw =NULL ;/* Avoid GCC warning */ u8 *firmware_buf; ret = request_ihex_firmware(&fw, VICAM_FIRMWARE,
drivers/media/usb/uvc/uvc_video.c +4 -4
@@ -702,9 +702,9 @@ static void uvc_video_stats_decode(struct uvc_streaming *stream,unsigned int header_size;bool has_pts = false;bool has_scr = false; -u16 uninitialized_var (scr_sof ); -u32 uninitialized_var (scr_stc ); -u32 uninitialized_var (pts ); +u16 scr_sof =0 ;/* Avoid GCC warning */ +u32 scr_stc =0 ;/* Avoid GCC warning */ +u32 pts =0 ;/* Avoid GCC warning */ if (stream->stats.stream.nb_frames ==0 && stream->stats.frame.nb_packets ==0 )
@@ -1588,7 +1588,7 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)struct usb_host_endpoint *best_ep =NULL ;unsigned int best_psize =UINT_MAX ;unsigned int bandwidth; -unsigned int uninitialized_var (altsetting ); +unsigned int altsetting =0 ;/* Avoid GCC warning */ int intfnum = stream->intfnum;/* Isochronous endpoint, select the alternate setting. */
drivers/memstick/host/jmb38x_ms.c +1 -1
@@ -315,7 +315,7 @@ static int jmb38x_ms_transfer_data(struct jmb38x_ms_host *host) }while (length) { -unsigned int uninitialized_var (p_off ); +unsigned int p_off =0 ;/* Avoid GCC warning */ if (host->req->long_data) { pg = nth_page(sg_page(&host->req->sg),
drivers/memstick/host/tifm_ms.c +1 -1
@@ -200,7 +200,7 @@ static unsigned int tifm_ms_transfer_data(struct tifm_ms *host) host->block_pos);while (length) { -unsigned int uninitialized_var (p_off ); +unsigned int p_off =0 ;/* Avoid GCC warning */ if (host->req->long_data) { pg = nth_page(sg_page(&host->req->sg),
drivers/mmc/host/sdhci.c +2 -2
@@ -175,7 +175,7 @@ static void sdhci_disable_card_detection(struct sdhci_host *host)static void sdhci_reset (struct sdhci_host *host,u8 mask) {unsigned long timeout; -u32 uninitialized_var (ier ); +u32 ier =0 ;/* Avoid GCC warning */ if (host->quirks &SDHCI_QUIRK_NO_CARD_NO_RESET ) { if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
@@ -311,7 +311,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) {unsigned long flags;size_t blksize, len, chunk; -u32 uninitialized_var (scratch ); +u32 scratch =0 ;/* Avoid GCC warning */ u8 *buf;DBG ("PIO reading\n" );
drivers/mtd/nand/nand_ecc.c +1 -1
@@ -167,7 +167,7 @@ void __nand_calculate_ecc(const unsigned char *buf, unsigned int eccsize,/* rp0..rp15..rp17 are the various accumulated parities (per byte) */ uint32_t rp0, rp1, rp2, rp3, rp4, rp5, rp6, rp7;uint32_t rp8, rp9, rp10, rp11, rp12, rp13, rp14, rp15, rp16; -uint32_t uninitialized_var (rp17 );/* to make compiler happy */ +uint32_t rp17 =0 ;/* Avoid GCC warning */ /* to make compiler happy */ uint32_t par;/* the cumulative parity for all data */ uint32_t tmppar;/* the cumulative parity for this iteration; for rp12, rp14 and rp16 at the end of the
drivers/mtd/nand/s3c2410.c +1 -1
@@ -234,7 +234,7 @@ static int s3c2410_nand_setrate(struct s3c2410_nand_info *info)int tacls_max = (info->cpu_type ==TYPE_S3C2412 ) ?8 :4 ;int tacls, twrph0, twrph1;unsigned long clkrate =clk_get_rate (info->clk); -unsigned long uninitialized_var (set ), cfg,uninitialized_var (mask ); +unsigned long set =0 /* Avoid GCC warning */ , cfg, mask =0 ;/* Avoid GCC warning */ unsigned long flags;/* calculate the timing information for the controller */
drivers/mtd/ubi/attach.c +1 -1
@@ -821,7 +821,7 @@ out_unlock:static int scan_peb (struct ubi_device *ubi,struct ubi_attach_info *ai,int pnum,int *vid,unsigned long long *sqnum) { -long long uninitialized_var (ec ); +long long ec =0 ;/* Avoid GCC warning */ int err, bitflips =0 , vol_id =-1 , ec_err =0 ;dbg_bld ("scan PEB %d" , pnum);
drivers/mtd/ubi/eba.c +1 -1
@@ -374,7 +374,7 @@ int ubi_eba_read_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum, {int err, pnum, scrub =0 , vol_id = vol->vol_id;struct ubi_vid_hdr *vid_hdr; -uint32_t uninitialized_var (crc ); +uint32_t crc =0 ;/* Avoid GCC warning */ err =leb_read_lock (ubi, vol_id, lnum);if (err)
drivers/mtd/ubi/wl.c +1 -1
@@ -994,7 +994,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk, int cancel) {int err, scrubbing =0 , torture =0 , protect =0 , erroneous =0 ; -int vol_id =-1 ,uninitialized_var (lnum ); +int vol_id =-1 , lnum =0 ;/* Avoid GCC warning */ #ifdef CONFIG_MTD_UBI_FASTMAP int anchor = wrk->anchor;#endif
drivers/net/dsa/mv88e6060.c +1 -1
@@ -224,7 +224,7 @@ static void mv88e6060_poll_link(struct dsa_switch *ds)for (i =0 ; i <DSA_MAX_PORTS ; i++) {struct net_device *dev; -int uninitialized_var (port_status ); +int port_status =0 ;/* Avoid GCC warning */ int link;int speed;int duplex;
drivers/net/dsa/mv88e6xxx.c +1 -1
@@ -359,7 +359,7 @@ void mv88e6xxx_poll_link(struct dsa_switch *ds)for (i =0 ; i <DSA_MAX_PORTS ; i++) {struct net_device *dev; -int uninitialized_var (port_status ); +int port_status =0 ;/* Avoid GCC warning */ int link;int speed;int duplex;
drivers/net/ethernet/broadcom/bnx2.c +2 -2
@@ -1432,7 +1432,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp)static void bnx2_enable_forced_2g5 (struct bnx2 *bp) { -u32 uninitialized_var (bmcr ); +u32 bmcr =0 ;/* Avoid GCC warning */ int err;if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ))
@@ -1476,7 +1476,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp)static void bnx2_disable_forced_2g5 (struct bnx2 *bp) { -u32 uninitialized_var (bmcr ); +u32 bmcr =0 ;/* Avoid GCC warning */ int err;if (!(bp->phy_flags &BNX2_PHY_FLAG_2_5G_CAPABLE ))
drivers/net/ethernet/neterion/s2io.c +1 -1
@@ -7331,7 +7331,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)int ring_no = ring_data->ring_no;u16 l3_csum, l4_csum;unsigned long long err = rxdp->Control_1 &RXD_T_CODE ; -struct lro *uninitialized_var (lro ); +struct lro *lro =NULL ;/* Avoid GCC warning */ u8 err_mask;struct swStat *swstats = &sp->mac_control.stats_info->sw_stat;
drivers/net/ethernet/qlogic/qla3xxx.c +1 -1
@@ -3778,7 +3778,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,struct net_device *ndev =NULL ;struct ql3_adapter *qdev =NULL ;static int cards_found; -int uninitialized_var (pci_using_dac ), err; +int pci_using_dac =0 /* Avoid GCC warning */ , err; err =pci_enable_device (pdev);if (err) {
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -5669,7 +5669,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, {struct skb_shared_info *info =skb_shinfo (skb);unsigned int cur_frag, entry; -struct TxDesc *uninitialized_var (txd ); +struct TxDesc * txd =NULL ;/* Avoid GCC warning */ struct device *d = &tp->pci_dev->dev; entry = tp->cur_tx;
drivers/net/ethernet/sis/sis900.c +1 -1
@@ -1319,7 +1319,7 @@ static void sis900_timer(unsigned long data)u16 status;if (!sis_priv->autong_complete){ -int uninitialized_var (speed ), duplex =0 ; +int speed =0 /* Avoid GCC warning */ , duplex =0 ;sis900_read_mode (net_dev, &speed, &duplex);if (duplex){
drivers/net/ethernet/sun/cassini.c +1 -1
@@ -2305,7 +2305,7 @@ static int cas_rx_ringN(struct cas *cp, int ring, int budget) drops =0 ;while (1 ) {struct cas_rx_comp *rxc = rxcs + entry; -struct sk_buff *uninitialized_var (skb ); +struct sk_buff *skb =NULL ;/* Avoid GCC warning */ int type, len;u64 words[4 ];int i, dring;
drivers/net/ethernet/sun/niu.c +3 -3
@@ -428,7 +428,7 @@ static int serdes_init_niu_1g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;u16 pll_cfg, pll_sts;int max_retry =100 ; -u64 uninitialized_var (sig ), mask, val; +u64 sig =0 /* Avoid GCC warning */ , mask, val;u32 tx_cfg, rx_cfg;unsigned long i;int err;
@@ -525,7 +525,7 @@ static int serdes_init_niu_10g_serdes(struct niu *np)struct niu_link_config *lp = &np->link_config;u32 tx_cfg, rx_cfg, pll_cfg, pll_sts;int max_retry =100 ; -u64 uninitialized_var (sig ), mask, val; +u64 sig =0 /* Avoid GCC warning */ , mask, val;unsigned long i;int err;
@@ -713,7 +713,7 @@ static int esr_write_glue0(struct niu *np, unsigned long chan, u32 val)static int esr_reset (struct niu *np) { -u32 uninitialized_var (reset ); +u32 reset =0 ;/* Avoid GCC warning */ int err; err = mdio_write(np, np->port, NIU_ESR_DEV_ADDR,
drivers/net/wan/z85230.c +1 -1
@@ -707,7 +707,7 @@ EXPORT_SYMBOL(z8530_nop);irqreturn_t z8530_interrupt (int irq,void *dev_id) {struct z8530_dev *dev=dev_id; -u8 uninitialized_var (intr ); +u8 intr =0 ;/* Avoid GCC warning */ static volatile int locker=0 ;int work=0 ;struct z8530_irqhandler *irqs;
drivers/net/wireless/ath/ath6kl/init.c +1 -1
@@ -1475,7 +1475,7 @@ static int ath6kl_init_upload(struct ath6kl *ar)int ath6kl_init_hw_params (struct ath6kl *ar) { -const struct ath6kl_hw *uninitialized_var (hw ); +const struct ath6kl_hw *hw =NULL ;/* Avoid GCC warning */ int i;for (i =0 ; i <ARRAY_SIZE (hw_list); i++) {
drivers/net/wireless/ath/ath9k/init.c +1 -1
@@ -222,7 +222,7 @@ static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clstruct ath_hw *ah = (struct ath_hw *) hw_priv;struct ath_common *common =ath9k_hw_common (ah);struct ath_softc *sc = (struct ath_softc *) common->priv; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ u32 val;if (NR_CPUS >1 && ah->config.serialize_regmode ==SER_REG_MODE_ON ) {
drivers/net/wireless/b43/debugfs.c +1 -1
@@ -506,7 +506,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,struct b43_wldev *dev;struct b43_debugfs_fops *dfops;struct b43_dfs_file *dfile; -ssize_t uninitialized_var (ret ); +ssize_t ret =0 ;/* Avoid GCC warning */ char *buf;const size_t bufsize =1024 *16 ;/* 16 kiB buffer */ const size_t buforder =get_order (bufsize);
drivers/net/wireless/b43/dma.c +1 -1
@@ -50,7 +50,7 @@static u32 b43_dma_address (struct b43_dma *dma,dma_addr_t dmaaddr,enum b43_addrtype addrtype) { -u32 uninitialized_var (addr ); +u32 addr =0 ;/* Avoid GCC warning */ switch (addrtype) {case B43_DMA_ADDR_LOW :
drivers/net/wireless/b43/lo.c +1 -1
@@ -742,7 +742,7 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev, };int max_rx_gain;struct b43_lo_calib *cal; -struct lo_g_saved_values uninitialized_var (saved_regs ); +struct lo_g_saved_values saved_regs = { };/* Avoid GCC warning */ /* Values from the "TXCTL Register and Value Table" */ u16 txctl_reg;u16 txctl_value;
drivers/net/wireless/b43/main.c +1 -1
@@ -3705,7 +3705,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)struct b43_wldev *down_dev;struct b43_wldev *d;int err; -bool uninitialized_var (gmode ); +bool gmode =0 ;/* Avoid GCC warning */ int prev_status;/* Find a device and PHY which supports the band. */
drivers/net/wireless/b43/phy_n.c +1 -1
@@ -4569,7 +4569,7 @@ static int b43_nphy_rev2_cal_rx_iq(struct b43_wldev *dev,u8 rfctl[2 ];u8 afectl_core;u16 tmp[6 ]; -u16 uninitialized_var (cur_hpf1 ),uninitialized_var (cur_hpf2 ), cur_lna; +u16 cur_hpf1 =0 /* Avoid GCC warning */ , cur_hpf2 =0 /* Avoid GCC warning */ , cur_lna;u32 real, imag;enum ieee80211_band band;
drivers/net/wireless/b43/xmit.c +6 -6
@@ -427,10 +427,10 @@ int b43_generate_txhdr(struct b43_wldev *dev,if ((rates[0 ].flags &IEEE80211_TX_RC_USE_RTS_CTS ) || (rates[0 ].flags &IEEE80211_TX_RC_USE_CTS_PROTECT )) {unsigned int len; -struct ieee80211_hdr *uninitialized_var (hdr ); +struct ieee80211_hdr *hdr =NULL ;/* Avoid GCC warning */ int rts_rate, rts_rate_fb;int rts_rate_ofdm, rts_rate_fb_ofdm; -struct b43_plcp_hdr6 *uninitialized_var (plcp ); +struct b43_plcp_hdr6 *plcp =NULL ;/* Avoid GCC warning */ struct ieee80211_rate *rts_cts_rate; rts_cts_rate =ieee80211_get_rts_cts_rate (dev->wl->hw, info);
@@ -441,7 +441,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, rts_rate_fb_ofdm =b43_is_ofdm_rate (rts_rate_fb);if (rates[0 ].flags &IEEE80211_TX_RC_USE_CTS_PROTECT ) { -struct ieee80211_cts *uninitialized_var (cts ); +struct ieee80211_cts *cts =NULL ;/* Avoid GCC warning */ switch (dev->fw.hdr_format) {case B43_FW_HDR_598 :
@@ -463,7 +463,7 @@ int b43_generate_txhdr(struct b43_wldev *dev, mac_ctl |=B43_TXH_MAC_SENDCTS ; len =sizeof (struct ieee80211_cts ); }else { -struct ieee80211_rts *uninitialized_var (rts ); +struct ieee80211_rts *rts =NULL ;/* Avoid GCC warning */ switch (dev->fw.hdr_format) {case B43_FW_HDR_598 :
@@ -659,8 +659,8 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)const struct b43_rxhdr_fw4 *rxhdr = _rxhdr;__le16 fctl;u16 phystat0, phystat3; -u16 uninitialized_var (chanstat ),uninitialized_var (mactime ); -u32 uninitialized_var (macstat ); +u16 chanstat =0 /* Avoid GCC warning */ , mactime =0 ;/* Avoid GCC warning */ +u32 macstat =0 ;/* Avoid GCC warning */ u16 chanid;u16 phytype;int padding, rate_idx;
drivers/net/wireless/b43legacy/debugfs.c +1 -1
@@ -203,7 +203,7 @@ static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,struct b43legacy_wldev *dev;struct b43legacy_debugfs_fops *dfops;struct b43legacy_dfs_file *dfile; -ssize_t uninitialized_var (ret ); +ssize_t ret =0 ;/* Avoid GCC warning */ char *buf;const size_t bufsize =1024 *16 ;/* 16 KiB buffer */ const size_t buforder =get_order (bufsize);
drivers/net/wireless/b43legacy/main.c +1 -1
@@ -2588,7 +2588,7 @@ static void b43legacy_put_phy_into_reset(struct b43legacy_wldev *dev)static int b43legacy_switch_phymode (struct b43legacy_wl *wl,unsigned int new_mode) { -struct b43legacy_wldev *uninitialized_var (up_dev ); +struct b43legacy_wldev *up_dev =NULL ;/* Avoid GCC warning */ struct b43legacy_wldev *down_dev;int err;bool gmode = false;
drivers/net/wireless/iwlegacy/3945.c +1 -1
@@ -2092,7 +2092,7 @@ il3945_txpower_set_from_eeprom(struct il_priv *il)/* set tx power value for all OFDM rates */ for (rate_idx =0 ; rate_idx <IL_OFDM_RATES ; rate_idx++) { -s32 uninitialized_var (power_idx ); +s32 power_idx =0 ;/* Avoid GCC warning */ int rc;/* use channel group's clip-power table,
drivers/net/wireless/iwlegacy/4965-mac.c +1 -1
@@ -2754,7 +2754,7 @@ il4965_hdl_tx(struct il_priv *il, struct il_rx_buf *rxb)struct ieee80211_tx_info *info;struct il4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0 ];u32 status =le32_to_cpu (tx_resp->u.status); -int uninitialized_var (tid ); +int tid =0 ;/* Avoid GCC warning */ int sta_id;int freed;u8 *qc =NULL ;
drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +3 -3
@@ -643,7 +643,7 @@ static void _rtl92cu_init_chipN_one_out_ep_priority(struct ieee80211_hw *hw, bool wmm_enable, u8 queue_sel) { -u16 uninitialized_var (value ); +u16 value =0 ;/* Avoid GCC warning */ switch (queue_sel) {case TX_SELE_HQ :
@@ -669,8 +669,8 @@ static void _rtl92cu_init_chipN_two_out_ep_priority(struct ieee80211_hw *hw, u8 queue_sel) {u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ; -u16 uninitialized_var (valueHi ); -u16 uninitialized_var (valueLow ); +u16 valueHi =0 ;/* Avoid GCC warning */ +u16 valueLow =0 ;/* Avoid GCC warning */ switch (queue_sel) {case (TX_SELE_HQ |TX_SELE_LQ ):
drivers/net/xen-netback/netback.c +1 -1
@@ -412,7 +412,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb,* These variables are used iff get_page_ext returns true, * in which case they are guaranteed to be initialized. */ -unsigned int uninitialized_var (group ),uninitialized_var (idx ); +unsigned int group =0 /* Avoid GCC warning */ , idx =0 ;/* Avoid GCC warning */ int foreign =get_page_ext (page, &group, &idx);unsigned long bytes;
drivers/pci/pcie/aer/aerdrv_core.c +1 -1
@@ -783,7 +783,7 @@ void aer_isr(struct work_struct *work) { struct aer_rpc *rpc = container_of(work, struct aer_rpc, dpc_handler);struct pcie_device *p_device = rpc->rpd; -struct aer_err_source uninitialized_var (e_src ); +struct aer_err_source e_src = { };/* Avoid GCC warning */ mutex_lock (&rpc->rpc_mutex);while (get_e_source (rpc, &e_src))
drivers/platform/x86/hdaps.c +2 -2
@@ -379,7 +379,7 @@ static ssize_t hdaps_variance_show(struct device *dev,static ssize_t hdaps_temp1_show (struct device *dev,struct device_attribute *attr,char *buf) { -u8 uninitialized_var (temp ); +u8 temp =0 ;/* Avoid GCC warning */ int ret; ret =hdaps_readb_one (HDAPS_PORT_TEMP1 , &temp);
@@ -392,7 +392,7 @@ static ssize_t hdaps_temp1_show(struct device *dev,static ssize_t hdaps_temp2_show (struct device *dev,struct device_attribute *attr,char *buf) { -u8 uninitialized_var (temp ); +u8 temp =0 ;/* Avoid GCC warning */ int ret; ret =hdaps_readb_one (HDAPS_PORT_TEMP2 , &temp);
drivers/s390/cio/cio.c +1 -1
@@ -1029,7 +1029,7 @@ extern void do_reipl_asm(__u32 schid);/* Make sure all subchannels are quiet before we re-ipl an lpar. */ void reipl_ccw_dev (struct ccw_dev_id *devid) { -struct subchannel_id uninitialized_var (schid ); +struct subchannel_id schid = { };/* Avoid GCC warning */ s390_reset_system (NULL ,NULL );if (reipl_find_schid (devid, &schid) !=0 )
drivers/scsi/dc395x.c +1 -1
@@ -4268,7 +4268,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)const unsigned srbs_per_page =PAGE_SIZE /SEGMENTX_LEN ;int srb_idx =0 ;unsigned i =0 ; -struct SGentry *uninitialized_var (ptr ); +struct SGentry *ptr =NULL ;/* Avoid GCC warning */ for (i =0 ; i < DC395x_MAX_SRB_CNT; i++) acb->srb_array[i].segment_x =NULL ;
drivers/scsi/pm8001/pm8001_hwi.c +1 -1
@@ -3874,7 +3874,7 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha) {struct outbound_queue_table *circularQ;void *pMsg1 =NULL ; -u8 uninitialized_var (bc ); +u8 bc =0 ;/* Avoid GCC warning */ u32 ret =MPI_IO_STATUS_FAIL ;unsigned long flags;
drivers/spi/spi-davinci.c +1 -1
@@ -529,7 +529,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)u32 errors =0 ;struct davinci_spi_config *spicfg;struct davinci_spi_platform_data *pdata; -unsigned uninitialized_var (rx_buf_count ); +unsigned rx_buf_count =0 ;/* Avoid GCC warning */ void *dummy_buf =NULL ;struct scatterlist sg_rx, sg_tx;
drivers/ssb/driver_chipcommon.c +2 -2
@@ -117,7 +117,7 @@ void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,static enum ssb_clksrc chipco_pctl_get_slowclksrc (struct ssb_chipcommon *cc) {struct ssb_bus *bus = cc->dev->bus; -u32 uninitialized_var (tmp ); +u32 tmp =0 ;/* Avoid GCC warning */ if (cc->dev->id.revision <6 ) { if (bus->bustype == SSB_BUSTYPE_SSB ||
@@ -147,7 +147,7 @@ static enum ssb_clksrc chipco_pctl_get_slowclksrc(struct ssb_chipcommon *cc)/* Get maximum or minimum (depending on get_max flag) slowclock frequency. */ static int chipco_pctl_clockfreqlimit (struct ssb_chipcommon *cc,int get_max) { -int uninitialized_var (limit ); +int limit =0 ;/* Avoid GCC warning */ enum ssb_clksrc clocksrc;int divisor =1 ;u32 tmp;
drivers/staging/zsmalloc/zsmalloc-main.c +1 -1
@@ -555,7 +555,7 @@ static void init_zspage(struct page *first_page, struct size_class *class)static struct page *alloc_zspage (struct size_class *class,gfp_t flags) {int i, error; -struct page *first_page =NULL , *uninitialized_var (prev_page ); +struct page *first_page =NULL , *prev_page =NULL ;/* Avoid GCC warning */ /* * Allocate individual pages and link them together as:
drivers/tty/cyclades.c +1 -1
@@ -3698,7 +3698,7 @@ static int __devinit cy_pci_probe(struct pci_dev *pdev,struct cyclades_card *card;void __iomem *addr0 =NULL , *addr2 =NULL ;char *card_name =NULL ; -u32 uninitialized_var (mailbox ); +u32 mailbox =0 ;/* Avoid GCC warning */ unsigned int device_id, nchan =0 , card_no, i, j;unsigned char plx_ver;int retval, irq;
drivers/tty/isicom.c +1 -1
@@ -1551,7 +1551,7 @@ static unsigned int card_count;static int __devinit isicom_probe (struct pci_dev *pdev,const struct pci_device_id *ent) { -unsigned int uninitialized_var (signature ), index; +unsigned int signature =0 /* Avoid GCC warning */ , index;int retval = -EPERM ;struct isi_board *board =NULL ;
drivers/usb/gadget/uvc_queue.c +1 -1
@@ -413,7 +413,7 @@ static struct vm_operations_struct uvc_vm_ops = {static int uvc_queue_mmap (struct uvc_video_queue *queue,struct vm_area_struct *vma) { -struct uvc_buffer *uninitialized_var (buffer ); +struct uvc_buffer *buffer =NULL ;/* Avoid GCC warning */ struct page *page;unsigned long addr, start, size;unsigned int i;
drivers/usb/musb/cppi_dma.c +1 -1
@@ -1167,7 +1167,7 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)struct musb_hw_ep *hw_ep =NULL ;u32 rx, tx;int i, index; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ cppi = container_of(musb->dma_controller, struct cppi, controller);if (cppi->irq)
drivers/usb/storage/sddr55.c +2 -2
@@ -563,8 +563,8 @@ static int sddr55_reset(struct us_data *us)static unsigned long sddr55_get_capacity (struct us_data *us) { -unsigned char uninitialized_var (manufacturerID ); -unsigned char uninitialized_var (deviceID ); +unsigned char manufacturerID =0 ;/* Avoid GCC warning */ +unsigned char deviceID =0 ;/* Avoid GCC warning */ int result;struct sddr55_card_info *info = (struct sddr55_card_info *)us->extra;
drivers/vhost/net.c +2 -2
@@ -145,7 +145,7 @@ static void handle_tx(struct vhost_net *net)int err, wmem;size_t hdr_size;struct socket *sock; -struct vhost_ubuf_ref *uninitialized_var (ubufs ); +struct vhost_ubuf_ref *ubufs =NULL ;/* Avoid GCC warning */ bool zcopy;/* TODO: check that we are running from vhost_worker? */
@@ -364,7 +364,7 @@ err:static void handle_rx (struct vhost_net *net) {struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_RX ]; -unsigned uninitialized_var (in ), log; +unsigned in =0 /* Avoid GCC warning */ , log;struct vhost_log *vq_log;struct msghdr msg = { .msg_name =NULL ,
drivers/vhost/vhost.c +1 -1
@@ -189,7 +189,7 @@ static int vhost_worker(void *data) {struct vhost_dev *dev = data;struct vhost_work *work =NULL ; -unsigned uninitialized_var (seq ); +unsigned seq =0 ;/* Avoid GCC warning */ mm_segment_t oldfs =get_fs ();set_fs (USER_DS );
drivers/video/matrox/matroxfb_maven.c +3 -3
@@ -285,7 +285,7 @@ static int matroxfb_mavenclock(const struct matrox_pll_ctl *ctl, unsigned int* in, unsigned int* feed, unsigned int* post, unsigned int* htotal2) { unsigned int fvco; -unsigned int uninitialized_var (p ); +unsigned int p =0 ;/* Avoid GCC warning */ fvco =matroxfb_PLL_mavenclock (&maven1000_pll, ctl, htotal, vtotal, in, feed, &p, htotal2);if (!fvco)
@@ -717,8 +717,8 @@ static int maven_find_exact_clocks(unsigned int ht, unsigned int vt,for (x =0 ; x <8 ; x++) {unsigned int c; -unsigned int uninitialized_var (a ),uninitialized_var (b ), -uninitialized_var (h2 ); +unsigned int a =0 /* Avoid GCC warning */ , b =0 /* Avoid GCC warning */ , + h2 =0 ;/* Avoid GCC warning */ unsigned int h = ht +2 + x;if (!matroxfb_mavenclock ((m->mode ==MATROXFB_OUTPUT_MODE_PAL ) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) {
drivers/video/pm3fb.c +3 -3
@@ -828,9 +828,9 @@ static void pm3fb_write_mode(struct fb_info *info)wmb (); { -unsigned char uninitialized_var (m );/* ClkPreScale */ -unsigned char uninitialized_var (n );/* ClkFeedBackScale */ -unsigned char uninitialized_var (p );/* ClkPostScale */ +unsigned char m =0 ;/* Avoid GCC warning */ /* ClkPreScale */ +unsigned char n =0 ;/* Avoid GCC warning */ /* ClkFeedBackScale */ +unsigned char p =0 ;/* Avoid GCC warning */ /* ClkPostScale */ unsigned long pixclock =PICOS2KHZ (info->var.pixclock); (void )pm3fb_calculate_clock (pixclock, &m, &n, &p);
drivers/video/riva/riva_hw.c +2 -2
@@ -1243,8 +1243,8 @@ int CalcStateExt ) {int pixelDepth; -int uninitialized_var (VClk ),uninitialized_var (m ), -uninitialized_var (n ),uninitialized_var (p ); +int VClk =0 /* Avoid GCC warning */ ,m =0 /* Avoid GCC warning */ , + n =0 /* Avoid GCC warning */ , p =0 ;/* Avoid GCC warning */ /* * Save mode parameters.
drivers/virtio/virtio_ring.c +1 -1
@@ -206,7 +206,7 @@ int virtqueue_add_buf(struct virtqueue *_vq, gfp_t gfp) {struct vring_virtqueue *vq =to_vvq (_vq); -unsigned int i, avail,uninitialized_var (prev ); +unsigned int i, avail, prev =0 ;/* Avoid GCC warning */ int head;START_USE (vq);
fs/afs/dir.c +1 -1
@@ -601,7 +601,7 @@ success:static int afs_d_revalidate (struct dentry *dentry,unsigned int flags) {struct afs_vnode *vnode, *dir; -struct afs_fid uninitialized_var (fid ); +struct afs_fid fid = { };/* Avoid GCC warning */ struct dentry *parent;struct key *key;void *dir_version;
fs/afs/security.c +1 -1
@@ -288,7 +288,7 @@ static int afs_check_permit(struct afs_vnode *vnode, struct key *key,int afs_permission (struct inode *inode,int mask) {struct afs_vnode *vnode =AFS_FS_I (inode); -afs_access_t uninitialized_var (access ); +afs_access_t access =0 ;/* Avoid GCC warning */ struct key *key;int ret;
fs/binfmt_flat.c +1 -1
@@ -127,7 +127,7 @@ static unsigned long create_flat_tables(char * p = (char *)pp;int argc = bprm->argc;int envc = bprm->envc; -char uninitialized_var (dummy ); +char dummy =0 ;/* Avoid GCC warning */ sp = (unsigned long *)p; sp -= (envc + argc +2 ) +1 + (flat_argvp_envp_on_stack () ?2 :0 );
fs/dlm/netlink.c +1 -1
@@ -114,7 +114,7 @@ static void fill_data(struct dlm_lock_data *data, struct dlm_lkb *lkb)void dlm_timeout_warn (struct dlm_lkb *lkb) { -struct sk_buff *uninitialized_var (send_skb ); +struct sk_buff *send_skb =NULL ;/* Avoid GCC warning */ struct dlm_lock_data *data;size_t size;int rv;
fs/fat/dir.c +1 -1
@@ -1249,7 +1249,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,struct super_block *sb = dir->i_sb;struct msdos_sb_info *sbi =MSDOS_SB (sb);struct buffer_head *bh, *prev, *bhs[3 ];/* 32*slots (672bytes) */ -struct msdos_dir_entry *uninitialized_var (de ); +struct msdos_dir_entry *de =NULL ;/* Avoid GCC warning */ int err, free_slots, i, nr_bhs;loff_t pos, i_pos;
fs/fuse/control.c +2 -2
@@ -117,7 +117,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned uninitialized_var(val); + unsigned val = 0; /* Avoid GCC warning */ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
@@ -154,7 +154,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,const char __user *buf, size_t count, loff_t *ppos) { - unsigned uninitialized_var(val); + unsigned val = 0; /* Avoid GCC warning */ssize_t ret; ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
fs/gfs2/recovery.c +1 -1
@@ -151,7 +151,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk, struct gfs2_log_header_host *head) {struct buffer_head *bh; -struct gfs2_log_header_host uninitialized_var (lh ); +struct gfs2_log_header_host lh = { };/* Avoid GCC warning */ const u32 nothing =0 ;u32 hash;int error;
fs/hfsplus/unicode.c +1 -1
@@ -350,7 +350,7 @@ int hfsplus_hash_dentry(const struct dentry *dentry, const struct inode *inode, astr = str->name; len = str->len;while (len >0 ) { -int uninitialized_var (dsize ); +int dsize =0 ;/* Avoid GCC warning */ size =asc2unichar (sb, astr, len, &c); astr += size; len -= size;
fs/isofs/namei.c +2 -2
@@ -166,8 +166,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,struct dentry *isofs_lookup (struct inode *dir,struct dentry *dentry,unsigned int flags) {int found; -unsigned long uninitialized_var (block ); -unsigned long uninitialized_var (offset ); +unsigned long block =0 ;/* Avoid GCC warning */ +unsigned long offset =0 ;/* Avoid GCC warning */ struct inode *inode;struct page *page;
fs/jffs2/erase.c +1 -1
@@ -428,7 +428,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb {size_t retlen;int ret; -uint32_t uninitialized_var (bad_offset ); +uint32_t bad_offset =0 ;/* Avoid GCC warning */ switch (jffs2_block_check_erase (c, jeb, &bad_offset)) {case -EAGAIN : goto refile;
fs/nfsd/nfsctl.c +1 -1
@@ -315,7 +315,7 @@ static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size)static ssize_t write_filehandle (struct file *file,char *buf,size_t size) {char *dname, *path; -int uninitialized_var (maxsize ); +int maxsize =0 ;/* Avoid GCC warning */ char *mesg = buf;int len;struct auth_domain *dom;
fs/ocfs2/alloc.c +2 -2
@@ -4671,7 +4671,7 @@ int ocfs2_insert_extent(handle_t *handle, struct ocfs2_alloc_context *meta_ac) {int status; -int uninitialized_var (free_records ); +int free_records =0 ;/* Avoid GCC warning */ struct buffer_head *last_eb_bh =NULL ;struct ocfs2_insert_type insert = {0 , };struct ocfs2_extent_rec rec;
@@ -6807,7 +6807,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, {int ret, i, has_data, num_pages =0 ;handle_t *handle; -u64 uninitialized_var (block ); +u64 block =0 ;/* Avoid GCC warning */ struct ocfs2_inode_info *oi =OCFS2_I (inode);struct ocfs2_super *osb =OCFS2_SB (inode->i_sb);struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
fs/ocfs2/dir.c +7 -7
@@ -876,9 +876,9 @@ static int ocfs2_dx_dir_lookup(struct inode *inode, u64 *ret_phys_blkno) {int ret =0 ; -unsigned int cend,uninitialized_var (clen ); -u32 uninitialized_var (cpos ); -u64 uninitialized_var (blkno ); +unsigned int cend, clen =0 ;/* Avoid GCC warning */ +u32 cpos =0 ;/* Avoid GCC warning */ +u64 blkno =0 ;/* Avoid GCC warning */ u32 name_hash = hinfo->major_hash; ret = ocfs2_dx_dir_lookup_rec(inode, el, name_hash, &cpos, &blkno,
@@ -922,7 +922,7 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, struct ocfs2_dir_lookup_result *res) {int ret, i, found; -u64 uninitialized_var (phys ); +u64 phys =0 ;/* Avoid GCC warning */ struct buffer_head *dx_leaf_bh =NULL ;struct ocfs2_dx_leaf *dx_leaf;struct ocfs2_dx_entry *dx_entry =NULL ;
@@ -4486,9 +4486,9 @@ out:int ocfs2_dx_dir_truncate (struct inode *dir,struct buffer_head *di_bh) {int ret; -unsigned int uninitialized_var (clen ); -u32 major_hash =UINT_MAX , p_cpos,uninitialized_var (cpos ); -u64 uninitialized_var (blkno ); +unsigned int clen =0 ;/* Avoid GCC warning */ +u32 major_hash =UINT_MAX , p_cpos, cpos =0 ;/* Avoid GCC warning */ +u64 blkno =0 ;/* Avoid GCC warning */ struct ocfs2_super *osb =OCFS2_SB (dir->i_sb);struct buffer_head *dx_root_bh =NULL ;struct ocfs2_dx_root_block *dx_root;
fs/ocfs2/extent_map.c +2 -2
@@ -416,7 +416,7 @@ static int ocfs2_get_clusters_nocache(struct inode *inode, {int i, ret, tree_height, len;struct ocfs2_dinode *di; -struct ocfs2_extent_block *uninitialized_var (eb ); +struct ocfs2_extent_block *eb =NULL ;/* Avoid GCC warning */ struct ocfs2_extent_list *el;struct ocfs2_extent_rec *rec;struct buffer_head *eb_bh =NULL ;
@@ -611,7 +611,7 @@ int ocfs2_get_clusters(struct inode *inode, u32 v_cluster, unsigned int *extent_flags) {int ret; -unsigned int uninitialized_var (hole_len ), flags =0 ; +unsigned int hole_len =0 /* Avoid GCC warning */ , flags =0 ;struct buffer_head *di_bh =NULL ;struct ocfs2_extent_rec rec;
fs/ocfs2/namei.c +1 -1
@@ -2234,7 +2234,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,struct buffer_head *new_di_bh =NULL ;struct ocfs2_alloc_context *inode_ac =NULL ;struct ocfs2_dir_lookup_result orphan_insert = {NULL , }; -u64 uninitialized_var (di_blkno ), suballoc_loc; +u64 di_blkno =0 /* Avoid GCC warning */ , suballoc_loc;u16 suballoc_bit; status =ocfs2_inode_lock (dir, &parent_di_bh,1 );
fs/ocfs2/refcounttree.c +1 -1
@@ -1066,7 +1066,7 @@ static int ocfs2_get_refcount_rec(struct ocfs2_caching_info *ci, struct buffer_head **ret_bh) {int ret =0 , i, found; -u32 low_cpos,uninitialized_var (cpos_end ); +u32 low_cpos, cpos_end =0 ;/* Avoid GCC warning */ struct ocfs2_extent_list *el;struct ocfs2_extent_rec *rec =NULL ;struct ocfs2_extent_block *eb =NULL ;
fs/ocfs2/stack_user.c +1 -1
@@ -802,7 +802,7 @@ static int fs_protocol_compare(struct ocfs2_protocol_version *existing,static int user_cluster_connect (struct ocfs2_cluster_connection *conn) {dlm_lockspace_t *fsdlm; -struct ocfs2_live_connection *uninitialized_var (control ); +struct ocfs2_live_connection *control =NULL ;/* Avoid GCC warning */ int rc =0 ;BUG_ON (conn ==NULL );
fs/ocfs2/xattr.c +1 -1
@@ -1195,7 +1195,7 @@ static int ocfs2_xattr_block_get(struct inode *inode,struct ocfs2_xattr_value_root *xv;size_t size;int ret = -ENODATA , name_offset, name_len, i; -int uninitialized_var (block_off ); +int block_off =0 ;/* Avoid GCC warning */ xs->bucket =ocfs2_xattr_bucket_new (inode);if (!xs->bucket) {
fs/omfs/file.c +1 -1
@@ -220,7 +220,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,struct buffer_head *bh;sector_t next, offset;int ret; -u64 uninitialized_var (new_block ); +u64 new_block =0 ;/* Avoid GCC warning */ u32 max_extents;int extent_count;struct omfs_extent *oe;
fs/ubifs/budget.c +1 -1
@@ -437,7 +437,7 @@ static int calc_dd_growth(const struct ubifs_info *c,*/ int ubifs_budget_space (struct ubifs_info *c,struct ubifs_budget_req *req) { -int uninitialized_var (cmt_retries ),uninitialized_var (wb_retries ); +int cmt_retries =0 /* Avoid GCC warning */ , wb_retries =0 ;/* Avoid GCC warning */ int err, idx_growth, data_growth, dd_growth, retried =0 ;ubifs_assert (req->new_page <=1 );
fs/ubifs/commit.c +3 -3
@@ -568,11 +568,11 @@ out:*/ int dbg_check_old_index (struct ubifs_info *c,struct ubifs_zbranch *zroot) { -int lnum, offs, len, err =0 ,uninitialized_var (last_level ), child_cnt; +int lnum, offs, len, err =0 , last_level =0 /* Avoid GCC warning */ , child_cnt;int first =1 , iip;struct ubifs_debug_info *d = c->dbg; -union ubifs_key uninitialized_var (lower_key ), upper_key, l_key, u_key; -unsigned long long uninitialized_var (last_sqnum ); +union ubifs_key lower_key = { }/* Avoid GCC warning */ , upper_key, l_key, u_key; +unsigned long long last_sqnum =0 ;/* Avoid GCC warning */ struct ubifs_idx_node *idx;struct list_head list;struct idx_node *i;
fs/ubifs/dir.c +1 -1
@@ -969,7 +969,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,struct ubifs_budget_req ino_req = { .dirtied_ino =1 , .dirtied_ino_d =ALIGN (old_inode_ui->data_len,8 ) };struct timespec time; -unsigned int uninitialized_var (saved_nlink ); +unsigned int saved_nlink =0 ;/* Avoid GCC warning */ /* * Budget request settings: deletion direntry, new direntry, removing
fs/ubifs/file.c +2 -2
@@ -225,7 +225,7 @@ static int write_begin_slow(struct address_space *mapping,struct ubifs_info *c = inode->i_sb->s_fs_info;pgoff_t index = pos >>PAGE_CACHE_SHIFT ;struct ubifs_budget_req req = { .new_page =1 }; -int uninitialized_var (err ), appending = !!(pos + len > inode->i_size); +int err =0 /* Avoid GCC warning */ , appending = !!(pos + len > inode->i_size);struct page *page; dbg_gen("ino %lu, pos %llu, len %u, i_size %lld",
@@ -428,7 +428,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,struct ubifs_info *c = inode->i_sb->s_fs_info;struct ubifs_inode *ui =ubifs_inode (inode);pgoff_t index = pos >>PAGE_CACHE_SHIFT ; -int uninitialized_var (err ), appending = !!(pos + len > inode->i_size); +int err =0 /* Avoid GCC warning */ , appending = !!(pos + len > inode->i_size);int skipped_read =0 ;struct page *page;
fs/ubifs/journal.c +2 -2
@@ -931,7 +931,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,int aligned_dlen1, aligned_dlen2, plen =UBIFS_INO_NODE_SZ ;int last_reference = !!(new_inode && new_inode->i_nlink ==0 );int move = (old_dir != new_dir); -struct ubifs_inode *uninitialized_var (new_ui ); +struct ubifs_inode *new_ui =NULL ;/* Avoid GCC warning */ dbg_jnl("dent '%.*s' in dir ino %lu to dent '%.*s' in dir ino %lu", old_dentry->d_name.len, old_dentry->d_name.name,
@@ -1145,7 +1145,7 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,union ubifs_key key, to_key;struct ubifs_ino_node *ino;struct ubifs_trun_node *trun; -struct ubifs_data_node *uninitialized_var (dn ); +struct ubifs_data_node *dn =NULL ;/* Avoid GCC warning */ int err, dlen, len, lnum, offs, bit, sz, sync =IS_SYNC (inode);struct ubifs_inode *ui =ubifs_inode (inode);ino_t inum = inode->i_ino;
fs/ubifs/lpt.c +1 -1
@@ -285,7 +285,7 @@ uint32_t ubifs_unpack_bits(uint8_t **addr, int *pos, int nrbits)const int k =32 - nrbits;uint8_t *p = *addr;int b = *pos; -uint32_t uninitialized_var (val ); +uint32_t val =0 ;/* Avoid GCC warning */ const int bytes = (nrbits + b +7 ) >>3 ;ubifs_assert (nrbits >0 );
fs/ubifs/tnc.c +3 -3
@@ -898,7 +898,7 @@ static int fallible_resolve_collision(struct ubifs_info *c, const struct qstr *nm, int adding) {struct ubifs_znode *o_znode =NULL , *znode = *zn; -int uninitialized_var (o_n ), err, cmp, unsure =0 , nn = *n; +int o_n =0 /* Avoid GCC warning */ , err, cmp, unsure =0 , nn = *n; cmp =fallible_matches_name (c, &znode->zbranch[nn], nm);if (unlikely (cmp <0 ))
@@ -1519,8 +1519,8 @@ out:*/ int ubifs_tnc_get_bu_keys (struct ubifs_info *c,struct bu_info *bu) { -int n, err =0 , lnum =-1 ,uninitialized_var (offs ); -int uninitialized_var (len ); +int n, err =0 , lnum =-1 , offs =0 ;/* Avoid GCC warning */ +int len =0 ;/* Avoid GCC warning */ unsigned int block =key_block (c, &bu->key);struct ubifs_znode *znode;
fs/ubifs/tnc_misc.c +2 -2
@@ -136,8 +136,8 @@ int ubifs_search_zbranch(const struct ubifs_info *c,const struct ubifs_znode *znode, const union ubifs_key *key, int *n) { - int beg = 0, end = znode->child_cnt, uninitialized_var(mid); -int uninitialized_var (cmp ); + int beg = 0, end = znode->child_cnt, mid = 0; /* Avoid GCC warning */ +int cmp =0 ;/* Avoid GCC warning */ const struct ubifs_zbranch *zbr = &znode->zbranch[0 ];ubifs_assert (end > beg);
fs/udf/balloc.c +1 -1
@@ -645,7 +645,7 @@ static int udf_table_new_block(struct super_block *sb,uint32_t spread =0xFFFFFFFF , nspread =0xFFFFFFFF ;uint32_t newblock =0 , adsize;uint32_t elen, goal_elen =0 ; -struct kernel_lb_addr eloc,uninitialized_var (goal_eloc ); +struct kernel_lb_addr eloc, goal_eloc = { };/* Avoid GCC warning */ struct extent_position epos, goal_epos;int8_t etype;struct udf_inode_info *iinfo =UDF_I (table);
fs/xfs/xfs_bmap.c +1 -1
@@ -2218,7 +2218,7 @@ xfs_bmap_rtalloc(* pick an extent that will space things out in the rt area. */ if (ap->eof && ap->offset ==0 ) { -xfs_rtblock_t uninitialized_var (rtx );/* realtime extent no */ +xfs_rtblock_t rtx =0 ;/* Avoid GCC warning */ /* realtime extent no */ error =xfs_rtpick_extent (mp, ap->tp, ralen, &rtx);if (error)
fs/xfs/xfs_file.c +2 -2
@@ -1185,7 +1185,7 @@ xfs_seek_data(struct inode *inode = file->f_mapping->host;struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount; -loff_t uninitialized_var (offset ); +loff_t offset =0 ;/* Avoid GCC warning */ xfs_fsize_t isize;xfs_fileoff_t fsbno;xfs_filblks_t end;
@@ -1287,7 +1287,7 @@ xfs_seek_hole(struct inode *inode = file->f_mapping->host;struct xfs_inode *ip =XFS_I (inode);struct xfs_mount *mp = ip->i_mount; -loff_t uninitialized_var (offset ); +loff_t offset =0 ;/* Avoid GCC warning */ xfs_fsize_t isize;xfs_fileoff_t fsbno;xfs_filblks_t end;
include/linux/compiler-gcc.h +0 -6
@@ -103,10 +103,4 @@#define __noclone/* not needed */ #endif -/* -* A trick to suppress uninitialized variable warning without generating any -* code -*/ -#define uninitialized_var (x) x = x -#define __always_inline inline __attribute__((always_inline))
include/linux/compiler-intel.h +0 -2
@@ -27,5 +27,3 @@#define __must_be_array (a) 0#endif - -#define uninitialized_var (x) x
include/linux/mm.h +1 -1
@@ -337,7 +337,7 @@ static inline void compound_unlock(struct page *page)static inline unsigned long compound_lock_irqsave (struct page *page) { -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ #ifdef CONFIG_TRANSPARENT_HUGEPAGE local_irq_save (flags);compound_lock (page);
ipc/msg.c +1 -1
@@ -412,7 +412,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd, struct msqid_ds __user *buf, int version) {struct kern_ipc_perm *ipcp; -struct msqid64_ds uninitialized_var (msqid64 ); +struct msqid64_ds msqid64 = { };/* Avoid GCC warning */ struct msg_queue *msq;int err;
kernel/async.c +2 -2
@@ -119,7 +119,7 @@ static void async_run_entry_fn(struct work_struct *work)struct async_entry *entry = container_of(work, struct async_entry, work);unsigned long flags; -ktime_t uninitialized_var (calltime ), delta, rettime; +ktime_t calltime = { }/* Avoid GCC warning */ , delta, rettime;struct async_domain *running = entry->running;/* 1) move self to the running queue */
@@ -302,7 +302,7 @@ EXPORT_SYMBOL_GPL(async_synchronize_full_domain);*/ void async_synchronize_cookie_domain (async_cookie_t cookie,struct async_domain *running) { -ktime_t uninitialized_var (starttime ), delta, endtime; +ktime_t starttime = { }/* Avoid GCC warning */ , delta, endtime;if (!running)return ;
kernel/audit.c +1 -1
@@ -1124,7 +1124,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, {struct audit_buffer *ab =NULL ;struct timespec t; -unsigned int uninitialized_var (serial ); +unsigned int serial =0 ;/* Avoid GCC warning */ int reserve;unsigned long timeout_start = jiffies;
kernel/debug/kdb/kdb_io.c +1 -1
@@ -562,7 +562,7 @@ int vkdb_printf(const char *fmt, va_list ap)char *moreprompt ="more> " ;struct console *c = console_drivers;static DEFINE_SPINLOCK (kdb_printf_lock); -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ preempt_disable (); saved_trap_printk = kdb_trap_printk;
kernel/events/uprobes.c +1 -1
@@ -1449,7 +1449,7 @@ static void handle_swbp(struct pt_regs *regs)struct uprobe_task *utask;struct uprobe *uprobe;unsigned long bp_vaddr; -int uninitialized_var (is_swbp ); +int is_swbp =0 ;/* Avoid GCC warning */ bp_vaddr =uprobe_get_swbp_addr (regs); uprobe =find_active_uprobe (bp_vaddr, &is_swbp);
kernel/exit.c +1 -1
@@ -96,7 +96,7 @@ static void __exit_signal(struct task_struct *tsk)struct signal_struct *sig = tsk->signal;bool group_dead =thread_group_leader (tsk);struct sighand_struct *sighand; -struct tty_struct *uninitialized_var (tty ); +struct tty_struct *tty =NULL ;/* Avoid GCC warning */ sighand =rcu_dereference_check (tsk->sighand,lockdep_tasklist_lock_is_held ());
kernel/futex.c +5 -5
@@ -867,7 +867,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) {struct task_struct *new_owner;struct futex_pi_state *pi_state = this->pi_state; -u32 uninitialized_var (curval ), newval; +u32 curval =0 /* Avoid GCC warning */ , newval;if (!pi_state)return -EINVAL ;
@@ -929,7 +929,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this)static int unlock_futex_pi (u32 __user *uaddr,u32 uval) { -u32 uninitialized_var (oldval ); +u32 oldval =0 ;/* Avoid GCC warning */ /* * There is no waiter, so we unlock the futex. The owner died
@@ -1589,7 +1589,7 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,u32 newtid =task_pid_vnr (newowner) |FUTEX_WAITERS ;struct futex_pi_state *pi_state = q->pi_state;struct task_struct *oldowner = pi_state->owner; -u32 uval,uninitialized_var (curval ), newval; +u32 uval, curval =0 /* Avoid GCC warning */ , newval;int ret;/* Owner died? */
@@ -2488,7 +2488,7 @@ err_unlock:*/ int handle_futex_death (u32 __user *uaddr,struct task_struct *curr,int pi) { -u32 uval,uninitialized_var (nval ), mval; +u32 uval, nval =0 /* Avoid GCC warning */ , mval; retry:if (get_user (uval, uaddr))
@@ -2562,7 +2562,7 @@ void exit_robust_list(struct task_struct *curr)struct robust_list_head __user *head = curr->robust_list;struct robust_list __user *entry, *next_entry, *pending;unsigned int limit =ROBUST_LIST_LIMIT , pi, pip; -unsigned int uninitialized_var (next_pi ); +unsigned int next_pi =0 ;/* Avoid GCC warning */ unsigned long futex_offset;int rc;
kernel/futex_compat.c +1 -1
@@ -51,7 +51,7 @@ void compat_exit_robust_list(struct task_struct *curr)struct compat_robust_list_head __user *head = curr->compat_robust_list;struct robust_list __user *entry, *next_entry, *pending;unsigned int limit =ROBUST_LIST_LIMIT , pi, pip; -unsigned int uninitialized_var (next_pi ); +unsigned int next_pi =0 ;/* Avoid GCC warning */ compat_uptr_t uentry, next_uentry, upending;compat_long_t futex_offset;int rc;
kernel/lockdep.c +7 -7
@@ -1231,7 +1231,7 @@ static int noop_count(struct lock_list *entry, void *data)unsigned long __lockdep_count_forward_deps (struct lock_list *this) {unsigned long count =0 ; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;/* Avoid GCC warning */ __bfs_forwards (this, (void *)&count, noop_count, &target_entry);
@@ -1257,7 +1257,7 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)unsigned long __lockdep_count_backward_deps (struct lock_list *this) {unsigned long count =0 ; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;/* Avoid GCC warning */ __bfs_backwards (this, (void *)&count, noop_count, &target_entry);
@@ -1551,8 +1551,8 @@ check_usage(struct task_struct *curr, struct held_lock *prev, {int ret;struct lock_list this, that; -struct lock_list *uninitialized_var (target_entry ); -struct lock_list *uninitialized_var (target_entry1 ); +struct lock_list *target_entry =NULL ;/* Avoid GCC warning */ +struct lock_list *target_entry1 =NULL ;/* Avoid GCC warning */ this.parent =NULL ;
@@ -1808,7 +1808,7 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev,struct lock_list *entry;int ret;struct lock_list this; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;/* Avoid GCC warning */ /* * Static variable, serialized by the graph_lock(). *
@@ -2344,7 +2344,7 @@ check_usage_forwards(struct task_struct *curr, struct held_lock *this, {int ret;struct lock_list root; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;/* Avoid GCC warning */ root.parent =NULL ; root.class =hlock_class (this);
@@ -2368,7 +2368,7 @@ check_usage_backwards(struct task_struct *curr, struct held_lock *this, {int ret;struct lock_list root; -struct lock_list *uninitialized_var (target_entry ); +struct lock_list *target_entry =NULL ;/* Avoid GCC warning */ root.parent =NULL ; root.class =hlock_class (this);
lib/dma-debug.c +1 -1
@@ -725,7 +725,7 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **ostatic int dma_debug_device_change (struct notifier_block *nb,unsigned long action,void *data) {struct device *dev = data; -struct dma_debug_entry *uninitialized_var (entry ); +struct dma_debug_entry *entry =NULL ;/* Avoid GCC warning */ int count;if (global_disable)
lib/radix-tree.c +2 -2
@@ -563,7 +563,7 @@ void *radix_tree_tag_clear(struct radix_tree_root *root,struct radix_tree_node *node =NULL ;struct radix_tree_node *slot =NULL ;unsigned int height, shift; -int uninitialized_var (offset ); +int offset =0 ;/* Avoid GCC warning */ height = root->height;if (index >radix_tree_maxindex (height))
@@ -1313,7 +1313,7 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index)struct radix_tree_node *to_free;unsigned int height, shift;int tag; -int uninitialized_var (offset ); +int offset =0 ;/* Avoid GCC warning */ height = root->height;if (index >radix_tree_maxindex (height))
mm/frontswap.c +1 -1
@@ -318,7 +318,7 @@ static int __frontswap_shrink(unsigned long target_pages,void frontswap_shrink (unsigned long target_pages) {unsigned long pages_to_unuse =0 ; -int uninitialized_var (type ), ret; +int type =0 /* Avoid GCC warning */ , ret;/* * we don't want to hold swap_lock while doing a very
mm/ksm.c +1 -1
@@ -1431,7 +1431,7 @@ next_mm:static void ksm_do_scan (unsigned int scan_npages) {struct rmap_item *rmap_item; -struct page *uninitialized_var (page ); +struct page *page =NULL ;/* Avoid GCC warning */ while (scan_npages-- &&likely (!freezing (current))) {cond_resched ();
mm/memcontrol.c +4 -4
@@ -948,7 +948,7 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, }while (!memcg) { -struct mem_cgroup_reclaim_iter *uninitialized_var (iter ); +struct mem_cgroup_reclaim_iter *iter =NULL ;/* Avoid GCC warning */ struct cgroup_subsys_state *css;if (reclaim) {
@@ -1993,7 +1993,7 @@ void mem_cgroup_update_page_stat(struct page *page, {struct mem_cgroup *memcg;struct page_cgroup *pc =lookup_page_cgroup (page); -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ if (mem_cgroup_disabled ())return ;
@@ -2529,7 +2529,7 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *memcg, bool lrucare) {struct page_cgroup *pc =lookup_page_cgroup (page); -struct zone *uninitialized_var (zone ); +struct zone *zone =NULL ;/* Avoid GCC warning */ struct lruvec *lruvec;bool was_on_lru = false;bool anon;
@@ -2706,7 +2706,7 @@ static int mem_cgroup_move_parent(struct page *page, {struct mem_cgroup *parent;unsigned int nr_pages; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ int ret;/* Is ROOT ? */
mm/memory.c +1 -1
@@ -2354,7 +2354,7 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,pte_t *pte;int err;pgtable_t token; -spinlock_t *uninitialized_var (ptl ); +spinlock_t *ptl =NULL ;/* Avoid GCC warning */ pte = (mm == &init_mm) ? pte_alloc_kernel(pmd, addr) :
mm/mempolicy.c +3 -3
@@ -1089,7 +1089,7 @@ out:static struct page *new_vma_page (struct page *page,unsigned long private,int **x) {struct vm_area_struct *vma = (struct vm_area_struct *)private; -unsigned long uninitialized_var (address ); +unsigned long address =0 ;/* Avoid GCC warning */ while (vma) { address =page_address_in_vma (page, vma);
@@ -1427,7 +1427,7 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, unsigned long, addr, unsigned long, flags) { int err; -int uninitialized_var (pval ); +int pval =0 ;/* Avoid GCC warning */ nodemask_t nodes;if (nmask !=NULL && maxnode <MAX_NUMNODES )
@@ -2431,7 +2431,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) {struct mempolicy *new =NULL ;unsigned short mode; -unsigned short uninitialized_var (mode_flags ); +unsigned short mode_flags =0 ;/* Avoid GCC warning */ nodemask_t nodes;char *nodelist =strchr (str,':' );char *flags =strchr (str,'=' );
mm/oom_kill.c +1 -1
@@ -696,7 +696,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,struct task_struct *p;unsigned long totalpages;unsigned long freed =0 ; -unsigned int uninitialized_var (points ); +unsigned int points =0 ;/* Avoid GCC warning */ enum oom_constraint constraint =CONSTRAINT_NONE ;int killed =0 ;
mm/page-writeback.c +2 -2
@@ -244,7 +244,7 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty) {unsigned long background;unsigned long dirty; -unsigned long uninitialized_var (available_memory ); +unsigned long available_memory =0 ;/* Avoid GCC warning */ struct task_struct *tsk;if (!vm_dirty_bytes || !dirty_background_bytes)
@@ -1713,7 +1713,7 @@ int write_cache_pages(struct address_space *mapping,int done =0 ;struct pagevec pvec;int nr_pages; -pgoff_t uninitialized_var (writeback_index ); +pgoff_t writeback_index =0 ;/* Avoid GCC warning */ pgoff_t index;pgoff_t end;/* Inclusive */ pgoff_t done_index;
mm/page_alloc.c +1 -1
@@ -532,7 +532,7 @@ static inline void __free_one_page(struct page *page, {unsigned long page_idx;unsigned long combined_idx; -unsigned long uninitialized_var (buddy_idx ); +unsigned long buddy_idx =0 ;/* Avoid GCC warning */ struct page *buddy;if (unlikely (PageCompound (page)))
mm/percpu.c +1 -1
@@ -1445,7 +1445,7 @@ static struct pcpu_alloc_info * __init pcpu_build_alloc_info(const size_t static_size = __per_cpu_end - __per_cpu_start;int nr_groups =1 , nr_units =0 ;size_t size_sum, min_unit_size, alloc_size; -int upa, max_upa,uninitialized_var (best_upa );/* units_per_alloc */ +int upa, max_upa, best_upa =0 ;/* Avoid GCC warning */ /* units_per_alloc */ int last_allocs, group, unit;unsigned int cpu, tcpu;struct pcpu_alloc_info *ai;
mm/slub.c +1 -1
@@ -2463,7 +2463,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,struct page new;unsigned long counters;struct kmem_cache_node *n =NULL ; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ stat (s,FREE_SLOWPATH );
mm/swap.c +2 -2
@@ -673,7 +673,7 @@ void release_pages(struct page **pages, int nr, int cold)LIST_HEAD (pages_to_free);struct zone *zone =NULL ;struct lruvec *lruvec; -unsigned long uninitialized_var (flags ); +unsigned long flags =0 ;/* Avoid GCC warning */ for (i =0 ; i < nr; i++) {struct page *page = pages[i];
@@ -739,7 +739,7 @@ EXPORT_SYMBOL(__pagevec_release);void lru_add_page_tail (struct page *page,struct page *page_tail,struct lruvec *lruvec) { -int uninitialized_var (active ); +int active =0 ;/* Avoid GCC warning */ enum lru_list lru;const int file =0 ;
net/dccp/options.c +1 -1
@@ -60,7 +60,7 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, (dh->dccph_doff *4 );struct dccp_options_received *opt_recv = &dp->dccps_options_received;unsigned char opt, len; -unsigned char *uninitialized_var (value ); +unsigned char *value =NULL ;/* Avoid GCC warning */ u32 elapsed_time;__be32 opt_val;int rc;
net/ipv6/ip6_flowlabel.c +1 -1
@@ -476,7 +476,7 @@ static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl,int ipv6_flowlabel_opt (struct sock *sk,char __user *optval,int optlen) { -int uninitialized_var (err ); +int err =0 ;/* Avoid GCC warning */ struct net *net =sock_net (sk);struct ipv6_pinfo *np =inet6_sk (sk);struct in6_flowlabel_req freq;
net/netfilter/nf_conntrack_ftp.c +1 -1
@@ -358,7 +358,7 @@ static int help(struct sk_buff *skb,int ret;u32 seq;int dir =CTINFO2DIR (ctinfo); -unsigned int uninitialized_var (matchlen ),uninitialized_var (matchoff ); +unsigned int matchlen =0 /* Avoid GCC warning */ , matchoff =0 ;/* Avoid GCC warning */ struct nf_ct_ftp_master *ct_ftp_info =nfct_help_data (ct);struct nf_conntrack_expect *exp;union nf_inet_addr *daddr;
net/netfilter/nfnetlink_queue_core.c +2 -2
@@ -235,7 +235,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,struct net_device *indev;struct net_device *outdev;struct nf_conn *ct =NULL ; -enum ip_conntrack_info uninitialized_var (ctinfo ); +enum ip_conntrack_info ctinfo =0 ;/* Avoid GCC warning */ size =NLMSG_SPACE (sizeof (struct nfgenmsg )) +nla_total_size (sizeof (struct nfqnl_msg_packet_hdr ))
@@ -751,7 +751,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,struct nfqnl_instance *queue;unsigned int verdict;struct nf_queue_entry *entry; -enum ip_conntrack_info uninitialized_var (ctinfo ); +enum ip_conntrack_info ctinfo =0 ;/* Avoid GCC warning */ struct nf_conn *ct =NULL ; queue =instance_lookup (queue_num);
net/netfilter/xt_socket.c +5 -5
@@ -108,9 +108,9 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,const struct iphdr *iph =ip_hdr (skb);struct udphdr _hdr, *hp =NULL ;struct sock *sk; -__be32 uninitialized_var (daddr ),uninitialized_var (saddr ); -__be16 uninitialized_var (dport ),uninitialized_var (sport ); -u8 uninitialized_var (protocol ); +__be32 daddr =0 /* Avoid GCC warning */ , saddr =0 ;/* Avoid GCC warning */ +__be16 dport =0 /* Avoid GCC warning */ , sport =0 ;/* Avoid GCC warning */ +u8 protocol =0 ;/* Avoid GCC warning */ #ifdef XT_SOCKET_HAVE_CONNTRACK struct nf_conn const *ct;enum ip_conntrack_info ctinfo;
@@ -262,8 +262,8 @@ socket_mt6_v1(const struct sk_buff *skb, struct xt_action_param *par)struct udphdr _hdr, *hp =NULL ;struct sock *sk;struct in6_addr *daddr =NULL , *saddr =NULL ; -__be16 uninitialized_var (dport ),uninitialized_var (sport ); -int thoff =0 ,uninitialized_var (tproto ); +__be16 dport =0 /* Avoid GCC warning */ , sport =0 ;/* Avoid GCC warning */ +int thoff =0 , tproto =0 ;/* Avoid GCC warning */ const struct xt_socket_mtinfo1 *info = (struct xt_socket_mtinfo1 *) par->matchinfo; tproto =ipv6_find_hdr (skb, &thoff,-1 ,NULL ,NULL );
net/sched/cls_flow.c +1 -1
@@ -211,7 +211,7 @@ static u32 flow_get_skgid(const struct sk_buff *skb)static u32 flow_get_vlan_tag (const struct sk_buff *skb) { -u16 uninitialized_var (tag ); +u16 tag =0 ;/* Avoid GCC warning */ if (vlan_get_tag (skb, &tag) <0 )return 0 ;
net/sched/sch_cbq.c +1 -1
@@ -373,7 +373,7 @@ static int cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct cbq_sched_data *q = qdisc_priv(sch); -int uninitialized_var (ret ); +int ret =0 ;/* Avoid GCC warning */ struct cbq_class *cl =cbq_classify (skb, sch, &ret);#ifdef CONFIG_NET_CLS_ACT
net/sched/sch_fq_codel.c +1 -1
@@ -172,7 +172,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)struct fq_codel_sched_data *q =qdisc_priv (sch);unsigned int idx;struct fq_codel_flow *flow; -int uninitialized_var (ret ); +int ret =0 ;/* Avoid GCC warning */ idx =fq_codel_classify (skb, sch, &ret);if (idx ==0 ) {
net/sched/sch_hfsc.c +1 -1
@@ -1587,7 +1587,7 @@ static int hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct hfsc_class *cl; -int uninitialized_var (err ); +int err =0 ;/* Avoid GCC warning */ cl =hfsc_classify (skb, sch, &err);if (cl ==NULL ) {
net/sched/sch_htb.c +1 -1
@@ -548,7 +548,7 @@ static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl)static int htb_enqueue (struct sk_buff *skb,struct Qdisc *sch) { -int uninitialized_var (ret ); +int ret =0 ;/* Avoid GCC warning */ struct htb_sched *q =qdisc_priv (sch);struct htb_class *cl =htb_classify (skb, sch, &ret);
net/sched/sch_sfq.c +1 -1
@@ -373,7 +373,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)unsigned int hash;sfq_index x, qlen;struct sfq_slot *slot; -int uninitialized_var (ret ); +int ret =0 ;/* Avoid GCC warning */ struct sk_buff *head;int delta;
net/sunrpc/xprtrdma/svc_rdma_transport.c +1 -1
@@ -831,7 +831,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)struct rdma_conn_param conn_param;struct ib_qp_init_attr qp_attr;struct ib_device_attr devattr; -int uninitialized_var (dma_mr_acc ); +int dma_mr_acc =0 ;/* Avoid GCC warning */ int need_dma_mr;int ret;int i;
sound/core/control_compat.c +1 -1
@@ -223,7 +223,7 @@ static int copy_ctl_value_from_user(struct snd_card *card, int *typep, int *countp) { int i, type, size; -int uninitialized_var (count ); +int count =0 ;/* Avoid GCC warning */ unsigned int indirect;if (copy_from_user (&data->id, &data32->id,sizeof (data->id)))
sound/isa/sb/sb16_csp.c +1 -1
@@ -116,7 +116,7 @@ static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffint snd_sb_csp_new (struct snd_sb *chip,int device,struct snd_hwdep ** rhwdep) {struct snd_sb_csp *p; -int uninitialized_var (version ); +int version =0 ;/* Avoid GCC warning */ int err;struct snd_hwdep *hw;
sound/usb/endpoint.c +1 -1
@@ -300,7 +300,7 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep)while (test_bit (EP_FLAG_RUNNING , &ep->flags)) {unsigned long flags; -struct snd_usb_packet_info *uninitialized_var (packet ); +struct snd_usb_packet_info *packet =NULL ;/* Avoid GCC warning */ struct snd_urb_ctx *ctx =NULL ;struct urb *urb;int err, i;
tools/virtio/linux/virtio.h +0 -2
@@ -105,8 +105,6 @@ static inline void kfree(void *p) const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -#define uninitialized_var (x) x = x -# ifndef likely# define likely (x) (__builtin_expect(!!(x), 1))# endif
David Rientjes
reviewerRe: [PATCH v2] Remove uninitialized_var()
In reply to Ingo MolnarQuoted 11 lines · Ingo Molnar
I left it a bit mystic because in some cases this macro was mis-used not to suppress GCC being wrong, but to hide GCC being *right*: for example unused variable warnings in cases like:
int uninitialized_var(var); #ifdef XYZ var = ...; ... #endif
Quoted 5 lines
which (ab-)use was no doubt actively dangerous beyond being ugly. One such example is in
arch/x86/mm/numa.c. (These cases now turn into clear (and always harmless) compiler warnings, as they should.)
I like initializing them to 0 or NULL because it will still emit the "unused variable" warnings whereas using uninitialized_var() would not with -Wall. It's quite possible that uninitialized_var() is actually suppressing this warning for variables that aren't used.
I fixed a bug that was attributed to uninitialized var for rc1 in 43385846968b ("fs, xattr: fix bug when removing a name not in xattr list"), so thanks very much for removing it entirely.
Re: [PATCH v2] Remove uninitialized_var()
Quoted 19 lines · David Rientjes
Quoted 11 lines · Ingo Molnar
I left it a bit mystic because in some cases this macro was mis-used not to suppress GCC being wrong, but to hide GCC being *right*: for example unused variable warnings in cases like:
int uninitialized_var(var); #ifdef XYZ var = ...; ... #endifQuoted 5 lines
which (ab-)use was no doubt actively dangerous beyond being ugly. One such example is in
arch/x86/mm/numa.c. (These cases now turn into clear (and always harmless) compiler warnings, as they should.)
Quoted 5 lines
I like initializing them to 0 or NULL because it will still emit the "unused variable" warnings whereas using
uninitialized_var()would not with -Wall. It's quite possible thatuninitialized_var()is actually suppressing this warning for variables that aren't used.
Yeah.
Quoted 3 lines
I fixed a bug that was attributed to uninitialized var for rc1 in
43385846968b("fs, xattr: fix bug when removing a name not in xattr list"), so thanks very much for removing it entirely.
Ok - looks like everyone is happy with this version - I'll send a refreshed version of this patch to Linus near the end of the v3.8 merge window.
Note, I won't push it out into linux-next for much of the development window (or at all), as there's very little gain from all the interaction and churn this would cause with various trees, nor does it seem necessary to split it up into a hundred small patches. We'll just pull the trigger before v3.8-rc1 with one well-tested patch and that's it.
Unless Linus objects to this workflow.
Thanks,
Ingo
PATCH 5/5 IPMI: Detect register spacing on PCI interfaces
In reply to [email protected]From: Corey Minyard <[email protected]>
The IPMI spec defines a way to detect register spacing for PCI interfaces, so implement it.
--- drivers/char/ipmi/ipmi_si_intf.c | 36 ++++++++++++++++++++++++++++++++++-- 1 files changed, 34 insertions(+), 2 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c +34 -2
@@ -2424,6 +2424,38 @@ static void ipmi_pci_cleanup(struct smi_info *info)pci_disable_device (pdev); } +static int __devinit ipmi_pci_probe_regspacing (struct smi_info *info) +{ +if (info->si_type ==SI_KCS ) { +unsigned char status; +int regspacing; + + info->io.regsize =DEFAULT_REGSIZE ; + info->io.regshift =0 ; + info->io_size =2 ; + info->handlers = &kcs_smi_handlers; + +/* detect 1, 4, 16byte spacing */ +for (regspacing =DEFAULT_REGSPACING ; regspacing <=16 ;) { + info->io.regspacing = regspacing; +if (info->io_setup (info)) { +dev_err (info->dev, +"Could not setup I/O space\n" ); +return DEFAULT_REGSPACING ; + } +/* write invalid cmd */ + info->io.outputb (&info->io,1 ,0x10 ); +/* read status back */ + status = info->io.inputb (&info->io,1 ); + info->io_cleanup (info); +if (status) +return regspacing; + regspacing *=4 ; + } + } +return DEFAULT_REGSPACING ; +} +static int __devinit ipmi_pci_probe (struct pci_dev *pdev,const struct pci_device_id *ent) {
@@ -2476,8 +2508,8 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev, } info->io.addr_data =pci_resource_start (pdev,0 ); - info->io.regspacing =DEFAULT_REGSPACING ; - info->io.regsize =DEFAULT_REGSPACING ; + info->io.regspacing =ipmi_pci_probe_regspacing (info); + info->io.regsize =DEFAULT_REGSIZE ; info->io.regshift =0 ; info->irq = pdev->irq;
Signature · 1 line
1.7.4.1