arch/i386/* fs/* ipc/*: mark variables with uninitialized_var()
authorJeff Garzik <jeff@garzik.org>
Tue, 17 Jul 2007 09:40:59 +0000 (05:40 -0400)
committerJeff Garzik <jeff@garzik.org>
Tue, 17 Jul 2007 20:23:19 +0000 (16:23 -0400)
Mark variables with uninitialized_var() if such a warning appears,
and analysis proves that the var is initialized properly on all paths
it is used.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
arch/i386/kernel/efi.c
fs/ocfs2/file.c
fs/udf/super.c
ipc/msg.c
ipc/sem.c

index a1808022ea19bf6a5fab059c6cff765bdde3acfb..2452c6fbe9927bf34e804ade8e65b2a48b1927b8 100644 (file)
@@ -278,7 +278,7 @@ void efi_memmap_walk(efi_freemem_callback_t callback, void *arg)
        struct range {
                unsigned long start;
                unsigned long end;
-       } prev, curr;
+       } uninitialized_var(prev), curr;
        efi_memory_desc_t *md;
        unsigned long start, end;
        void *p;
index f04c7aa834cb838b1efd98196ccce2eba8312b95..004c2abbc7323280c0ad1df75f34f17a88352110 100644 (file)
@@ -1867,7 +1867,8 @@ static ssize_t ocfs2_file_buffered_write(struct file *file, loff_t *ppos,
        loff_t pos;
        const struct iovec *cur_iov = iov;
        struct page *user_page, *page;
-       char *buf, *dst;
+       char * uninitialized_var(buf);
+       char *dst;
        void *fsdata;
 
        /*
index 6658afb41cc7564ffeced0d42e0b35b0421baf0e..d6a504f5d758fb0ecfabead59258ac5b9ff63be6 100644 (file)
@@ -1356,7 +1356,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
                        case UDF_VIRTUAL_MAP15:
                        case UDF_VIRTUAL_MAP20:
                        {
-                               kernel_lb_addr ino;
+                               kernel_lb_addr uninitialized_var(ino);
 
                                if (!UDF_SB_LASTBLOCK(sb))
                                {
index cbd27e519943b140a2f291cecbf3e0e89820172a..a03fcb522fff827df275ab75a7e2c76610e229b7 100644 (file)
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -385,7 +385,7 @@ copy_msqid_from_user(struct msq_setbuf *out, void __user *buf, int version)
 asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf)
 {
        struct kern_ipc_perm *ipcp;
-       struct msq_setbuf setbuf;
+       struct msq_setbuf uninitialized_var(setbuf);
        struct msg_queue *msq;
        int err, version;
        struct ipc_namespace *ns;
@@ -509,7 +509,7 @@ asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf)
        err = audit_ipc_obj(ipcp);
        if (err)
                goto out_unlock_up;
-       if (cmd==IPC_SET) {
+       if (cmd == IPC_SET) {
                err = audit_ipc_set_perm(setbuf.qbytes, setbuf.uid, setbuf.gid,
                                         setbuf.mode);
                if (err)
index 89bfdffb38d8f590818b28ae6844d0b40fb1095f..b676fef6d208b563dfe52929f6ef8a491860a928 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -856,7 +856,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid, int semnum,
 {
        struct sem_array *sma;
        int err;
-       struct sem_setbuf setbuf;
+       struct sem_setbuf uninitialized_var(setbuf);
        struct kern_ipc_perm *ipcp;
 
        if(cmd == IPC_SET) {